1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10pub use fidl_fuchsia_stash_common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14#[derive(Debug, PartialEq)]
15pub struct GetIteratorGetNextResponse {
16 pub kvs: Vec<KeyValue>,
17}
18
19impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
20 for GetIteratorGetNextResponse
21{
22}
23
24#[derive(Debug, PartialEq)]
27pub struct KeyValue {
28 pub key: String,
29 pub val: Value,
30}
31
32impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for KeyValue {}
33
34#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
35pub struct StoreAccessorGetPrefixRequest {
36 pub prefix: String,
37 pub it: fidl::endpoints::ServerEnd<GetIteratorMarker>,
38}
39
40impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
41 for StoreAccessorGetPrefixRequest
42{
43}
44
45#[derive(Debug, PartialEq)]
46pub struct StoreAccessorGetValueResponse {
47 pub val: Option<Box<Value>>,
48}
49
50impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
51 for StoreAccessorGetValueResponse
52{
53}
54
55#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
56pub struct StoreAccessorListPrefixRequest {
57 pub prefix: String,
58 pub it: fidl::endpoints::ServerEnd<ListIteratorMarker>,
59}
60
61impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
62 for StoreAccessorListPrefixRequest
63{
64}
65
66#[derive(Debug, PartialEq)]
67pub struct StoreAccessorSetValueRequest {
68 pub key: String,
69 pub val: Value,
70}
71
72impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
73 for StoreAccessorSetValueRequest
74{
75}
76
77#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
78pub struct StoreCreateAccessorRequest {
79 pub read_only: bool,
80 pub accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
81}
82
83impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
84 for StoreCreateAccessorRequest
85{
86}
87
88#[derive(Debug, PartialEq)]
90pub enum Value {
91 Intval(i64),
92 Floatval(f64),
93 Boolval(bool),
94 Stringval(String),
95 Bytesval(fidl_fuchsia_mem::Buffer),
96}
97
98impl Value {
99 #[inline]
100 pub fn ordinal(&self) -> u64 {
101 match *self {
102 Self::Intval(_) => 1,
103 Self::Floatval(_) => 2,
104 Self::Boolval(_) => 3,
105 Self::Stringval(_) => 4,
106 Self::Bytesval(_) => 5,
107 }
108 }
109
110 #[deprecated = "Strict unions should not use `is_unknown`"]
111 #[inline]
112 pub fn is_unknown(&self) -> bool {
113 false
114 }
115}
116
117impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Value {}
118
119#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
120pub struct GetIteratorMarker;
121
122impl fidl::endpoints::ProtocolMarker for GetIteratorMarker {
123 type Proxy = GetIteratorProxy;
124 type RequestStream = GetIteratorRequestStream;
125 #[cfg(target_os = "fuchsia")]
126 type SynchronousProxy = GetIteratorSynchronousProxy;
127
128 const DEBUG_NAME: &'static str = "(anonymous) GetIterator";
129}
130
131pub trait GetIteratorProxyInterface: Send + Sync {
132 type GetNextResponseFut: std::future::Future<Output = Result<Vec<KeyValue>, fidl::Error>> + Send;
133 fn r#get_next(&self) -> Self::GetNextResponseFut;
134}
135#[derive(Debug)]
136#[cfg(target_os = "fuchsia")]
137pub struct GetIteratorSynchronousProxy {
138 client: fidl::client::sync::Client,
139}
140
141#[cfg(target_os = "fuchsia")]
142impl fidl::endpoints::SynchronousProxy for GetIteratorSynchronousProxy {
143 type Proxy = GetIteratorProxy;
144 type Protocol = GetIteratorMarker;
145
146 fn from_channel(inner: fidl::Channel) -> Self {
147 Self::new(inner)
148 }
149
150 fn into_channel(self) -> fidl::Channel {
151 self.client.into_channel()
152 }
153
154 fn as_channel(&self) -> &fidl::Channel {
155 self.client.as_channel()
156 }
157}
158
159#[cfg(target_os = "fuchsia")]
160impl GetIteratorSynchronousProxy {
161 pub fn new(channel: fidl::Channel) -> Self {
162 let protocol_name = <GetIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
163 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
164 }
165
166 pub fn into_channel(self) -> fidl::Channel {
167 self.client.into_channel()
168 }
169
170 pub fn wait_for_event(
173 &self,
174 deadline: zx::MonotonicInstant,
175 ) -> Result<GetIteratorEvent, fidl::Error> {
176 GetIteratorEvent::decode(self.client.wait_for_event(deadline)?)
177 }
178
179 pub fn r#get_next(
180 &self,
181 ___deadline: zx::MonotonicInstant,
182 ) -> Result<Vec<KeyValue>, fidl::Error> {
183 let _response =
184 self.client.send_query::<fidl::encoding::EmptyPayload, GetIteratorGetNextResponse>(
185 (),
186 0xe0a5a8ea5dbfbf5,
187 fidl::encoding::DynamicFlags::empty(),
188 ___deadline,
189 )?;
190 Ok(_response.kvs)
191 }
192}
193
194#[cfg(target_os = "fuchsia")]
195impl From<GetIteratorSynchronousProxy> for zx::Handle {
196 fn from(value: GetIteratorSynchronousProxy) -> Self {
197 value.into_channel().into()
198 }
199}
200
201#[cfg(target_os = "fuchsia")]
202impl From<fidl::Channel> for GetIteratorSynchronousProxy {
203 fn from(value: fidl::Channel) -> Self {
204 Self::new(value)
205 }
206}
207
208#[derive(Debug, Clone)]
209pub struct GetIteratorProxy {
210 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
211}
212
213impl fidl::endpoints::Proxy for GetIteratorProxy {
214 type Protocol = GetIteratorMarker;
215
216 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
217 Self::new(inner)
218 }
219
220 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
221 self.client.into_channel().map_err(|client| Self { client })
222 }
223
224 fn as_channel(&self) -> &::fidl::AsyncChannel {
225 self.client.as_channel()
226 }
227}
228
229impl GetIteratorProxy {
230 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
232 let protocol_name = <GetIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
233 Self { client: fidl::client::Client::new(channel, protocol_name) }
234 }
235
236 pub fn take_event_stream(&self) -> GetIteratorEventStream {
242 GetIteratorEventStream { event_receiver: self.client.take_event_receiver() }
243 }
244
245 pub fn r#get_next(
246 &self,
247 ) -> fidl::client::QueryResponseFut<Vec<KeyValue>, fidl::encoding::DefaultFuchsiaResourceDialect>
248 {
249 GetIteratorProxyInterface::r#get_next(self)
250 }
251}
252
253impl GetIteratorProxyInterface for GetIteratorProxy {
254 type GetNextResponseFut = fidl::client::QueryResponseFut<
255 Vec<KeyValue>,
256 fidl::encoding::DefaultFuchsiaResourceDialect,
257 >;
258 fn r#get_next(&self) -> Self::GetNextResponseFut {
259 fn _decode(
260 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
261 ) -> Result<Vec<KeyValue>, fidl::Error> {
262 let _response = fidl::client::decode_transaction_body::<
263 GetIteratorGetNextResponse,
264 fidl::encoding::DefaultFuchsiaResourceDialect,
265 0xe0a5a8ea5dbfbf5,
266 >(_buf?)?;
267 Ok(_response.kvs)
268 }
269 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<KeyValue>>(
270 (),
271 0xe0a5a8ea5dbfbf5,
272 fidl::encoding::DynamicFlags::empty(),
273 _decode,
274 )
275 }
276}
277
278pub struct GetIteratorEventStream {
279 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
280}
281
282impl std::marker::Unpin for GetIteratorEventStream {}
283
284impl futures::stream::FusedStream for GetIteratorEventStream {
285 fn is_terminated(&self) -> bool {
286 self.event_receiver.is_terminated()
287 }
288}
289
290impl futures::Stream for GetIteratorEventStream {
291 type Item = Result<GetIteratorEvent, fidl::Error>;
292
293 fn poll_next(
294 mut self: std::pin::Pin<&mut Self>,
295 cx: &mut std::task::Context<'_>,
296 ) -> std::task::Poll<Option<Self::Item>> {
297 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
298 &mut self.event_receiver,
299 cx
300 )?) {
301 Some(buf) => std::task::Poll::Ready(Some(GetIteratorEvent::decode(buf))),
302 None => std::task::Poll::Ready(None),
303 }
304 }
305}
306
307#[derive(Debug)]
308pub enum GetIteratorEvent {}
309
310impl GetIteratorEvent {
311 fn decode(
313 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
314 ) -> Result<GetIteratorEvent, fidl::Error> {
315 let (bytes, _handles) = buf.split_mut();
316 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
317 debug_assert_eq!(tx_header.tx_id, 0);
318 match tx_header.ordinal {
319 _ => Err(fidl::Error::UnknownOrdinal {
320 ordinal: tx_header.ordinal,
321 protocol_name: <GetIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
322 }),
323 }
324 }
325}
326
327pub struct GetIteratorRequestStream {
329 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
330 is_terminated: bool,
331}
332
333impl std::marker::Unpin for GetIteratorRequestStream {}
334
335impl futures::stream::FusedStream for GetIteratorRequestStream {
336 fn is_terminated(&self) -> bool {
337 self.is_terminated
338 }
339}
340
341impl fidl::endpoints::RequestStream for GetIteratorRequestStream {
342 type Protocol = GetIteratorMarker;
343 type ControlHandle = GetIteratorControlHandle;
344
345 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
346 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
347 }
348
349 fn control_handle(&self) -> Self::ControlHandle {
350 GetIteratorControlHandle { inner: self.inner.clone() }
351 }
352
353 fn into_inner(
354 self,
355 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
356 {
357 (self.inner, self.is_terminated)
358 }
359
360 fn from_inner(
361 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
362 is_terminated: bool,
363 ) -> Self {
364 Self { inner, is_terminated }
365 }
366}
367
368impl futures::Stream for GetIteratorRequestStream {
369 type Item = Result<GetIteratorRequest, fidl::Error>;
370
371 fn poll_next(
372 mut self: std::pin::Pin<&mut Self>,
373 cx: &mut std::task::Context<'_>,
374 ) -> std::task::Poll<Option<Self::Item>> {
375 let this = &mut *self;
376 if this.inner.check_shutdown(cx) {
377 this.is_terminated = true;
378 return std::task::Poll::Ready(None);
379 }
380 if this.is_terminated {
381 panic!("polled GetIteratorRequestStream after completion");
382 }
383 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
384 |bytes, handles| {
385 match this.inner.channel().read_etc(cx, bytes, handles) {
386 std::task::Poll::Ready(Ok(())) => {}
387 std::task::Poll::Pending => return std::task::Poll::Pending,
388 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
389 this.is_terminated = true;
390 return std::task::Poll::Ready(None);
391 }
392 std::task::Poll::Ready(Err(e)) => {
393 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
394 e.into(),
395 ))))
396 }
397 }
398
399 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
401
402 std::task::Poll::Ready(Some(match header.ordinal {
403 0xe0a5a8ea5dbfbf5 => {
404 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
405 let mut req = fidl::new_empty!(
406 fidl::encoding::EmptyPayload,
407 fidl::encoding::DefaultFuchsiaResourceDialect
408 );
409 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
410 let control_handle = GetIteratorControlHandle { inner: this.inner.clone() };
411 Ok(GetIteratorRequest::GetNext {
412 responder: GetIteratorGetNextResponder {
413 control_handle: std::mem::ManuallyDrop::new(control_handle),
414 tx_id: header.tx_id,
415 },
416 })
417 }
418 _ => Err(fidl::Error::UnknownOrdinal {
419 ordinal: header.ordinal,
420 protocol_name:
421 <GetIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
422 }),
423 }))
424 },
425 )
426 }
427}
428
429#[derive(Debug)]
432pub enum GetIteratorRequest {
433 GetNext { responder: GetIteratorGetNextResponder },
434}
435
436impl GetIteratorRequest {
437 #[allow(irrefutable_let_patterns)]
438 pub fn into_get_next(self) -> Option<(GetIteratorGetNextResponder)> {
439 if let GetIteratorRequest::GetNext { responder } = self {
440 Some((responder))
441 } else {
442 None
443 }
444 }
445
446 pub fn method_name(&self) -> &'static str {
448 match *self {
449 GetIteratorRequest::GetNext { .. } => "get_next",
450 }
451 }
452}
453
454#[derive(Debug, Clone)]
455pub struct GetIteratorControlHandle {
456 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
457}
458
459impl fidl::endpoints::ControlHandle for GetIteratorControlHandle {
460 fn shutdown(&self) {
461 self.inner.shutdown()
462 }
463 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
464 self.inner.shutdown_with_epitaph(status)
465 }
466
467 fn is_closed(&self) -> bool {
468 self.inner.channel().is_closed()
469 }
470 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
471 self.inner.channel().on_closed()
472 }
473
474 #[cfg(target_os = "fuchsia")]
475 fn signal_peer(
476 &self,
477 clear_mask: zx::Signals,
478 set_mask: zx::Signals,
479 ) -> Result<(), zx_status::Status> {
480 use fidl::Peered;
481 self.inner.channel().signal_peer(clear_mask, set_mask)
482 }
483}
484
485impl GetIteratorControlHandle {}
486
487#[must_use = "FIDL methods require a response to be sent"]
488#[derive(Debug)]
489pub struct GetIteratorGetNextResponder {
490 control_handle: std::mem::ManuallyDrop<GetIteratorControlHandle>,
491 tx_id: u32,
492}
493
494impl std::ops::Drop for GetIteratorGetNextResponder {
498 fn drop(&mut self) {
499 self.control_handle.shutdown();
500 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
502 }
503}
504
505impl fidl::endpoints::Responder for GetIteratorGetNextResponder {
506 type ControlHandle = GetIteratorControlHandle;
507
508 fn control_handle(&self) -> &GetIteratorControlHandle {
509 &self.control_handle
510 }
511
512 fn drop_without_shutdown(mut self) {
513 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
515 std::mem::forget(self);
517 }
518}
519
520impl GetIteratorGetNextResponder {
521 pub fn send(self, mut kvs: Vec<KeyValue>) -> Result<(), fidl::Error> {
525 let _result = self.send_raw(kvs);
526 if _result.is_err() {
527 self.control_handle.shutdown();
528 }
529 self.drop_without_shutdown();
530 _result
531 }
532
533 pub fn send_no_shutdown_on_err(self, mut kvs: Vec<KeyValue>) -> Result<(), fidl::Error> {
535 let _result = self.send_raw(kvs);
536 self.drop_without_shutdown();
537 _result
538 }
539
540 fn send_raw(&self, mut kvs: Vec<KeyValue>) -> Result<(), fidl::Error> {
541 self.control_handle.inner.send::<GetIteratorGetNextResponse>(
542 (kvs.as_mut(),),
543 self.tx_id,
544 0xe0a5a8ea5dbfbf5,
545 fidl::encoding::DynamicFlags::empty(),
546 )
547 }
548}
549
550#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
551pub struct ListIteratorMarker;
552
553impl fidl::endpoints::ProtocolMarker for ListIteratorMarker {
554 type Proxy = ListIteratorProxy;
555 type RequestStream = ListIteratorRequestStream;
556 #[cfg(target_os = "fuchsia")]
557 type SynchronousProxy = ListIteratorSynchronousProxy;
558
559 const DEBUG_NAME: &'static str = "(anonymous) ListIterator";
560}
561
562pub trait ListIteratorProxyInterface: Send + Sync {
563 type GetNextResponseFut: std::future::Future<Output = Result<Vec<ListItem>, fidl::Error>> + Send;
564 fn r#get_next(&self) -> Self::GetNextResponseFut;
565}
566#[derive(Debug)]
567#[cfg(target_os = "fuchsia")]
568pub struct ListIteratorSynchronousProxy {
569 client: fidl::client::sync::Client,
570}
571
572#[cfg(target_os = "fuchsia")]
573impl fidl::endpoints::SynchronousProxy for ListIteratorSynchronousProxy {
574 type Proxy = ListIteratorProxy;
575 type Protocol = ListIteratorMarker;
576
577 fn from_channel(inner: fidl::Channel) -> Self {
578 Self::new(inner)
579 }
580
581 fn into_channel(self) -> fidl::Channel {
582 self.client.into_channel()
583 }
584
585 fn as_channel(&self) -> &fidl::Channel {
586 self.client.as_channel()
587 }
588}
589
590#[cfg(target_os = "fuchsia")]
591impl ListIteratorSynchronousProxy {
592 pub fn new(channel: fidl::Channel) -> Self {
593 let protocol_name = <ListIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
594 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
595 }
596
597 pub fn into_channel(self) -> fidl::Channel {
598 self.client.into_channel()
599 }
600
601 pub fn wait_for_event(
604 &self,
605 deadline: zx::MonotonicInstant,
606 ) -> Result<ListIteratorEvent, fidl::Error> {
607 ListIteratorEvent::decode(self.client.wait_for_event(deadline)?)
608 }
609
610 pub fn r#get_next(
611 &self,
612 ___deadline: zx::MonotonicInstant,
613 ) -> Result<Vec<ListItem>, fidl::Error> {
614 let _response =
615 self.client.send_query::<fidl::encoding::EmptyPayload, ListIteratorGetNextResponse>(
616 (),
617 0x6d8646b717dd56a2,
618 fidl::encoding::DynamicFlags::empty(),
619 ___deadline,
620 )?;
621 Ok(_response.keys)
622 }
623}
624
625#[cfg(target_os = "fuchsia")]
626impl From<ListIteratorSynchronousProxy> for zx::Handle {
627 fn from(value: ListIteratorSynchronousProxy) -> Self {
628 value.into_channel().into()
629 }
630}
631
632#[cfg(target_os = "fuchsia")]
633impl From<fidl::Channel> for ListIteratorSynchronousProxy {
634 fn from(value: fidl::Channel) -> Self {
635 Self::new(value)
636 }
637}
638
639#[derive(Debug, Clone)]
640pub struct ListIteratorProxy {
641 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
642}
643
644impl fidl::endpoints::Proxy for ListIteratorProxy {
645 type Protocol = ListIteratorMarker;
646
647 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
648 Self::new(inner)
649 }
650
651 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
652 self.client.into_channel().map_err(|client| Self { client })
653 }
654
655 fn as_channel(&self) -> &::fidl::AsyncChannel {
656 self.client.as_channel()
657 }
658}
659
660impl ListIteratorProxy {
661 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
663 let protocol_name = <ListIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
664 Self { client: fidl::client::Client::new(channel, protocol_name) }
665 }
666
667 pub fn take_event_stream(&self) -> ListIteratorEventStream {
673 ListIteratorEventStream { event_receiver: self.client.take_event_receiver() }
674 }
675
676 pub fn r#get_next(
677 &self,
678 ) -> fidl::client::QueryResponseFut<Vec<ListItem>, fidl::encoding::DefaultFuchsiaResourceDialect>
679 {
680 ListIteratorProxyInterface::r#get_next(self)
681 }
682}
683
684impl ListIteratorProxyInterface for ListIteratorProxy {
685 type GetNextResponseFut = fidl::client::QueryResponseFut<
686 Vec<ListItem>,
687 fidl::encoding::DefaultFuchsiaResourceDialect,
688 >;
689 fn r#get_next(&self) -> Self::GetNextResponseFut {
690 fn _decode(
691 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
692 ) -> Result<Vec<ListItem>, fidl::Error> {
693 let _response = fidl::client::decode_transaction_body::<
694 ListIteratorGetNextResponse,
695 fidl::encoding::DefaultFuchsiaResourceDialect,
696 0x6d8646b717dd56a2,
697 >(_buf?)?;
698 Ok(_response.keys)
699 }
700 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<ListItem>>(
701 (),
702 0x6d8646b717dd56a2,
703 fidl::encoding::DynamicFlags::empty(),
704 _decode,
705 )
706 }
707}
708
709pub struct ListIteratorEventStream {
710 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
711}
712
713impl std::marker::Unpin for ListIteratorEventStream {}
714
715impl futures::stream::FusedStream for ListIteratorEventStream {
716 fn is_terminated(&self) -> bool {
717 self.event_receiver.is_terminated()
718 }
719}
720
721impl futures::Stream for ListIteratorEventStream {
722 type Item = Result<ListIteratorEvent, fidl::Error>;
723
724 fn poll_next(
725 mut self: std::pin::Pin<&mut Self>,
726 cx: &mut std::task::Context<'_>,
727 ) -> std::task::Poll<Option<Self::Item>> {
728 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
729 &mut self.event_receiver,
730 cx
731 )?) {
732 Some(buf) => std::task::Poll::Ready(Some(ListIteratorEvent::decode(buf))),
733 None => std::task::Poll::Ready(None),
734 }
735 }
736}
737
738#[derive(Debug)]
739pub enum ListIteratorEvent {}
740
741impl ListIteratorEvent {
742 fn decode(
744 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
745 ) -> Result<ListIteratorEvent, fidl::Error> {
746 let (bytes, _handles) = buf.split_mut();
747 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
748 debug_assert_eq!(tx_header.tx_id, 0);
749 match tx_header.ordinal {
750 _ => Err(fidl::Error::UnknownOrdinal {
751 ordinal: tx_header.ordinal,
752 protocol_name: <ListIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
753 }),
754 }
755 }
756}
757
758pub struct ListIteratorRequestStream {
760 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
761 is_terminated: bool,
762}
763
764impl std::marker::Unpin for ListIteratorRequestStream {}
765
766impl futures::stream::FusedStream for ListIteratorRequestStream {
767 fn is_terminated(&self) -> bool {
768 self.is_terminated
769 }
770}
771
772impl fidl::endpoints::RequestStream for ListIteratorRequestStream {
773 type Protocol = ListIteratorMarker;
774 type ControlHandle = ListIteratorControlHandle;
775
776 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
777 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
778 }
779
780 fn control_handle(&self) -> Self::ControlHandle {
781 ListIteratorControlHandle { inner: self.inner.clone() }
782 }
783
784 fn into_inner(
785 self,
786 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
787 {
788 (self.inner, self.is_terminated)
789 }
790
791 fn from_inner(
792 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
793 is_terminated: bool,
794 ) -> Self {
795 Self { inner, is_terminated }
796 }
797}
798
799impl futures::Stream for ListIteratorRequestStream {
800 type Item = Result<ListIteratorRequest, fidl::Error>;
801
802 fn poll_next(
803 mut self: std::pin::Pin<&mut Self>,
804 cx: &mut std::task::Context<'_>,
805 ) -> std::task::Poll<Option<Self::Item>> {
806 let this = &mut *self;
807 if this.inner.check_shutdown(cx) {
808 this.is_terminated = true;
809 return std::task::Poll::Ready(None);
810 }
811 if this.is_terminated {
812 panic!("polled ListIteratorRequestStream after completion");
813 }
814 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
815 |bytes, handles| {
816 match this.inner.channel().read_etc(cx, bytes, handles) {
817 std::task::Poll::Ready(Ok(())) => {}
818 std::task::Poll::Pending => return std::task::Poll::Pending,
819 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
820 this.is_terminated = true;
821 return std::task::Poll::Ready(None);
822 }
823 std::task::Poll::Ready(Err(e)) => {
824 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
825 e.into(),
826 ))))
827 }
828 }
829
830 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
832
833 std::task::Poll::Ready(Some(match header.ordinal {
834 0x6d8646b717dd56a2 => {
835 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
836 let mut req = fidl::new_empty!(
837 fidl::encoding::EmptyPayload,
838 fidl::encoding::DefaultFuchsiaResourceDialect
839 );
840 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
841 let control_handle =
842 ListIteratorControlHandle { inner: this.inner.clone() };
843 Ok(ListIteratorRequest::GetNext {
844 responder: ListIteratorGetNextResponder {
845 control_handle: std::mem::ManuallyDrop::new(control_handle),
846 tx_id: header.tx_id,
847 },
848 })
849 }
850 _ => Err(fidl::Error::UnknownOrdinal {
851 ordinal: header.ordinal,
852 protocol_name:
853 <ListIteratorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
854 }),
855 }))
856 },
857 )
858 }
859}
860
861#[derive(Debug)]
864pub enum ListIteratorRequest {
865 GetNext { responder: ListIteratorGetNextResponder },
866}
867
868impl ListIteratorRequest {
869 #[allow(irrefutable_let_patterns)]
870 pub fn into_get_next(self) -> Option<(ListIteratorGetNextResponder)> {
871 if let ListIteratorRequest::GetNext { responder } = self {
872 Some((responder))
873 } else {
874 None
875 }
876 }
877
878 pub fn method_name(&self) -> &'static str {
880 match *self {
881 ListIteratorRequest::GetNext { .. } => "get_next",
882 }
883 }
884}
885
886#[derive(Debug, Clone)]
887pub struct ListIteratorControlHandle {
888 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
889}
890
891impl fidl::endpoints::ControlHandle for ListIteratorControlHandle {
892 fn shutdown(&self) {
893 self.inner.shutdown()
894 }
895 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
896 self.inner.shutdown_with_epitaph(status)
897 }
898
899 fn is_closed(&self) -> bool {
900 self.inner.channel().is_closed()
901 }
902 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
903 self.inner.channel().on_closed()
904 }
905
906 #[cfg(target_os = "fuchsia")]
907 fn signal_peer(
908 &self,
909 clear_mask: zx::Signals,
910 set_mask: zx::Signals,
911 ) -> Result<(), zx_status::Status> {
912 use fidl::Peered;
913 self.inner.channel().signal_peer(clear_mask, set_mask)
914 }
915}
916
917impl ListIteratorControlHandle {}
918
919#[must_use = "FIDL methods require a response to be sent"]
920#[derive(Debug)]
921pub struct ListIteratorGetNextResponder {
922 control_handle: std::mem::ManuallyDrop<ListIteratorControlHandle>,
923 tx_id: u32,
924}
925
926impl std::ops::Drop for ListIteratorGetNextResponder {
930 fn drop(&mut self) {
931 self.control_handle.shutdown();
932 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
934 }
935}
936
937impl fidl::endpoints::Responder for ListIteratorGetNextResponder {
938 type ControlHandle = ListIteratorControlHandle;
939
940 fn control_handle(&self) -> &ListIteratorControlHandle {
941 &self.control_handle
942 }
943
944 fn drop_without_shutdown(mut self) {
945 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
947 std::mem::forget(self);
949 }
950}
951
952impl ListIteratorGetNextResponder {
953 pub fn send(self, mut keys: &[ListItem]) -> Result<(), fidl::Error> {
957 let _result = self.send_raw(keys);
958 if _result.is_err() {
959 self.control_handle.shutdown();
960 }
961 self.drop_without_shutdown();
962 _result
963 }
964
965 pub fn send_no_shutdown_on_err(self, mut keys: &[ListItem]) -> Result<(), fidl::Error> {
967 let _result = self.send_raw(keys);
968 self.drop_without_shutdown();
969 _result
970 }
971
972 fn send_raw(&self, mut keys: &[ListItem]) -> Result<(), fidl::Error> {
973 self.control_handle.inner.send::<ListIteratorGetNextResponse>(
974 (keys,),
975 self.tx_id,
976 0x6d8646b717dd56a2,
977 fidl::encoding::DynamicFlags::empty(),
978 )
979 }
980}
981
982#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
983pub struct SecureStoreMarker;
984
985impl fidl::endpoints::ProtocolMarker for SecureStoreMarker {
986 type Proxy = SecureStoreProxy;
987 type RequestStream = SecureStoreRequestStream;
988 #[cfg(target_os = "fuchsia")]
989 type SynchronousProxy = SecureStoreSynchronousProxy;
990
991 const DEBUG_NAME: &'static str = "fuchsia.stash.SecureStore";
992}
993impl fidl::endpoints::DiscoverableProtocolMarker for SecureStoreMarker {}
994
995pub trait SecureStoreProxyInterface: Send + Sync {
996 fn r#identify(&self, name: &str) -> Result<(), fidl::Error>;
997 fn r#create_accessor(
998 &self,
999 read_only: bool,
1000 accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1001 ) -> Result<(), fidl::Error>;
1002}
1003#[derive(Debug)]
1004#[cfg(target_os = "fuchsia")]
1005pub struct SecureStoreSynchronousProxy {
1006 client: fidl::client::sync::Client,
1007}
1008
1009#[cfg(target_os = "fuchsia")]
1010impl fidl::endpoints::SynchronousProxy for SecureStoreSynchronousProxy {
1011 type Proxy = SecureStoreProxy;
1012 type Protocol = SecureStoreMarker;
1013
1014 fn from_channel(inner: fidl::Channel) -> Self {
1015 Self::new(inner)
1016 }
1017
1018 fn into_channel(self) -> fidl::Channel {
1019 self.client.into_channel()
1020 }
1021
1022 fn as_channel(&self) -> &fidl::Channel {
1023 self.client.as_channel()
1024 }
1025}
1026
1027#[cfg(target_os = "fuchsia")]
1028impl SecureStoreSynchronousProxy {
1029 pub fn new(channel: fidl::Channel) -> Self {
1030 let protocol_name = <SecureStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1031 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1032 }
1033
1034 pub fn into_channel(self) -> fidl::Channel {
1035 self.client.into_channel()
1036 }
1037
1038 pub fn wait_for_event(
1041 &self,
1042 deadline: zx::MonotonicInstant,
1043 ) -> Result<SecureStoreEvent, fidl::Error> {
1044 SecureStoreEvent::decode(self.client.wait_for_event(deadline)?)
1045 }
1046
1047 pub fn r#identify(&self, mut name: &str) -> Result<(), fidl::Error> {
1052 self.client.send::<StoreIdentifyRequest>(
1053 (name,),
1054 0x4327d0764bed131b,
1055 fidl::encoding::DynamicFlags::empty(),
1056 )
1057 }
1058
1059 pub fn r#create_accessor(
1062 &self,
1063 mut read_only: bool,
1064 mut accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1065 ) -> Result<(), fidl::Error> {
1066 self.client.send::<StoreCreateAccessorRequest>(
1067 (read_only, accessor_request),
1068 0x5aaed3604b3bcfbb,
1069 fidl::encoding::DynamicFlags::empty(),
1070 )
1071 }
1072}
1073
1074#[cfg(target_os = "fuchsia")]
1075impl From<SecureStoreSynchronousProxy> for zx::Handle {
1076 fn from(value: SecureStoreSynchronousProxy) -> Self {
1077 value.into_channel().into()
1078 }
1079}
1080
1081#[cfg(target_os = "fuchsia")]
1082impl From<fidl::Channel> for SecureStoreSynchronousProxy {
1083 fn from(value: fidl::Channel) -> Self {
1084 Self::new(value)
1085 }
1086}
1087
1088#[derive(Debug, Clone)]
1089pub struct SecureStoreProxy {
1090 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1091}
1092
1093impl fidl::endpoints::Proxy for SecureStoreProxy {
1094 type Protocol = SecureStoreMarker;
1095
1096 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1097 Self::new(inner)
1098 }
1099
1100 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1101 self.client.into_channel().map_err(|client| Self { client })
1102 }
1103
1104 fn as_channel(&self) -> &::fidl::AsyncChannel {
1105 self.client.as_channel()
1106 }
1107}
1108
1109impl SecureStoreProxy {
1110 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1112 let protocol_name = <SecureStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1113 Self { client: fidl::client::Client::new(channel, protocol_name) }
1114 }
1115
1116 pub fn take_event_stream(&self) -> SecureStoreEventStream {
1122 SecureStoreEventStream { event_receiver: self.client.take_event_receiver() }
1123 }
1124
1125 pub fn r#identify(&self, mut name: &str) -> Result<(), fidl::Error> {
1130 SecureStoreProxyInterface::r#identify(self, name)
1131 }
1132
1133 pub fn r#create_accessor(
1136 &self,
1137 mut read_only: bool,
1138 mut accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1139 ) -> Result<(), fidl::Error> {
1140 SecureStoreProxyInterface::r#create_accessor(self, read_only, accessor_request)
1141 }
1142}
1143
1144impl SecureStoreProxyInterface for SecureStoreProxy {
1145 fn r#identify(&self, mut name: &str) -> Result<(), fidl::Error> {
1146 self.client.send::<StoreIdentifyRequest>(
1147 (name,),
1148 0x4327d0764bed131b,
1149 fidl::encoding::DynamicFlags::empty(),
1150 )
1151 }
1152
1153 fn r#create_accessor(
1154 &self,
1155 mut read_only: bool,
1156 mut accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1157 ) -> Result<(), fidl::Error> {
1158 self.client.send::<StoreCreateAccessorRequest>(
1159 (read_only, accessor_request),
1160 0x5aaed3604b3bcfbb,
1161 fidl::encoding::DynamicFlags::empty(),
1162 )
1163 }
1164}
1165
1166pub struct SecureStoreEventStream {
1167 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1168}
1169
1170impl std::marker::Unpin for SecureStoreEventStream {}
1171
1172impl futures::stream::FusedStream for SecureStoreEventStream {
1173 fn is_terminated(&self) -> bool {
1174 self.event_receiver.is_terminated()
1175 }
1176}
1177
1178impl futures::Stream for SecureStoreEventStream {
1179 type Item = Result<SecureStoreEvent, fidl::Error>;
1180
1181 fn poll_next(
1182 mut self: std::pin::Pin<&mut Self>,
1183 cx: &mut std::task::Context<'_>,
1184 ) -> std::task::Poll<Option<Self::Item>> {
1185 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1186 &mut self.event_receiver,
1187 cx
1188 )?) {
1189 Some(buf) => std::task::Poll::Ready(Some(SecureStoreEvent::decode(buf))),
1190 None => std::task::Poll::Ready(None),
1191 }
1192 }
1193}
1194
1195#[derive(Debug)]
1196pub enum SecureStoreEvent {}
1197
1198impl SecureStoreEvent {
1199 fn decode(
1201 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1202 ) -> Result<SecureStoreEvent, fidl::Error> {
1203 let (bytes, _handles) = buf.split_mut();
1204 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1205 debug_assert_eq!(tx_header.tx_id, 0);
1206 match tx_header.ordinal {
1207 _ => Err(fidl::Error::UnknownOrdinal {
1208 ordinal: tx_header.ordinal,
1209 protocol_name: <SecureStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1210 }),
1211 }
1212 }
1213}
1214
1215pub struct SecureStoreRequestStream {
1217 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1218 is_terminated: bool,
1219}
1220
1221impl std::marker::Unpin for SecureStoreRequestStream {}
1222
1223impl futures::stream::FusedStream for SecureStoreRequestStream {
1224 fn is_terminated(&self) -> bool {
1225 self.is_terminated
1226 }
1227}
1228
1229impl fidl::endpoints::RequestStream for SecureStoreRequestStream {
1230 type Protocol = SecureStoreMarker;
1231 type ControlHandle = SecureStoreControlHandle;
1232
1233 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1234 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1235 }
1236
1237 fn control_handle(&self) -> Self::ControlHandle {
1238 SecureStoreControlHandle { inner: self.inner.clone() }
1239 }
1240
1241 fn into_inner(
1242 self,
1243 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1244 {
1245 (self.inner, self.is_terminated)
1246 }
1247
1248 fn from_inner(
1249 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1250 is_terminated: bool,
1251 ) -> Self {
1252 Self { inner, is_terminated }
1253 }
1254}
1255
1256impl futures::Stream for SecureStoreRequestStream {
1257 type Item = Result<SecureStoreRequest, fidl::Error>;
1258
1259 fn poll_next(
1260 mut self: std::pin::Pin<&mut Self>,
1261 cx: &mut std::task::Context<'_>,
1262 ) -> std::task::Poll<Option<Self::Item>> {
1263 let this = &mut *self;
1264 if this.inner.check_shutdown(cx) {
1265 this.is_terminated = true;
1266 return std::task::Poll::Ready(None);
1267 }
1268 if this.is_terminated {
1269 panic!("polled SecureStoreRequestStream after completion");
1270 }
1271 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1272 |bytes, handles| {
1273 match this.inner.channel().read_etc(cx, bytes, handles) {
1274 std::task::Poll::Ready(Ok(())) => {}
1275 std::task::Poll::Pending => return std::task::Poll::Pending,
1276 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1277 this.is_terminated = true;
1278 return std::task::Poll::Ready(None);
1279 }
1280 std::task::Poll::Ready(Err(e)) => {
1281 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1282 e.into(),
1283 ))))
1284 }
1285 }
1286
1287 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1289
1290 std::task::Poll::Ready(Some(match header.ordinal {
1291 0x4327d0764bed131b => {
1292 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1293 let mut req = fidl::new_empty!(
1294 StoreIdentifyRequest,
1295 fidl::encoding::DefaultFuchsiaResourceDialect
1296 );
1297 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreIdentifyRequest>(&header, _body_bytes, handles, &mut req)?;
1298 let control_handle = SecureStoreControlHandle { inner: this.inner.clone() };
1299 Ok(SecureStoreRequest::Identify { name: req.name, control_handle })
1300 }
1301 0x5aaed3604b3bcfbb => {
1302 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1303 let mut req = fidl::new_empty!(
1304 StoreCreateAccessorRequest,
1305 fidl::encoding::DefaultFuchsiaResourceDialect
1306 );
1307 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreCreateAccessorRequest>(&header, _body_bytes, handles, &mut req)?;
1308 let control_handle = SecureStoreControlHandle { inner: this.inner.clone() };
1309 Ok(SecureStoreRequest::CreateAccessor {
1310 read_only: req.read_only,
1311 accessor_request: req.accessor_request,
1312
1313 control_handle,
1314 })
1315 }
1316 _ => Err(fidl::Error::UnknownOrdinal {
1317 ordinal: header.ordinal,
1318 protocol_name:
1319 <SecureStoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1320 }),
1321 }))
1322 },
1323 )
1324 }
1325}
1326
1327#[derive(Debug)]
1330pub enum SecureStoreRequest {
1331 Identify { name: String, control_handle: SecureStoreControlHandle },
1336 CreateAccessor {
1339 read_only: bool,
1340 accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1341 control_handle: SecureStoreControlHandle,
1342 },
1343}
1344
1345impl SecureStoreRequest {
1346 #[allow(irrefutable_let_patterns)]
1347 pub fn into_identify(self) -> Option<(String, SecureStoreControlHandle)> {
1348 if let SecureStoreRequest::Identify { name, control_handle } = self {
1349 Some((name, control_handle))
1350 } else {
1351 None
1352 }
1353 }
1354
1355 #[allow(irrefutable_let_patterns)]
1356 pub fn into_create_accessor(
1357 self,
1358 ) -> Option<(bool, fidl::endpoints::ServerEnd<StoreAccessorMarker>, SecureStoreControlHandle)>
1359 {
1360 if let SecureStoreRequest::CreateAccessor { read_only, accessor_request, control_handle } =
1361 self
1362 {
1363 Some((read_only, accessor_request, control_handle))
1364 } else {
1365 None
1366 }
1367 }
1368
1369 pub fn method_name(&self) -> &'static str {
1371 match *self {
1372 SecureStoreRequest::Identify { .. } => "identify",
1373 SecureStoreRequest::CreateAccessor { .. } => "create_accessor",
1374 }
1375 }
1376}
1377
1378#[derive(Debug, Clone)]
1379pub struct SecureStoreControlHandle {
1380 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1381}
1382
1383impl fidl::endpoints::ControlHandle for SecureStoreControlHandle {
1384 fn shutdown(&self) {
1385 self.inner.shutdown()
1386 }
1387 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1388 self.inner.shutdown_with_epitaph(status)
1389 }
1390
1391 fn is_closed(&self) -> bool {
1392 self.inner.channel().is_closed()
1393 }
1394 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1395 self.inner.channel().on_closed()
1396 }
1397
1398 #[cfg(target_os = "fuchsia")]
1399 fn signal_peer(
1400 &self,
1401 clear_mask: zx::Signals,
1402 set_mask: zx::Signals,
1403 ) -> Result<(), zx_status::Status> {
1404 use fidl::Peered;
1405 self.inner.channel().signal_peer(clear_mask, set_mask)
1406 }
1407}
1408
1409impl SecureStoreControlHandle {}
1410
1411#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1412pub struct StoreMarker;
1413
1414impl fidl::endpoints::ProtocolMarker for StoreMarker {
1415 type Proxy = StoreProxy;
1416 type RequestStream = StoreRequestStream;
1417 #[cfg(target_os = "fuchsia")]
1418 type SynchronousProxy = StoreSynchronousProxy;
1419
1420 const DEBUG_NAME: &'static str = "fuchsia.stash.Store";
1421}
1422impl fidl::endpoints::DiscoverableProtocolMarker for StoreMarker {}
1423
1424pub trait StoreProxyInterface: Send + Sync {
1425 fn r#identify(&self, name: &str) -> Result<(), fidl::Error>;
1426 fn r#create_accessor(
1427 &self,
1428 read_only: bool,
1429 accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1430 ) -> Result<(), fidl::Error>;
1431}
1432#[derive(Debug)]
1433#[cfg(target_os = "fuchsia")]
1434pub struct StoreSynchronousProxy {
1435 client: fidl::client::sync::Client,
1436}
1437
1438#[cfg(target_os = "fuchsia")]
1439impl fidl::endpoints::SynchronousProxy for StoreSynchronousProxy {
1440 type Proxy = StoreProxy;
1441 type Protocol = StoreMarker;
1442
1443 fn from_channel(inner: fidl::Channel) -> Self {
1444 Self::new(inner)
1445 }
1446
1447 fn into_channel(self) -> fidl::Channel {
1448 self.client.into_channel()
1449 }
1450
1451 fn as_channel(&self) -> &fidl::Channel {
1452 self.client.as_channel()
1453 }
1454}
1455
1456#[cfg(target_os = "fuchsia")]
1457impl StoreSynchronousProxy {
1458 pub fn new(channel: fidl::Channel) -> Self {
1459 let protocol_name = <StoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1460 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1461 }
1462
1463 pub fn into_channel(self) -> fidl::Channel {
1464 self.client.into_channel()
1465 }
1466
1467 pub fn wait_for_event(
1470 &self,
1471 deadline: zx::MonotonicInstant,
1472 ) -> Result<StoreEvent, fidl::Error> {
1473 StoreEvent::decode(self.client.wait_for_event(deadline)?)
1474 }
1475
1476 pub fn r#identify(&self, mut name: &str) -> Result<(), fidl::Error> {
1481 self.client.send::<StoreIdentifyRequest>(
1482 (name,),
1483 0x4327d0764bed131b,
1484 fidl::encoding::DynamicFlags::empty(),
1485 )
1486 }
1487
1488 pub fn r#create_accessor(
1491 &self,
1492 mut read_only: bool,
1493 mut accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1494 ) -> Result<(), fidl::Error> {
1495 self.client.send::<StoreCreateAccessorRequest>(
1496 (read_only, accessor_request),
1497 0x5aaed3604b3bcfbb,
1498 fidl::encoding::DynamicFlags::empty(),
1499 )
1500 }
1501}
1502
1503#[cfg(target_os = "fuchsia")]
1504impl From<StoreSynchronousProxy> for zx::Handle {
1505 fn from(value: StoreSynchronousProxy) -> Self {
1506 value.into_channel().into()
1507 }
1508}
1509
1510#[cfg(target_os = "fuchsia")]
1511impl From<fidl::Channel> for StoreSynchronousProxy {
1512 fn from(value: fidl::Channel) -> Self {
1513 Self::new(value)
1514 }
1515}
1516
1517#[derive(Debug, Clone)]
1518pub struct StoreProxy {
1519 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1520}
1521
1522impl fidl::endpoints::Proxy for StoreProxy {
1523 type Protocol = StoreMarker;
1524
1525 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1526 Self::new(inner)
1527 }
1528
1529 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1530 self.client.into_channel().map_err(|client| Self { client })
1531 }
1532
1533 fn as_channel(&self) -> &::fidl::AsyncChannel {
1534 self.client.as_channel()
1535 }
1536}
1537
1538impl StoreProxy {
1539 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1541 let protocol_name = <StoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1542 Self { client: fidl::client::Client::new(channel, protocol_name) }
1543 }
1544
1545 pub fn take_event_stream(&self) -> StoreEventStream {
1551 StoreEventStream { event_receiver: self.client.take_event_receiver() }
1552 }
1553
1554 pub fn r#identify(&self, mut name: &str) -> Result<(), fidl::Error> {
1559 StoreProxyInterface::r#identify(self, name)
1560 }
1561
1562 pub fn r#create_accessor(
1565 &self,
1566 mut read_only: bool,
1567 mut accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1568 ) -> Result<(), fidl::Error> {
1569 StoreProxyInterface::r#create_accessor(self, read_only, accessor_request)
1570 }
1571}
1572
1573impl StoreProxyInterface for StoreProxy {
1574 fn r#identify(&self, mut name: &str) -> Result<(), fidl::Error> {
1575 self.client.send::<StoreIdentifyRequest>(
1576 (name,),
1577 0x4327d0764bed131b,
1578 fidl::encoding::DynamicFlags::empty(),
1579 )
1580 }
1581
1582 fn r#create_accessor(
1583 &self,
1584 mut read_only: bool,
1585 mut accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1586 ) -> Result<(), fidl::Error> {
1587 self.client.send::<StoreCreateAccessorRequest>(
1588 (read_only, accessor_request),
1589 0x5aaed3604b3bcfbb,
1590 fidl::encoding::DynamicFlags::empty(),
1591 )
1592 }
1593}
1594
1595pub struct StoreEventStream {
1596 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1597}
1598
1599impl std::marker::Unpin for StoreEventStream {}
1600
1601impl futures::stream::FusedStream for StoreEventStream {
1602 fn is_terminated(&self) -> bool {
1603 self.event_receiver.is_terminated()
1604 }
1605}
1606
1607impl futures::Stream for StoreEventStream {
1608 type Item = Result<StoreEvent, fidl::Error>;
1609
1610 fn poll_next(
1611 mut self: std::pin::Pin<&mut Self>,
1612 cx: &mut std::task::Context<'_>,
1613 ) -> std::task::Poll<Option<Self::Item>> {
1614 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1615 &mut self.event_receiver,
1616 cx
1617 )?) {
1618 Some(buf) => std::task::Poll::Ready(Some(StoreEvent::decode(buf))),
1619 None => std::task::Poll::Ready(None),
1620 }
1621 }
1622}
1623
1624#[derive(Debug)]
1625pub enum StoreEvent {}
1626
1627impl StoreEvent {
1628 fn decode(
1630 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1631 ) -> Result<StoreEvent, fidl::Error> {
1632 let (bytes, _handles) = buf.split_mut();
1633 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1634 debug_assert_eq!(tx_header.tx_id, 0);
1635 match tx_header.ordinal {
1636 _ => Err(fidl::Error::UnknownOrdinal {
1637 ordinal: tx_header.ordinal,
1638 protocol_name: <StoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1639 }),
1640 }
1641 }
1642}
1643
1644pub struct StoreRequestStream {
1646 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1647 is_terminated: bool,
1648}
1649
1650impl std::marker::Unpin for StoreRequestStream {}
1651
1652impl futures::stream::FusedStream for StoreRequestStream {
1653 fn is_terminated(&self) -> bool {
1654 self.is_terminated
1655 }
1656}
1657
1658impl fidl::endpoints::RequestStream for StoreRequestStream {
1659 type Protocol = StoreMarker;
1660 type ControlHandle = StoreControlHandle;
1661
1662 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1663 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1664 }
1665
1666 fn control_handle(&self) -> Self::ControlHandle {
1667 StoreControlHandle { inner: self.inner.clone() }
1668 }
1669
1670 fn into_inner(
1671 self,
1672 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1673 {
1674 (self.inner, self.is_terminated)
1675 }
1676
1677 fn from_inner(
1678 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1679 is_terminated: bool,
1680 ) -> Self {
1681 Self { inner, is_terminated }
1682 }
1683}
1684
1685impl futures::Stream for StoreRequestStream {
1686 type Item = Result<StoreRequest, fidl::Error>;
1687
1688 fn poll_next(
1689 mut self: std::pin::Pin<&mut Self>,
1690 cx: &mut std::task::Context<'_>,
1691 ) -> std::task::Poll<Option<Self::Item>> {
1692 let this = &mut *self;
1693 if this.inner.check_shutdown(cx) {
1694 this.is_terminated = true;
1695 return std::task::Poll::Ready(None);
1696 }
1697 if this.is_terminated {
1698 panic!("polled StoreRequestStream after completion");
1699 }
1700 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1701 |bytes, handles| {
1702 match this.inner.channel().read_etc(cx, bytes, handles) {
1703 std::task::Poll::Ready(Ok(())) => {}
1704 std::task::Poll::Pending => return std::task::Poll::Pending,
1705 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1706 this.is_terminated = true;
1707 return std::task::Poll::Ready(None);
1708 }
1709 std::task::Poll::Ready(Err(e)) => {
1710 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1711 e.into(),
1712 ))))
1713 }
1714 }
1715
1716 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1718
1719 std::task::Poll::Ready(Some(match header.ordinal {
1720 0x4327d0764bed131b => {
1721 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1722 let mut req = fidl::new_empty!(
1723 StoreIdentifyRequest,
1724 fidl::encoding::DefaultFuchsiaResourceDialect
1725 );
1726 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreIdentifyRequest>(&header, _body_bytes, handles, &mut req)?;
1727 let control_handle = StoreControlHandle { inner: this.inner.clone() };
1728 Ok(StoreRequest::Identify { name: req.name, control_handle })
1729 }
1730 0x5aaed3604b3bcfbb => {
1731 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
1732 let mut req = fidl::new_empty!(
1733 StoreCreateAccessorRequest,
1734 fidl::encoding::DefaultFuchsiaResourceDialect
1735 );
1736 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreCreateAccessorRequest>(&header, _body_bytes, handles, &mut req)?;
1737 let control_handle = StoreControlHandle { inner: this.inner.clone() };
1738 Ok(StoreRequest::CreateAccessor {
1739 read_only: req.read_only,
1740 accessor_request: req.accessor_request,
1741
1742 control_handle,
1743 })
1744 }
1745 _ => Err(fidl::Error::UnknownOrdinal {
1746 ordinal: header.ordinal,
1747 protocol_name: <StoreMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1748 }),
1749 }))
1750 },
1751 )
1752 }
1753}
1754
1755#[derive(Debug)]
1757pub enum StoreRequest {
1758 Identify { name: String, control_handle: StoreControlHandle },
1763 CreateAccessor {
1766 read_only: bool,
1767 accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1768 control_handle: StoreControlHandle,
1769 },
1770}
1771
1772impl StoreRequest {
1773 #[allow(irrefutable_let_patterns)]
1774 pub fn into_identify(self) -> Option<(String, StoreControlHandle)> {
1775 if let StoreRequest::Identify { name, control_handle } = self {
1776 Some((name, control_handle))
1777 } else {
1778 None
1779 }
1780 }
1781
1782 #[allow(irrefutable_let_patterns)]
1783 pub fn into_create_accessor(
1784 self,
1785 ) -> Option<(bool, fidl::endpoints::ServerEnd<StoreAccessorMarker>, StoreControlHandle)> {
1786 if let StoreRequest::CreateAccessor { read_only, accessor_request, control_handle } = self {
1787 Some((read_only, accessor_request, control_handle))
1788 } else {
1789 None
1790 }
1791 }
1792
1793 pub fn method_name(&self) -> &'static str {
1795 match *self {
1796 StoreRequest::Identify { .. } => "identify",
1797 StoreRequest::CreateAccessor { .. } => "create_accessor",
1798 }
1799 }
1800}
1801
1802#[derive(Debug, Clone)]
1803pub struct StoreControlHandle {
1804 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1805}
1806
1807impl fidl::endpoints::ControlHandle for StoreControlHandle {
1808 fn shutdown(&self) {
1809 self.inner.shutdown()
1810 }
1811 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1812 self.inner.shutdown_with_epitaph(status)
1813 }
1814
1815 fn is_closed(&self) -> bool {
1816 self.inner.channel().is_closed()
1817 }
1818 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1819 self.inner.channel().on_closed()
1820 }
1821
1822 #[cfg(target_os = "fuchsia")]
1823 fn signal_peer(
1824 &self,
1825 clear_mask: zx::Signals,
1826 set_mask: zx::Signals,
1827 ) -> Result<(), zx_status::Status> {
1828 use fidl::Peered;
1829 self.inner.channel().signal_peer(clear_mask, set_mask)
1830 }
1831}
1832
1833impl StoreControlHandle {}
1834
1835#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1836pub struct Store2Marker;
1837
1838impl fidl::endpoints::ProtocolMarker for Store2Marker {
1839 type Proxy = Store2Proxy;
1840 type RequestStream = Store2RequestStream;
1841 #[cfg(target_os = "fuchsia")]
1842 type SynchronousProxy = Store2SynchronousProxy;
1843
1844 const DEBUG_NAME: &'static str = "fuchsia.stash.Store2";
1845}
1846impl fidl::endpoints::DiscoverableProtocolMarker for Store2Marker {}
1847
1848pub trait Store2ProxyInterface: Send + Sync {
1849 fn r#identify(&self, name: &str) -> Result<(), fidl::Error>;
1850 fn r#create_accessor(
1851 &self,
1852 read_only: bool,
1853 accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1854 ) -> Result<(), fidl::Error>;
1855}
1856#[derive(Debug)]
1857#[cfg(target_os = "fuchsia")]
1858pub struct Store2SynchronousProxy {
1859 client: fidl::client::sync::Client,
1860}
1861
1862#[cfg(target_os = "fuchsia")]
1863impl fidl::endpoints::SynchronousProxy for Store2SynchronousProxy {
1864 type Proxy = Store2Proxy;
1865 type Protocol = Store2Marker;
1866
1867 fn from_channel(inner: fidl::Channel) -> Self {
1868 Self::new(inner)
1869 }
1870
1871 fn into_channel(self) -> fidl::Channel {
1872 self.client.into_channel()
1873 }
1874
1875 fn as_channel(&self) -> &fidl::Channel {
1876 self.client.as_channel()
1877 }
1878}
1879
1880#[cfg(target_os = "fuchsia")]
1881impl Store2SynchronousProxy {
1882 pub fn new(channel: fidl::Channel) -> Self {
1883 let protocol_name = <Store2Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1884 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1885 }
1886
1887 pub fn into_channel(self) -> fidl::Channel {
1888 self.client.into_channel()
1889 }
1890
1891 pub fn wait_for_event(
1894 &self,
1895 deadline: zx::MonotonicInstant,
1896 ) -> Result<Store2Event, fidl::Error> {
1897 Store2Event::decode(self.client.wait_for_event(deadline)?)
1898 }
1899
1900 pub fn r#identify(&self, mut name: &str) -> Result<(), fidl::Error> {
1905 self.client.send::<StoreIdentifyRequest>(
1906 (name,),
1907 0x4327d0764bed131b,
1908 fidl::encoding::DynamicFlags::empty(),
1909 )
1910 }
1911
1912 pub fn r#create_accessor(
1915 &self,
1916 mut read_only: bool,
1917 mut accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1918 ) -> Result<(), fidl::Error> {
1919 self.client.send::<StoreCreateAccessorRequest>(
1920 (read_only, accessor_request),
1921 0x5aaed3604b3bcfbb,
1922 fidl::encoding::DynamicFlags::empty(),
1923 )
1924 }
1925}
1926
1927#[cfg(target_os = "fuchsia")]
1928impl From<Store2SynchronousProxy> for zx::Handle {
1929 fn from(value: Store2SynchronousProxy) -> Self {
1930 value.into_channel().into()
1931 }
1932}
1933
1934#[cfg(target_os = "fuchsia")]
1935impl From<fidl::Channel> for Store2SynchronousProxy {
1936 fn from(value: fidl::Channel) -> Self {
1937 Self::new(value)
1938 }
1939}
1940
1941#[derive(Debug, Clone)]
1942pub struct Store2Proxy {
1943 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1944}
1945
1946impl fidl::endpoints::Proxy for Store2Proxy {
1947 type Protocol = Store2Marker;
1948
1949 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1950 Self::new(inner)
1951 }
1952
1953 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1954 self.client.into_channel().map_err(|client| Self { client })
1955 }
1956
1957 fn as_channel(&self) -> &::fidl::AsyncChannel {
1958 self.client.as_channel()
1959 }
1960}
1961
1962impl Store2Proxy {
1963 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1965 let protocol_name = <Store2Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1966 Self { client: fidl::client::Client::new(channel, protocol_name) }
1967 }
1968
1969 pub fn take_event_stream(&self) -> Store2EventStream {
1975 Store2EventStream { event_receiver: self.client.take_event_receiver() }
1976 }
1977
1978 pub fn r#identify(&self, mut name: &str) -> Result<(), fidl::Error> {
1983 Store2ProxyInterface::r#identify(self, name)
1984 }
1985
1986 pub fn r#create_accessor(
1989 &self,
1990 mut read_only: bool,
1991 mut accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
1992 ) -> Result<(), fidl::Error> {
1993 Store2ProxyInterface::r#create_accessor(self, read_only, accessor_request)
1994 }
1995}
1996
1997impl Store2ProxyInterface for Store2Proxy {
1998 fn r#identify(&self, mut name: &str) -> Result<(), fidl::Error> {
1999 self.client.send::<StoreIdentifyRequest>(
2000 (name,),
2001 0x4327d0764bed131b,
2002 fidl::encoding::DynamicFlags::empty(),
2003 )
2004 }
2005
2006 fn r#create_accessor(
2007 &self,
2008 mut read_only: bool,
2009 mut accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
2010 ) -> Result<(), fidl::Error> {
2011 self.client.send::<StoreCreateAccessorRequest>(
2012 (read_only, accessor_request),
2013 0x5aaed3604b3bcfbb,
2014 fidl::encoding::DynamicFlags::empty(),
2015 )
2016 }
2017}
2018
2019pub struct Store2EventStream {
2020 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2021}
2022
2023impl std::marker::Unpin for Store2EventStream {}
2024
2025impl futures::stream::FusedStream for Store2EventStream {
2026 fn is_terminated(&self) -> bool {
2027 self.event_receiver.is_terminated()
2028 }
2029}
2030
2031impl futures::Stream for Store2EventStream {
2032 type Item = Result<Store2Event, fidl::Error>;
2033
2034 fn poll_next(
2035 mut self: std::pin::Pin<&mut Self>,
2036 cx: &mut std::task::Context<'_>,
2037 ) -> std::task::Poll<Option<Self::Item>> {
2038 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2039 &mut self.event_receiver,
2040 cx
2041 )?) {
2042 Some(buf) => std::task::Poll::Ready(Some(Store2Event::decode(buf))),
2043 None => std::task::Poll::Ready(None),
2044 }
2045 }
2046}
2047
2048#[derive(Debug)]
2049pub enum Store2Event {}
2050
2051impl Store2Event {
2052 fn decode(
2054 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2055 ) -> Result<Store2Event, fidl::Error> {
2056 let (bytes, _handles) = buf.split_mut();
2057 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2058 debug_assert_eq!(tx_header.tx_id, 0);
2059 match tx_header.ordinal {
2060 _ => Err(fidl::Error::UnknownOrdinal {
2061 ordinal: tx_header.ordinal,
2062 protocol_name: <Store2Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2063 }),
2064 }
2065 }
2066}
2067
2068pub struct Store2RequestStream {
2070 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2071 is_terminated: bool,
2072}
2073
2074impl std::marker::Unpin for Store2RequestStream {}
2075
2076impl futures::stream::FusedStream for Store2RequestStream {
2077 fn is_terminated(&self) -> bool {
2078 self.is_terminated
2079 }
2080}
2081
2082impl fidl::endpoints::RequestStream for Store2RequestStream {
2083 type Protocol = Store2Marker;
2084 type ControlHandle = Store2ControlHandle;
2085
2086 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2087 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2088 }
2089
2090 fn control_handle(&self) -> Self::ControlHandle {
2091 Store2ControlHandle { inner: self.inner.clone() }
2092 }
2093
2094 fn into_inner(
2095 self,
2096 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2097 {
2098 (self.inner, self.is_terminated)
2099 }
2100
2101 fn from_inner(
2102 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2103 is_terminated: bool,
2104 ) -> Self {
2105 Self { inner, is_terminated }
2106 }
2107}
2108
2109impl futures::Stream for Store2RequestStream {
2110 type Item = Result<Store2Request, fidl::Error>;
2111
2112 fn poll_next(
2113 mut self: std::pin::Pin<&mut Self>,
2114 cx: &mut std::task::Context<'_>,
2115 ) -> std::task::Poll<Option<Self::Item>> {
2116 let this = &mut *self;
2117 if this.inner.check_shutdown(cx) {
2118 this.is_terminated = true;
2119 return std::task::Poll::Ready(None);
2120 }
2121 if this.is_terminated {
2122 panic!("polled Store2RequestStream after completion");
2123 }
2124 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2125 |bytes, handles| {
2126 match this.inner.channel().read_etc(cx, bytes, handles) {
2127 std::task::Poll::Ready(Ok(())) => {}
2128 std::task::Poll::Pending => return std::task::Poll::Pending,
2129 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2130 this.is_terminated = true;
2131 return std::task::Poll::Ready(None);
2132 }
2133 std::task::Poll::Ready(Err(e)) => {
2134 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2135 e.into(),
2136 ))))
2137 }
2138 }
2139
2140 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2142
2143 std::task::Poll::Ready(Some(match header.ordinal {
2144 0x4327d0764bed131b => {
2145 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2146 let mut req = fidl::new_empty!(
2147 StoreIdentifyRequest,
2148 fidl::encoding::DefaultFuchsiaResourceDialect
2149 );
2150 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreIdentifyRequest>(&header, _body_bytes, handles, &mut req)?;
2151 let control_handle = Store2ControlHandle { inner: this.inner.clone() };
2152 Ok(Store2Request::Identify { name: req.name, control_handle })
2153 }
2154 0x5aaed3604b3bcfbb => {
2155 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2156 let mut req = fidl::new_empty!(
2157 StoreCreateAccessorRequest,
2158 fidl::encoding::DefaultFuchsiaResourceDialect
2159 );
2160 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreCreateAccessorRequest>(&header, _body_bytes, handles, &mut req)?;
2161 let control_handle = Store2ControlHandle { inner: this.inner.clone() };
2162 Ok(Store2Request::CreateAccessor {
2163 read_only: req.read_only,
2164 accessor_request: req.accessor_request,
2165
2166 control_handle,
2167 })
2168 }
2169 _ => Err(fidl::Error::UnknownOrdinal {
2170 ordinal: header.ordinal,
2171 protocol_name:
2172 <Store2Marker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2173 }),
2174 }))
2175 },
2176 )
2177 }
2178}
2179
2180#[derive(Debug)]
2183pub enum Store2Request {
2184 Identify { name: String, control_handle: Store2ControlHandle },
2189 CreateAccessor {
2192 read_only: bool,
2193 accessor_request: fidl::endpoints::ServerEnd<StoreAccessorMarker>,
2194 control_handle: Store2ControlHandle,
2195 },
2196}
2197
2198impl Store2Request {
2199 #[allow(irrefutable_let_patterns)]
2200 pub fn into_identify(self) -> Option<(String, Store2ControlHandle)> {
2201 if let Store2Request::Identify { name, control_handle } = self {
2202 Some((name, control_handle))
2203 } else {
2204 None
2205 }
2206 }
2207
2208 #[allow(irrefutable_let_patterns)]
2209 pub fn into_create_accessor(
2210 self,
2211 ) -> Option<(bool, fidl::endpoints::ServerEnd<StoreAccessorMarker>, Store2ControlHandle)> {
2212 if let Store2Request::CreateAccessor { read_only, accessor_request, control_handle } = self
2213 {
2214 Some((read_only, accessor_request, control_handle))
2215 } else {
2216 None
2217 }
2218 }
2219
2220 pub fn method_name(&self) -> &'static str {
2222 match *self {
2223 Store2Request::Identify { .. } => "identify",
2224 Store2Request::CreateAccessor { .. } => "create_accessor",
2225 }
2226 }
2227}
2228
2229#[derive(Debug, Clone)]
2230pub struct Store2ControlHandle {
2231 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2232}
2233
2234impl fidl::endpoints::ControlHandle for Store2ControlHandle {
2235 fn shutdown(&self) {
2236 self.inner.shutdown()
2237 }
2238 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2239 self.inner.shutdown_with_epitaph(status)
2240 }
2241
2242 fn is_closed(&self) -> bool {
2243 self.inner.channel().is_closed()
2244 }
2245 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2246 self.inner.channel().on_closed()
2247 }
2248
2249 #[cfg(target_os = "fuchsia")]
2250 fn signal_peer(
2251 &self,
2252 clear_mask: zx::Signals,
2253 set_mask: zx::Signals,
2254 ) -> Result<(), zx_status::Status> {
2255 use fidl::Peered;
2256 self.inner.channel().signal_peer(clear_mask, set_mask)
2257 }
2258}
2259
2260impl Store2ControlHandle {}
2261
2262#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2263pub struct StoreAccessorMarker;
2264
2265impl fidl::endpoints::ProtocolMarker for StoreAccessorMarker {
2266 type Proxy = StoreAccessorProxy;
2267 type RequestStream = StoreAccessorRequestStream;
2268 #[cfg(target_os = "fuchsia")]
2269 type SynchronousProxy = StoreAccessorSynchronousProxy;
2270
2271 const DEBUG_NAME: &'static str = "(anonymous) StoreAccessor";
2272}
2273pub type StoreAccessorFlushResult = Result<(), FlushError>;
2274
2275pub trait StoreAccessorProxyInterface: Send + Sync {
2276 type GetValueResponseFut: std::future::Future<Output = Result<Option<Box<Value>>, fidl::Error>>
2277 + Send;
2278 fn r#get_value(&self, key: &str) -> Self::GetValueResponseFut;
2279 fn r#set_value(&self, key: &str, val: Value) -> Result<(), fidl::Error>;
2280 fn r#delete_value(&self, key: &str) -> Result<(), fidl::Error>;
2281 fn r#list_prefix(
2282 &self,
2283 prefix: &str,
2284 it: fidl::endpoints::ServerEnd<ListIteratorMarker>,
2285 ) -> Result<(), fidl::Error>;
2286 fn r#get_prefix(
2287 &self,
2288 prefix: &str,
2289 it: fidl::endpoints::ServerEnd<GetIteratorMarker>,
2290 ) -> Result<(), fidl::Error>;
2291 fn r#delete_prefix(&self, prefix: &str) -> Result<(), fidl::Error>;
2292 fn r#commit(&self) -> Result<(), fidl::Error>;
2293 type FlushResponseFut: std::future::Future<Output = Result<StoreAccessorFlushResult, fidl::Error>>
2294 + Send;
2295 fn r#flush(&self) -> Self::FlushResponseFut;
2296}
2297#[derive(Debug)]
2298#[cfg(target_os = "fuchsia")]
2299pub struct StoreAccessorSynchronousProxy {
2300 client: fidl::client::sync::Client,
2301}
2302
2303#[cfg(target_os = "fuchsia")]
2304impl fidl::endpoints::SynchronousProxy for StoreAccessorSynchronousProxy {
2305 type Proxy = StoreAccessorProxy;
2306 type Protocol = StoreAccessorMarker;
2307
2308 fn from_channel(inner: fidl::Channel) -> Self {
2309 Self::new(inner)
2310 }
2311
2312 fn into_channel(self) -> fidl::Channel {
2313 self.client.into_channel()
2314 }
2315
2316 fn as_channel(&self) -> &fidl::Channel {
2317 self.client.as_channel()
2318 }
2319}
2320
2321#[cfg(target_os = "fuchsia")]
2322impl StoreAccessorSynchronousProxy {
2323 pub fn new(channel: fidl::Channel) -> Self {
2324 let protocol_name = <StoreAccessorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2325 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2326 }
2327
2328 pub fn into_channel(self) -> fidl::Channel {
2329 self.client.into_channel()
2330 }
2331
2332 pub fn wait_for_event(
2335 &self,
2336 deadline: zx::MonotonicInstant,
2337 ) -> Result<StoreAccessorEvent, fidl::Error> {
2338 StoreAccessorEvent::decode(self.client.wait_for_event(deadline)?)
2339 }
2340
2341 pub fn r#get_value(
2343 &self,
2344 mut key: &str,
2345 ___deadline: zx::MonotonicInstant,
2346 ) -> Result<Option<Box<Value>>, fidl::Error> {
2347 let _response =
2348 self.client.send_query::<StoreAccessorGetValueRequest, StoreAccessorGetValueResponse>(
2349 (key,),
2350 0x757e8893d1347630,
2351 fidl::encoding::DynamicFlags::empty(),
2352 ___deadline,
2353 )?;
2354 Ok(_response.val)
2355 }
2356
2357 pub fn r#set_value(&self, mut key: &str, mut val: Value) -> Result<(), fidl::Error> {
2360 self.client.send::<StoreAccessorSetValueRequest>(
2361 (key, &mut val),
2362 0x58365315c2f38e1c,
2363 fidl::encoding::DynamicFlags::empty(),
2364 )
2365 }
2366
2367 pub fn r#delete_value(&self, mut key: &str) -> Result<(), fidl::Error> {
2370 self.client.send::<StoreAccessorDeleteValueRequest>(
2371 (key,),
2372 0x64e331813e30ec12,
2373 fidl::encoding::DynamicFlags::empty(),
2374 )
2375 }
2376
2377 pub fn r#list_prefix(
2379 &self,
2380 mut prefix: &str,
2381 mut it: fidl::endpoints::ServerEnd<ListIteratorMarker>,
2382 ) -> Result<(), fidl::Error> {
2383 self.client.send::<StoreAccessorListPrefixRequest>(
2384 (prefix, it),
2385 0x2e25291acf25331e,
2386 fidl::encoding::DynamicFlags::empty(),
2387 )
2388 }
2389
2390 pub fn r#get_prefix(
2392 &self,
2393 mut prefix: &str,
2394 mut it: fidl::endpoints::ServerEnd<GetIteratorMarker>,
2395 ) -> Result<(), fidl::Error> {
2396 self.client.send::<StoreAccessorGetPrefixRequest>(
2397 (prefix, it),
2398 0x753ca25534a85c38,
2399 fidl::encoding::DynamicFlags::empty(),
2400 )
2401 }
2402
2403 pub fn r#delete_prefix(&self, mut prefix: &str) -> Result<(), fidl::Error> {
2405 self.client.send::<StoreAccessorDeletePrefixRequest>(
2406 (prefix,),
2407 0x468405bac20649c9,
2408 fidl::encoding::DynamicFlags::empty(),
2409 )
2410 }
2411
2412 pub fn r#commit(&self) -> Result<(), fidl::Error> {
2415 self.client.send::<fidl::encoding::EmptyPayload>(
2416 (),
2417 0x6daf402bf765768c,
2418 fidl::encoding::DynamicFlags::empty(),
2419 )
2420 }
2421
2422 pub fn r#flush(
2428 &self,
2429 ___deadline: zx::MonotonicInstant,
2430 ) -> Result<StoreAccessorFlushResult, fidl::Error> {
2431 let _response = self.client.send_query::<
2432 fidl::encoding::EmptyPayload,
2433 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FlushError>,
2434 >(
2435 (),
2436 0x463d057712847d12,
2437 fidl::encoding::DynamicFlags::empty(),
2438 ___deadline,
2439 )?;
2440 Ok(_response.map(|x| x))
2441 }
2442}
2443
2444#[cfg(target_os = "fuchsia")]
2445impl From<StoreAccessorSynchronousProxy> for zx::Handle {
2446 fn from(value: StoreAccessorSynchronousProxy) -> Self {
2447 value.into_channel().into()
2448 }
2449}
2450
2451#[cfg(target_os = "fuchsia")]
2452impl From<fidl::Channel> for StoreAccessorSynchronousProxy {
2453 fn from(value: fidl::Channel) -> Self {
2454 Self::new(value)
2455 }
2456}
2457
2458#[derive(Debug, Clone)]
2459pub struct StoreAccessorProxy {
2460 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2461}
2462
2463impl fidl::endpoints::Proxy for StoreAccessorProxy {
2464 type Protocol = StoreAccessorMarker;
2465
2466 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2467 Self::new(inner)
2468 }
2469
2470 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2471 self.client.into_channel().map_err(|client| Self { client })
2472 }
2473
2474 fn as_channel(&self) -> &::fidl::AsyncChannel {
2475 self.client.as_channel()
2476 }
2477}
2478
2479impl StoreAccessorProxy {
2480 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2482 let protocol_name = <StoreAccessorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2483 Self { client: fidl::client::Client::new(channel, protocol_name) }
2484 }
2485
2486 pub fn take_event_stream(&self) -> StoreAccessorEventStream {
2492 StoreAccessorEventStream { event_receiver: self.client.take_event_receiver() }
2493 }
2494
2495 pub fn r#get_value(
2497 &self,
2498 mut key: &str,
2499 ) -> fidl::client::QueryResponseFut<
2500 Option<Box<Value>>,
2501 fidl::encoding::DefaultFuchsiaResourceDialect,
2502 > {
2503 StoreAccessorProxyInterface::r#get_value(self, key)
2504 }
2505
2506 pub fn r#set_value(&self, mut key: &str, mut val: Value) -> Result<(), fidl::Error> {
2509 StoreAccessorProxyInterface::r#set_value(self, key, val)
2510 }
2511
2512 pub fn r#delete_value(&self, mut key: &str) -> Result<(), fidl::Error> {
2515 StoreAccessorProxyInterface::r#delete_value(self, key)
2516 }
2517
2518 pub fn r#list_prefix(
2520 &self,
2521 mut prefix: &str,
2522 mut it: fidl::endpoints::ServerEnd<ListIteratorMarker>,
2523 ) -> Result<(), fidl::Error> {
2524 StoreAccessorProxyInterface::r#list_prefix(self, prefix, it)
2525 }
2526
2527 pub fn r#get_prefix(
2529 &self,
2530 mut prefix: &str,
2531 mut it: fidl::endpoints::ServerEnd<GetIteratorMarker>,
2532 ) -> Result<(), fidl::Error> {
2533 StoreAccessorProxyInterface::r#get_prefix(self, prefix, it)
2534 }
2535
2536 pub fn r#delete_prefix(&self, mut prefix: &str) -> Result<(), fidl::Error> {
2538 StoreAccessorProxyInterface::r#delete_prefix(self, prefix)
2539 }
2540
2541 pub fn r#commit(&self) -> Result<(), fidl::Error> {
2544 StoreAccessorProxyInterface::r#commit(self)
2545 }
2546
2547 pub fn r#flush(
2553 &self,
2554 ) -> fidl::client::QueryResponseFut<
2555 StoreAccessorFlushResult,
2556 fidl::encoding::DefaultFuchsiaResourceDialect,
2557 > {
2558 StoreAccessorProxyInterface::r#flush(self)
2559 }
2560}
2561
2562impl StoreAccessorProxyInterface for StoreAccessorProxy {
2563 type GetValueResponseFut = fidl::client::QueryResponseFut<
2564 Option<Box<Value>>,
2565 fidl::encoding::DefaultFuchsiaResourceDialect,
2566 >;
2567 fn r#get_value(&self, mut key: &str) -> Self::GetValueResponseFut {
2568 fn _decode(
2569 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2570 ) -> Result<Option<Box<Value>>, fidl::Error> {
2571 let _response = fidl::client::decode_transaction_body::<
2572 StoreAccessorGetValueResponse,
2573 fidl::encoding::DefaultFuchsiaResourceDialect,
2574 0x757e8893d1347630,
2575 >(_buf?)?;
2576 Ok(_response.val)
2577 }
2578 self.client.send_query_and_decode::<StoreAccessorGetValueRequest, Option<Box<Value>>>(
2579 (key,),
2580 0x757e8893d1347630,
2581 fidl::encoding::DynamicFlags::empty(),
2582 _decode,
2583 )
2584 }
2585
2586 fn r#set_value(&self, mut key: &str, mut val: Value) -> Result<(), fidl::Error> {
2587 self.client.send::<StoreAccessorSetValueRequest>(
2588 (key, &mut val),
2589 0x58365315c2f38e1c,
2590 fidl::encoding::DynamicFlags::empty(),
2591 )
2592 }
2593
2594 fn r#delete_value(&self, mut key: &str) -> Result<(), fidl::Error> {
2595 self.client.send::<StoreAccessorDeleteValueRequest>(
2596 (key,),
2597 0x64e331813e30ec12,
2598 fidl::encoding::DynamicFlags::empty(),
2599 )
2600 }
2601
2602 fn r#list_prefix(
2603 &self,
2604 mut prefix: &str,
2605 mut it: fidl::endpoints::ServerEnd<ListIteratorMarker>,
2606 ) -> Result<(), fidl::Error> {
2607 self.client.send::<StoreAccessorListPrefixRequest>(
2608 (prefix, it),
2609 0x2e25291acf25331e,
2610 fidl::encoding::DynamicFlags::empty(),
2611 )
2612 }
2613
2614 fn r#get_prefix(
2615 &self,
2616 mut prefix: &str,
2617 mut it: fidl::endpoints::ServerEnd<GetIteratorMarker>,
2618 ) -> Result<(), fidl::Error> {
2619 self.client.send::<StoreAccessorGetPrefixRequest>(
2620 (prefix, it),
2621 0x753ca25534a85c38,
2622 fidl::encoding::DynamicFlags::empty(),
2623 )
2624 }
2625
2626 fn r#delete_prefix(&self, mut prefix: &str) -> Result<(), fidl::Error> {
2627 self.client.send::<StoreAccessorDeletePrefixRequest>(
2628 (prefix,),
2629 0x468405bac20649c9,
2630 fidl::encoding::DynamicFlags::empty(),
2631 )
2632 }
2633
2634 fn r#commit(&self) -> Result<(), fidl::Error> {
2635 self.client.send::<fidl::encoding::EmptyPayload>(
2636 (),
2637 0x6daf402bf765768c,
2638 fidl::encoding::DynamicFlags::empty(),
2639 )
2640 }
2641
2642 type FlushResponseFut = fidl::client::QueryResponseFut<
2643 StoreAccessorFlushResult,
2644 fidl::encoding::DefaultFuchsiaResourceDialect,
2645 >;
2646 fn r#flush(&self) -> Self::FlushResponseFut {
2647 fn _decode(
2648 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2649 ) -> Result<StoreAccessorFlushResult, fidl::Error> {
2650 let _response = fidl::client::decode_transaction_body::<
2651 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FlushError>,
2652 fidl::encoding::DefaultFuchsiaResourceDialect,
2653 0x463d057712847d12,
2654 >(_buf?)?;
2655 Ok(_response.map(|x| x))
2656 }
2657 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, StoreAccessorFlushResult>(
2658 (),
2659 0x463d057712847d12,
2660 fidl::encoding::DynamicFlags::empty(),
2661 _decode,
2662 )
2663 }
2664}
2665
2666pub struct StoreAccessorEventStream {
2667 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2668}
2669
2670impl std::marker::Unpin for StoreAccessorEventStream {}
2671
2672impl futures::stream::FusedStream for StoreAccessorEventStream {
2673 fn is_terminated(&self) -> bool {
2674 self.event_receiver.is_terminated()
2675 }
2676}
2677
2678impl futures::Stream for StoreAccessorEventStream {
2679 type Item = Result<StoreAccessorEvent, fidl::Error>;
2680
2681 fn poll_next(
2682 mut self: std::pin::Pin<&mut Self>,
2683 cx: &mut std::task::Context<'_>,
2684 ) -> std::task::Poll<Option<Self::Item>> {
2685 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2686 &mut self.event_receiver,
2687 cx
2688 )?) {
2689 Some(buf) => std::task::Poll::Ready(Some(StoreAccessorEvent::decode(buf))),
2690 None => std::task::Poll::Ready(None),
2691 }
2692 }
2693}
2694
2695#[derive(Debug)]
2696pub enum StoreAccessorEvent {}
2697
2698impl StoreAccessorEvent {
2699 fn decode(
2701 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2702 ) -> Result<StoreAccessorEvent, fidl::Error> {
2703 let (bytes, _handles) = buf.split_mut();
2704 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2705 debug_assert_eq!(tx_header.tx_id, 0);
2706 match tx_header.ordinal {
2707 _ => Err(fidl::Error::UnknownOrdinal {
2708 ordinal: tx_header.ordinal,
2709 protocol_name: <StoreAccessorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2710 }),
2711 }
2712 }
2713}
2714
2715pub struct StoreAccessorRequestStream {
2717 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2718 is_terminated: bool,
2719}
2720
2721impl std::marker::Unpin for StoreAccessorRequestStream {}
2722
2723impl futures::stream::FusedStream for StoreAccessorRequestStream {
2724 fn is_terminated(&self) -> bool {
2725 self.is_terminated
2726 }
2727}
2728
2729impl fidl::endpoints::RequestStream for StoreAccessorRequestStream {
2730 type Protocol = StoreAccessorMarker;
2731 type ControlHandle = StoreAccessorControlHandle;
2732
2733 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2734 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2735 }
2736
2737 fn control_handle(&self) -> Self::ControlHandle {
2738 StoreAccessorControlHandle { inner: self.inner.clone() }
2739 }
2740
2741 fn into_inner(
2742 self,
2743 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2744 {
2745 (self.inner, self.is_terminated)
2746 }
2747
2748 fn from_inner(
2749 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2750 is_terminated: bool,
2751 ) -> Self {
2752 Self { inner, is_terminated }
2753 }
2754}
2755
2756impl futures::Stream for StoreAccessorRequestStream {
2757 type Item = Result<StoreAccessorRequest, fidl::Error>;
2758
2759 fn poll_next(
2760 mut self: std::pin::Pin<&mut Self>,
2761 cx: &mut std::task::Context<'_>,
2762 ) -> std::task::Poll<Option<Self::Item>> {
2763 let this = &mut *self;
2764 if this.inner.check_shutdown(cx) {
2765 this.is_terminated = true;
2766 return std::task::Poll::Ready(None);
2767 }
2768 if this.is_terminated {
2769 panic!("polled StoreAccessorRequestStream after completion");
2770 }
2771 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2772 |bytes, handles| {
2773 match this.inner.channel().read_etc(cx, bytes, handles) {
2774 std::task::Poll::Ready(Ok(())) => {}
2775 std::task::Poll::Pending => return std::task::Poll::Pending,
2776 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2777 this.is_terminated = true;
2778 return std::task::Poll::Ready(None);
2779 }
2780 std::task::Poll::Ready(Err(e)) => {
2781 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2782 e.into(),
2783 ))))
2784 }
2785 }
2786
2787 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2789
2790 std::task::Poll::Ready(Some(match header.ordinal {
2791 0x757e8893d1347630 => {
2792 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2793 let mut req = fidl::new_empty!(
2794 StoreAccessorGetValueRequest,
2795 fidl::encoding::DefaultFuchsiaResourceDialect
2796 );
2797 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreAccessorGetValueRequest>(&header, _body_bytes, handles, &mut req)?;
2798 let control_handle =
2799 StoreAccessorControlHandle { inner: this.inner.clone() };
2800 Ok(StoreAccessorRequest::GetValue {
2801 key: req.key,
2802
2803 responder: StoreAccessorGetValueResponder {
2804 control_handle: std::mem::ManuallyDrop::new(control_handle),
2805 tx_id: header.tx_id,
2806 },
2807 })
2808 }
2809 0x58365315c2f38e1c => {
2810 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2811 let mut req = fidl::new_empty!(
2812 StoreAccessorSetValueRequest,
2813 fidl::encoding::DefaultFuchsiaResourceDialect
2814 );
2815 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreAccessorSetValueRequest>(&header, _body_bytes, handles, &mut req)?;
2816 let control_handle =
2817 StoreAccessorControlHandle { inner: this.inner.clone() };
2818 Ok(StoreAccessorRequest::SetValue {
2819 key: req.key,
2820 val: req.val,
2821
2822 control_handle,
2823 })
2824 }
2825 0x64e331813e30ec12 => {
2826 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2827 let mut req = fidl::new_empty!(
2828 StoreAccessorDeleteValueRequest,
2829 fidl::encoding::DefaultFuchsiaResourceDialect
2830 );
2831 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreAccessorDeleteValueRequest>(&header, _body_bytes, handles, &mut req)?;
2832 let control_handle =
2833 StoreAccessorControlHandle { inner: this.inner.clone() };
2834 Ok(StoreAccessorRequest::DeleteValue { key: req.key, control_handle })
2835 }
2836 0x2e25291acf25331e => {
2837 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2838 let mut req = fidl::new_empty!(
2839 StoreAccessorListPrefixRequest,
2840 fidl::encoding::DefaultFuchsiaResourceDialect
2841 );
2842 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreAccessorListPrefixRequest>(&header, _body_bytes, handles, &mut req)?;
2843 let control_handle =
2844 StoreAccessorControlHandle { inner: this.inner.clone() };
2845 Ok(StoreAccessorRequest::ListPrefix {
2846 prefix: req.prefix,
2847 it: req.it,
2848
2849 control_handle,
2850 })
2851 }
2852 0x753ca25534a85c38 => {
2853 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2854 let mut req = fidl::new_empty!(
2855 StoreAccessorGetPrefixRequest,
2856 fidl::encoding::DefaultFuchsiaResourceDialect
2857 );
2858 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreAccessorGetPrefixRequest>(&header, _body_bytes, handles, &mut req)?;
2859 let control_handle =
2860 StoreAccessorControlHandle { inner: this.inner.clone() };
2861 Ok(StoreAccessorRequest::GetPrefix {
2862 prefix: req.prefix,
2863 it: req.it,
2864
2865 control_handle,
2866 })
2867 }
2868 0x468405bac20649c9 => {
2869 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2870 let mut req = fidl::new_empty!(
2871 StoreAccessorDeletePrefixRequest,
2872 fidl::encoding::DefaultFuchsiaResourceDialect
2873 );
2874 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StoreAccessorDeletePrefixRequest>(&header, _body_bytes, handles, &mut req)?;
2875 let control_handle =
2876 StoreAccessorControlHandle { inner: this.inner.clone() };
2877 Ok(StoreAccessorRequest::DeletePrefix {
2878 prefix: req.prefix,
2879
2880 control_handle,
2881 })
2882 }
2883 0x6daf402bf765768c => {
2884 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
2885 let mut req = fidl::new_empty!(
2886 fidl::encoding::EmptyPayload,
2887 fidl::encoding::DefaultFuchsiaResourceDialect
2888 );
2889 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2890 let control_handle =
2891 StoreAccessorControlHandle { inner: this.inner.clone() };
2892 Ok(StoreAccessorRequest::Commit { control_handle })
2893 }
2894 0x463d057712847d12 => {
2895 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2896 let mut req = fidl::new_empty!(
2897 fidl::encoding::EmptyPayload,
2898 fidl::encoding::DefaultFuchsiaResourceDialect
2899 );
2900 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2901 let control_handle =
2902 StoreAccessorControlHandle { inner: this.inner.clone() };
2903 Ok(StoreAccessorRequest::Flush {
2904 responder: StoreAccessorFlushResponder {
2905 control_handle: std::mem::ManuallyDrop::new(control_handle),
2906 tx_id: header.tx_id,
2907 },
2908 })
2909 }
2910 _ => Err(fidl::Error::UnknownOrdinal {
2911 ordinal: header.ordinal,
2912 protocol_name:
2913 <StoreAccessorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2914 }),
2915 }))
2916 },
2917 )
2918 }
2919}
2920
2921#[derive(Debug)]
2923pub enum StoreAccessorRequest {
2924 GetValue { key: String, responder: StoreAccessorGetValueResponder },
2926 SetValue { key: String, val: Value, control_handle: StoreAccessorControlHandle },
2929 DeleteValue { key: String, control_handle: StoreAccessorControlHandle },
2932 ListPrefix {
2934 prefix: String,
2935 it: fidl::endpoints::ServerEnd<ListIteratorMarker>,
2936 control_handle: StoreAccessorControlHandle,
2937 },
2938 GetPrefix {
2940 prefix: String,
2941 it: fidl::endpoints::ServerEnd<GetIteratorMarker>,
2942 control_handle: StoreAccessorControlHandle,
2943 },
2944 DeletePrefix { prefix: String, control_handle: StoreAccessorControlHandle },
2946 Commit { control_handle: StoreAccessorControlHandle },
2949 Flush { responder: StoreAccessorFlushResponder },
2955}
2956
2957impl StoreAccessorRequest {
2958 #[allow(irrefutable_let_patterns)]
2959 pub fn into_get_value(self) -> Option<(String, StoreAccessorGetValueResponder)> {
2960 if let StoreAccessorRequest::GetValue { key, responder } = self {
2961 Some((key, responder))
2962 } else {
2963 None
2964 }
2965 }
2966
2967 #[allow(irrefutable_let_patterns)]
2968 pub fn into_set_value(self) -> Option<(String, Value, StoreAccessorControlHandle)> {
2969 if let StoreAccessorRequest::SetValue { key, val, control_handle } = self {
2970 Some((key, val, control_handle))
2971 } else {
2972 None
2973 }
2974 }
2975
2976 #[allow(irrefutable_let_patterns)]
2977 pub fn into_delete_value(self) -> Option<(String, StoreAccessorControlHandle)> {
2978 if let StoreAccessorRequest::DeleteValue { key, control_handle } = self {
2979 Some((key, control_handle))
2980 } else {
2981 None
2982 }
2983 }
2984
2985 #[allow(irrefutable_let_patterns)]
2986 pub fn into_list_prefix(
2987 self,
2988 ) -> Option<(String, fidl::endpoints::ServerEnd<ListIteratorMarker>, StoreAccessorControlHandle)>
2989 {
2990 if let StoreAccessorRequest::ListPrefix { prefix, it, control_handle } = self {
2991 Some((prefix, it, control_handle))
2992 } else {
2993 None
2994 }
2995 }
2996
2997 #[allow(irrefutable_let_patterns)]
2998 pub fn into_get_prefix(
2999 self,
3000 ) -> Option<(String, fidl::endpoints::ServerEnd<GetIteratorMarker>, StoreAccessorControlHandle)>
3001 {
3002 if let StoreAccessorRequest::GetPrefix { prefix, it, control_handle } = self {
3003 Some((prefix, it, control_handle))
3004 } else {
3005 None
3006 }
3007 }
3008
3009 #[allow(irrefutable_let_patterns)]
3010 pub fn into_delete_prefix(self) -> Option<(String, StoreAccessorControlHandle)> {
3011 if let StoreAccessorRequest::DeletePrefix { prefix, control_handle } = self {
3012 Some((prefix, control_handle))
3013 } else {
3014 None
3015 }
3016 }
3017
3018 #[allow(irrefutable_let_patterns)]
3019 pub fn into_commit(self) -> Option<(StoreAccessorControlHandle)> {
3020 if let StoreAccessorRequest::Commit { control_handle } = self {
3021 Some((control_handle))
3022 } else {
3023 None
3024 }
3025 }
3026
3027 #[allow(irrefutable_let_patterns)]
3028 pub fn into_flush(self) -> Option<(StoreAccessorFlushResponder)> {
3029 if let StoreAccessorRequest::Flush { responder } = self {
3030 Some((responder))
3031 } else {
3032 None
3033 }
3034 }
3035
3036 pub fn method_name(&self) -> &'static str {
3038 match *self {
3039 StoreAccessorRequest::GetValue { .. } => "get_value",
3040 StoreAccessorRequest::SetValue { .. } => "set_value",
3041 StoreAccessorRequest::DeleteValue { .. } => "delete_value",
3042 StoreAccessorRequest::ListPrefix { .. } => "list_prefix",
3043 StoreAccessorRequest::GetPrefix { .. } => "get_prefix",
3044 StoreAccessorRequest::DeletePrefix { .. } => "delete_prefix",
3045 StoreAccessorRequest::Commit { .. } => "commit",
3046 StoreAccessorRequest::Flush { .. } => "flush",
3047 }
3048 }
3049}
3050
3051#[derive(Debug, Clone)]
3052pub struct StoreAccessorControlHandle {
3053 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3054}
3055
3056impl fidl::endpoints::ControlHandle for StoreAccessorControlHandle {
3057 fn shutdown(&self) {
3058 self.inner.shutdown()
3059 }
3060 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3061 self.inner.shutdown_with_epitaph(status)
3062 }
3063
3064 fn is_closed(&self) -> bool {
3065 self.inner.channel().is_closed()
3066 }
3067 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3068 self.inner.channel().on_closed()
3069 }
3070
3071 #[cfg(target_os = "fuchsia")]
3072 fn signal_peer(
3073 &self,
3074 clear_mask: zx::Signals,
3075 set_mask: zx::Signals,
3076 ) -> Result<(), zx_status::Status> {
3077 use fidl::Peered;
3078 self.inner.channel().signal_peer(clear_mask, set_mask)
3079 }
3080}
3081
3082impl StoreAccessorControlHandle {}
3083
3084#[must_use = "FIDL methods require a response to be sent"]
3085#[derive(Debug)]
3086pub struct StoreAccessorGetValueResponder {
3087 control_handle: std::mem::ManuallyDrop<StoreAccessorControlHandle>,
3088 tx_id: u32,
3089}
3090
3091impl std::ops::Drop for StoreAccessorGetValueResponder {
3095 fn drop(&mut self) {
3096 self.control_handle.shutdown();
3097 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3099 }
3100}
3101
3102impl fidl::endpoints::Responder for StoreAccessorGetValueResponder {
3103 type ControlHandle = StoreAccessorControlHandle;
3104
3105 fn control_handle(&self) -> &StoreAccessorControlHandle {
3106 &self.control_handle
3107 }
3108
3109 fn drop_without_shutdown(mut self) {
3110 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3112 std::mem::forget(self);
3114 }
3115}
3116
3117impl StoreAccessorGetValueResponder {
3118 pub fn send(self, mut val: Option<Value>) -> Result<(), fidl::Error> {
3122 let _result = self.send_raw(val);
3123 if _result.is_err() {
3124 self.control_handle.shutdown();
3125 }
3126 self.drop_without_shutdown();
3127 _result
3128 }
3129
3130 pub fn send_no_shutdown_on_err(self, mut val: Option<Value>) -> Result<(), fidl::Error> {
3132 let _result = self.send_raw(val);
3133 self.drop_without_shutdown();
3134 _result
3135 }
3136
3137 fn send_raw(&self, mut val: Option<Value>) -> Result<(), fidl::Error> {
3138 self.control_handle.inner.send::<StoreAccessorGetValueResponse>(
3139 (val.as_mut(),),
3140 self.tx_id,
3141 0x757e8893d1347630,
3142 fidl::encoding::DynamicFlags::empty(),
3143 )
3144 }
3145}
3146
3147#[must_use = "FIDL methods require a response to be sent"]
3148#[derive(Debug)]
3149pub struct StoreAccessorFlushResponder {
3150 control_handle: std::mem::ManuallyDrop<StoreAccessorControlHandle>,
3151 tx_id: u32,
3152}
3153
3154impl std::ops::Drop for StoreAccessorFlushResponder {
3158 fn drop(&mut self) {
3159 self.control_handle.shutdown();
3160 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3162 }
3163}
3164
3165impl fidl::endpoints::Responder for StoreAccessorFlushResponder {
3166 type ControlHandle = StoreAccessorControlHandle;
3167
3168 fn control_handle(&self) -> &StoreAccessorControlHandle {
3169 &self.control_handle
3170 }
3171
3172 fn drop_without_shutdown(mut self) {
3173 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3175 std::mem::forget(self);
3177 }
3178}
3179
3180impl StoreAccessorFlushResponder {
3181 pub fn send(self, mut result: Result<(), FlushError>) -> Result<(), fidl::Error> {
3185 let _result = self.send_raw(result);
3186 if _result.is_err() {
3187 self.control_handle.shutdown();
3188 }
3189 self.drop_without_shutdown();
3190 _result
3191 }
3192
3193 pub fn send_no_shutdown_on_err(
3195 self,
3196 mut result: Result<(), FlushError>,
3197 ) -> Result<(), fidl::Error> {
3198 let _result = self.send_raw(result);
3199 self.drop_without_shutdown();
3200 _result
3201 }
3202
3203 fn send_raw(&self, mut result: Result<(), FlushError>) -> Result<(), fidl::Error> {
3204 self.control_handle
3205 .inner
3206 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, FlushError>>(
3207 result,
3208 self.tx_id,
3209 0x463d057712847d12,
3210 fidl::encoding::DynamicFlags::empty(),
3211 )
3212 }
3213}
3214
3215mod internal {
3216 use super::*;
3217
3218 impl fidl::encoding::ResourceTypeMarker for GetIteratorGetNextResponse {
3219 type Borrowed<'a> = &'a mut Self;
3220 fn take_or_borrow<'a>(
3221 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3222 ) -> Self::Borrowed<'a> {
3223 value
3224 }
3225 }
3226
3227 unsafe impl fidl::encoding::TypeMarker for GetIteratorGetNextResponse {
3228 type Owned = Self;
3229
3230 #[inline(always)]
3231 fn inline_align(_context: fidl::encoding::Context) -> usize {
3232 8
3233 }
3234
3235 #[inline(always)]
3236 fn inline_size(_context: fidl::encoding::Context) -> usize {
3237 16
3238 }
3239 }
3240
3241 unsafe impl
3242 fidl::encoding::Encode<
3243 GetIteratorGetNextResponse,
3244 fidl::encoding::DefaultFuchsiaResourceDialect,
3245 > for &mut GetIteratorGetNextResponse
3246 {
3247 #[inline]
3248 unsafe fn encode(
3249 self,
3250 encoder: &mut fidl::encoding::Encoder<
3251 '_,
3252 fidl::encoding::DefaultFuchsiaResourceDialect,
3253 >,
3254 offset: usize,
3255 _depth: fidl::encoding::Depth,
3256 ) -> fidl::Result<()> {
3257 encoder.debug_check_bounds::<GetIteratorGetNextResponse>(offset);
3258 fidl::encoding::Encode::<GetIteratorGetNextResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3260 (
3261 <fidl::encoding::UnboundedVector<KeyValue> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.kvs),
3262 ),
3263 encoder, offset, _depth
3264 )
3265 }
3266 }
3267 unsafe impl<
3268 T0: fidl::encoding::Encode<
3269 fidl::encoding::UnboundedVector<KeyValue>,
3270 fidl::encoding::DefaultFuchsiaResourceDialect,
3271 >,
3272 >
3273 fidl::encoding::Encode<
3274 GetIteratorGetNextResponse,
3275 fidl::encoding::DefaultFuchsiaResourceDialect,
3276 > for (T0,)
3277 {
3278 #[inline]
3279 unsafe fn encode(
3280 self,
3281 encoder: &mut fidl::encoding::Encoder<
3282 '_,
3283 fidl::encoding::DefaultFuchsiaResourceDialect,
3284 >,
3285 offset: usize,
3286 depth: fidl::encoding::Depth,
3287 ) -> fidl::Result<()> {
3288 encoder.debug_check_bounds::<GetIteratorGetNextResponse>(offset);
3289 self.0.encode(encoder, offset + 0, depth)?;
3293 Ok(())
3294 }
3295 }
3296
3297 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3298 for GetIteratorGetNextResponse
3299 {
3300 #[inline(always)]
3301 fn new_empty() -> Self {
3302 Self {
3303 kvs: fidl::new_empty!(
3304 fidl::encoding::UnboundedVector<KeyValue>,
3305 fidl::encoding::DefaultFuchsiaResourceDialect
3306 ),
3307 }
3308 }
3309
3310 #[inline]
3311 unsafe fn decode(
3312 &mut self,
3313 decoder: &mut fidl::encoding::Decoder<
3314 '_,
3315 fidl::encoding::DefaultFuchsiaResourceDialect,
3316 >,
3317 offset: usize,
3318 _depth: fidl::encoding::Depth,
3319 ) -> fidl::Result<()> {
3320 decoder.debug_check_bounds::<Self>(offset);
3321 fidl::decode!(
3323 fidl::encoding::UnboundedVector<KeyValue>,
3324 fidl::encoding::DefaultFuchsiaResourceDialect,
3325 &mut self.kvs,
3326 decoder,
3327 offset + 0,
3328 _depth
3329 )?;
3330 Ok(())
3331 }
3332 }
3333
3334 impl fidl::encoding::ResourceTypeMarker for KeyValue {
3335 type Borrowed<'a> = &'a mut Self;
3336 fn take_or_borrow<'a>(
3337 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3338 ) -> Self::Borrowed<'a> {
3339 value
3340 }
3341 }
3342
3343 unsafe impl fidl::encoding::TypeMarker for KeyValue {
3344 type Owned = Self;
3345
3346 #[inline(always)]
3347 fn inline_align(_context: fidl::encoding::Context) -> usize {
3348 8
3349 }
3350
3351 #[inline(always)]
3352 fn inline_size(_context: fidl::encoding::Context) -> usize {
3353 32
3354 }
3355 }
3356
3357 unsafe impl fidl::encoding::Encode<KeyValue, fidl::encoding::DefaultFuchsiaResourceDialect>
3358 for &mut KeyValue
3359 {
3360 #[inline]
3361 unsafe fn encode(
3362 self,
3363 encoder: &mut fidl::encoding::Encoder<
3364 '_,
3365 fidl::encoding::DefaultFuchsiaResourceDialect,
3366 >,
3367 offset: usize,
3368 _depth: fidl::encoding::Depth,
3369 ) -> fidl::Result<()> {
3370 encoder.debug_check_bounds::<KeyValue>(offset);
3371 fidl::encoding::Encode::<KeyValue, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3373 (
3374 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
3375 <Value as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.val),
3376 ),
3377 encoder, offset, _depth
3378 )
3379 }
3380 }
3381 unsafe impl<
3382 T0: fidl::encoding::Encode<
3383 fidl::encoding::BoundedString<256>,
3384 fidl::encoding::DefaultFuchsiaResourceDialect,
3385 >,
3386 T1: fidl::encoding::Encode<Value, fidl::encoding::DefaultFuchsiaResourceDialect>,
3387 > fidl::encoding::Encode<KeyValue, fidl::encoding::DefaultFuchsiaResourceDialect>
3388 for (T0, T1)
3389 {
3390 #[inline]
3391 unsafe fn encode(
3392 self,
3393 encoder: &mut fidl::encoding::Encoder<
3394 '_,
3395 fidl::encoding::DefaultFuchsiaResourceDialect,
3396 >,
3397 offset: usize,
3398 depth: fidl::encoding::Depth,
3399 ) -> fidl::Result<()> {
3400 encoder.debug_check_bounds::<KeyValue>(offset);
3401 self.0.encode(encoder, offset + 0, depth)?;
3405 self.1.encode(encoder, offset + 16, depth)?;
3406 Ok(())
3407 }
3408 }
3409
3410 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for KeyValue {
3411 #[inline(always)]
3412 fn new_empty() -> Self {
3413 Self {
3414 key: fidl::new_empty!(
3415 fidl::encoding::BoundedString<256>,
3416 fidl::encoding::DefaultFuchsiaResourceDialect
3417 ),
3418 val: fidl::new_empty!(Value, fidl::encoding::DefaultFuchsiaResourceDialect),
3419 }
3420 }
3421
3422 #[inline]
3423 unsafe fn decode(
3424 &mut self,
3425 decoder: &mut fidl::encoding::Decoder<
3426 '_,
3427 fidl::encoding::DefaultFuchsiaResourceDialect,
3428 >,
3429 offset: usize,
3430 _depth: fidl::encoding::Depth,
3431 ) -> fidl::Result<()> {
3432 decoder.debug_check_bounds::<Self>(offset);
3433 fidl::decode!(
3435 fidl::encoding::BoundedString<256>,
3436 fidl::encoding::DefaultFuchsiaResourceDialect,
3437 &mut self.key,
3438 decoder,
3439 offset + 0,
3440 _depth
3441 )?;
3442 fidl::decode!(
3443 Value,
3444 fidl::encoding::DefaultFuchsiaResourceDialect,
3445 &mut self.val,
3446 decoder,
3447 offset + 16,
3448 _depth
3449 )?;
3450 Ok(())
3451 }
3452 }
3453
3454 impl fidl::encoding::ResourceTypeMarker for StoreAccessorGetPrefixRequest {
3455 type Borrowed<'a> = &'a mut Self;
3456 fn take_or_borrow<'a>(
3457 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3458 ) -> Self::Borrowed<'a> {
3459 value
3460 }
3461 }
3462
3463 unsafe impl fidl::encoding::TypeMarker for StoreAccessorGetPrefixRequest {
3464 type Owned = Self;
3465
3466 #[inline(always)]
3467 fn inline_align(_context: fidl::encoding::Context) -> usize {
3468 8
3469 }
3470
3471 #[inline(always)]
3472 fn inline_size(_context: fidl::encoding::Context) -> usize {
3473 24
3474 }
3475 }
3476
3477 unsafe impl
3478 fidl::encoding::Encode<
3479 StoreAccessorGetPrefixRequest,
3480 fidl::encoding::DefaultFuchsiaResourceDialect,
3481 > for &mut StoreAccessorGetPrefixRequest
3482 {
3483 #[inline]
3484 unsafe fn encode(
3485 self,
3486 encoder: &mut fidl::encoding::Encoder<
3487 '_,
3488 fidl::encoding::DefaultFuchsiaResourceDialect,
3489 >,
3490 offset: usize,
3491 _depth: fidl::encoding::Depth,
3492 ) -> fidl::Result<()> {
3493 encoder.debug_check_bounds::<StoreAccessorGetPrefixRequest>(offset);
3494 fidl::encoding::Encode::<StoreAccessorGetPrefixRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3496 (
3497 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(&self.prefix),
3498 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GetIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.it),
3499 ),
3500 encoder, offset, _depth
3501 )
3502 }
3503 }
3504 unsafe impl<
3505 T0: fidl::encoding::Encode<
3506 fidl::encoding::BoundedString<256>,
3507 fidl::encoding::DefaultFuchsiaResourceDialect,
3508 >,
3509 T1: fidl::encoding::Encode<
3510 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GetIteratorMarker>>,
3511 fidl::encoding::DefaultFuchsiaResourceDialect,
3512 >,
3513 >
3514 fidl::encoding::Encode<
3515 StoreAccessorGetPrefixRequest,
3516 fidl::encoding::DefaultFuchsiaResourceDialect,
3517 > for (T0, T1)
3518 {
3519 #[inline]
3520 unsafe fn encode(
3521 self,
3522 encoder: &mut fidl::encoding::Encoder<
3523 '_,
3524 fidl::encoding::DefaultFuchsiaResourceDialect,
3525 >,
3526 offset: usize,
3527 depth: fidl::encoding::Depth,
3528 ) -> fidl::Result<()> {
3529 encoder.debug_check_bounds::<StoreAccessorGetPrefixRequest>(offset);
3530 unsafe {
3533 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
3534 (ptr as *mut u64).write_unaligned(0);
3535 }
3536 self.0.encode(encoder, offset + 0, depth)?;
3538 self.1.encode(encoder, offset + 16, depth)?;
3539 Ok(())
3540 }
3541 }
3542
3543 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3544 for StoreAccessorGetPrefixRequest
3545 {
3546 #[inline(always)]
3547 fn new_empty() -> Self {
3548 Self {
3549 prefix: fidl::new_empty!(
3550 fidl::encoding::BoundedString<256>,
3551 fidl::encoding::DefaultFuchsiaResourceDialect
3552 ),
3553 it: fidl::new_empty!(
3554 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GetIteratorMarker>>,
3555 fidl::encoding::DefaultFuchsiaResourceDialect
3556 ),
3557 }
3558 }
3559
3560 #[inline]
3561 unsafe fn decode(
3562 &mut self,
3563 decoder: &mut fidl::encoding::Decoder<
3564 '_,
3565 fidl::encoding::DefaultFuchsiaResourceDialect,
3566 >,
3567 offset: usize,
3568 _depth: fidl::encoding::Depth,
3569 ) -> fidl::Result<()> {
3570 decoder.debug_check_bounds::<Self>(offset);
3571 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
3573 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3574 let mask = 0xffffffff00000000u64;
3575 let maskedval = padval & mask;
3576 if maskedval != 0 {
3577 return Err(fidl::Error::NonZeroPadding {
3578 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
3579 });
3580 }
3581 fidl::decode!(
3582 fidl::encoding::BoundedString<256>,
3583 fidl::encoding::DefaultFuchsiaResourceDialect,
3584 &mut self.prefix,
3585 decoder,
3586 offset + 0,
3587 _depth
3588 )?;
3589 fidl::decode!(
3590 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<GetIteratorMarker>>,
3591 fidl::encoding::DefaultFuchsiaResourceDialect,
3592 &mut self.it,
3593 decoder,
3594 offset + 16,
3595 _depth
3596 )?;
3597 Ok(())
3598 }
3599 }
3600
3601 impl fidl::encoding::ResourceTypeMarker for StoreAccessorGetValueResponse {
3602 type Borrowed<'a> = &'a mut Self;
3603 fn take_or_borrow<'a>(
3604 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3605 ) -> Self::Borrowed<'a> {
3606 value
3607 }
3608 }
3609
3610 unsafe impl fidl::encoding::TypeMarker for StoreAccessorGetValueResponse {
3611 type Owned = Self;
3612
3613 #[inline(always)]
3614 fn inline_align(_context: fidl::encoding::Context) -> usize {
3615 8
3616 }
3617
3618 #[inline(always)]
3619 fn inline_size(_context: fidl::encoding::Context) -> usize {
3620 16
3621 }
3622 }
3623
3624 unsafe impl
3625 fidl::encoding::Encode<
3626 StoreAccessorGetValueResponse,
3627 fidl::encoding::DefaultFuchsiaResourceDialect,
3628 > for &mut StoreAccessorGetValueResponse
3629 {
3630 #[inline]
3631 unsafe fn encode(
3632 self,
3633 encoder: &mut fidl::encoding::Encoder<
3634 '_,
3635 fidl::encoding::DefaultFuchsiaResourceDialect,
3636 >,
3637 offset: usize,
3638 _depth: fidl::encoding::Depth,
3639 ) -> fidl::Result<()> {
3640 encoder.debug_check_bounds::<StoreAccessorGetValueResponse>(offset);
3641 fidl::encoding::Encode::<StoreAccessorGetValueResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3643 (
3644 <fidl::encoding::OptionalUnion<Value> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.val),
3645 ),
3646 encoder, offset, _depth
3647 )
3648 }
3649 }
3650 unsafe impl<
3651 T0: fidl::encoding::Encode<
3652 fidl::encoding::OptionalUnion<Value>,
3653 fidl::encoding::DefaultFuchsiaResourceDialect,
3654 >,
3655 >
3656 fidl::encoding::Encode<
3657 StoreAccessorGetValueResponse,
3658 fidl::encoding::DefaultFuchsiaResourceDialect,
3659 > for (T0,)
3660 {
3661 #[inline]
3662 unsafe fn encode(
3663 self,
3664 encoder: &mut fidl::encoding::Encoder<
3665 '_,
3666 fidl::encoding::DefaultFuchsiaResourceDialect,
3667 >,
3668 offset: usize,
3669 depth: fidl::encoding::Depth,
3670 ) -> fidl::Result<()> {
3671 encoder.debug_check_bounds::<StoreAccessorGetValueResponse>(offset);
3672 self.0.encode(encoder, offset + 0, depth)?;
3676 Ok(())
3677 }
3678 }
3679
3680 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3681 for StoreAccessorGetValueResponse
3682 {
3683 #[inline(always)]
3684 fn new_empty() -> Self {
3685 Self {
3686 val: fidl::new_empty!(
3687 fidl::encoding::OptionalUnion<Value>,
3688 fidl::encoding::DefaultFuchsiaResourceDialect
3689 ),
3690 }
3691 }
3692
3693 #[inline]
3694 unsafe fn decode(
3695 &mut self,
3696 decoder: &mut fidl::encoding::Decoder<
3697 '_,
3698 fidl::encoding::DefaultFuchsiaResourceDialect,
3699 >,
3700 offset: usize,
3701 _depth: fidl::encoding::Depth,
3702 ) -> fidl::Result<()> {
3703 decoder.debug_check_bounds::<Self>(offset);
3704 fidl::decode!(
3706 fidl::encoding::OptionalUnion<Value>,
3707 fidl::encoding::DefaultFuchsiaResourceDialect,
3708 &mut self.val,
3709 decoder,
3710 offset + 0,
3711 _depth
3712 )?;
3713 Ok(())
3714 }
3715 }
3716
3717 impl fidl::encoding::ResourceTypeMarker for StoreAccessorListPrefixRequest {
3718 type Borrowed<'a> = &'a mut Self;
3719 fn take_or_borrow<'a>(
3720 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3721 ) -> Self::Borrowed<'a> {
3722 value
3723 }
3724 }
3725
3726 unsafe impl fidl::encoding::TypeMarker for StoreAccessorListPrefixRequest {
3727 type Owned = Self;
3728
3729 #[inline(always)]
3730 fn inline_align(_context: fidl::encoding::Context) -> usize {
3731 8
3732 }
3733
3734 #[inline(always)]
3735 fn inline_size(_context: fidl::encoding::Context) -> usize {
3736 24
3737 }
3738 }
3739
3740 unsafe impl
3741 fidl::encoding::Encode<
3742 StoreAccessorListPrefixRequest,
3743 fidl::encoding::DefaultFuchsiaResourceDialect,
3744 > for &mut StoreAccessorListPrefixRequest
3745 {
3746 #[inline]
3747 unsafe fn encode(
3748 self,
3749 encoder: &mut fidl::encoding::Encoder<
3750 '_,
3751 fidl::encoding::DefaultFuchsiaResourceDialect,
3752 >,
3753 offset: usize,
3754 _depth: fidl::encoding::Depth,
3755 ) -> fidl::Result<()> {
3756 encoder.debug_check_bounds::<StoreAccessorListPrefixRequest>(offset);
3757 fidl::encoding::Encode::<StoreAccessorListPrefixRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3759 (
3760 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(&self.prefix),
3761 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ListIteratorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.it),
3762 ),
3763 encoder, offset, _depth
3764 )
3765 }
3766 }
3767 unsafe impl<
3768 T0: fidl::encoding::Encode<
3769 fidl::encoding::BoundedString<256>,
3770 fidl::encoding::DefaultFuchsiaResourceDialect,
3771 >,
3772 T1: fidl::encoding::Encode<
3773 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ListIteratorMarker>>,
3774 fidl::encoding::DefaultFuchsiaResourceDialect,
3775 >,
3776 >
3777 fidl::encoding::Encode<
3778 StoreAccessorListPrefixRequest,
3779 fidl::encoding::DefaultFuchsiaResourceDialect,
3780 > for (T0, T1)
3781 {
3782 #[inline]
3783 unsafe fn encode(
3784 self,
3785 encoder: &mut fidl::encoding::Encoder<
3786 '_,
3787 fidl::encoding::DefaultFuchsiaResourceDialect,
3788 >,
3789 offset: usize,
3790 depth: fidl::encoding::Depth,
3791 ) -> fidl::Result<()> {
3792 encoder.debug_check_bounds::<StoreAccessorListPrefixRequest>(offset);
3793 unsafe {
3796 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
3797 (ptr as *mut u64).write_unaligned(0);
3798 }
3799 self.0.encode(encoder, offset + 0, depth)?;
3801 self.1.encode(encoder, offset + 16, depth)?;
3802 Ok(())
3803 }
3804 }
3805
3806 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3807 for StoreAccessorListPrefixRequest
3808 {
3809 #[inline(always)]
3810 fn new_empty() -> Self {
3811 Self {
3812 prefix: fidl::new_empty!(
3813 fidl::encoding::BoundedString<256>,
3814 fidl::encoding::DefaultFuchsiaResourceDialect
3815 ),
3816 it: fidl::new_empty!(
3817 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ListIteratorMarker>>,
3818 fidl::encoding::DefaultFuchsiaResourceDialect
3819 ),
3820 }
3821 }
3822
3823 #[inline]
3824 unsafe fn decode(
3825 &mut self,
3826 decoder: &mut fidl::encoding::Decoder<
3827 '_,
3828 fidl::encoding::DefaultFuchsiaResourceDialect,
3829 >,
3830 offset: usize,
3831 _depth: fidl::encoding::Depth,
3832 ) -> fidl::Result<()> {
3833 decoder.debug_check_bounds::<Self>(offset);
3834 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
3836 let padval = unsafe { (ptr as *const u64).read_unaligned() };
3837 let mask = 0xffffffff00000000u64;
3838 let maskedval = padval & mask;
3839 if maskedval != 0 {
3840 return Err(fidl::Error::NonZeroPadding {
3841 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
3842 });
3843 }
3844 fidl::decode!(
3845 fidl::encoding::BoundedString<256>,
3846 fidl::encoding::DefaultFuchsiaResourceDialect,
3847 &mut self.prefix,
3848 decoder,
3849 offset + 0,
3850 _depth
3851 )?;
3852 fidl::decode!(
3853 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ListIteratorMarker>>,
3854 fidl::encoding::DefaultFuchsiaResourceDialect,
3855 &mut self.it,
3856 decoder,
3857 offset + 16,
3858 _depth
3859 )?;
3860 Ok(())
3861 }
3862 }
3863
3864 impl fidl::encoding::ResourceTypeMarker for StoreAccessorSetValueRequest {
3865 type Borrowed<'a> = &'a mut Self;
3866 fn take_or_borrow<'a>(
3867 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3868 ) -> Self::Borrowed<'a> {
3869 value
3870 }
3871 }
3872
3873 unsafe impl fidl::encoding::TypeMarker for StoreAccessorSetValueRequest {
3874 type Owned = Self;
3875
3876 #[inline(always)]
3877 fn inline_align(_context: fidl::encoding::Context) -> usize {
3878 8
3879 }
3880
3881 #[inline(always)]
3882 fn inline_size(_context: fidl::encoding::Context) -> usize {
3883 32
3884 }
3885 }
3886
3887 unsafe impl
3888 fidl::encoding::Encode<
3889 StoreAccessorSetValueRequest,
3890 fidl::encoding::DefaultFuchsiaResourceDialect,
3891 > for &mut StoreAccessorSetValueRequest
3892 {
3893 #[inline]
3894 unsafe fn encode(
3895 self,
3896 encoder: &mut fidl::encoding::Encoder<
3897 '_,
3898 fidl::encoding::DefaultFuchsiaResourceDialect,
3899 >,
3900 offset: usize,
3901 _depth: fidl::encoding::Depth,
3902 ) -> fidl::Result<()> {
3903 encoder.debug_check_bounds::<StoreAccessorSetValueRequest>(offset);
3904 fidl::encoding::Encode::<
3906 StoreAccessorSetValueRequest,
3907 fidl::encoding::DefaultFuchsiaResourceDialect,
3908 >::encode(
3909 (
3910 <fidl::encoding::BoundedString<256> as fidl::encoding::ValueTypeMarker>::borrow(
3911 &self.key,
3912 ),
3913 <Value as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.val),
3914 ),
3915 encoder,
3916 offset,
3917 _depth,
3918 )
3919 }
3920 }
3921 unsafe impl<
3922 T0: fidl::encoding::Encode<
3923 fidl::encoding::BoundedString<256>,
3924 fidl::encoding::DefaultFuchsiaResourceDialect,
3925 >,
3926 T1: fidl::encoding::Encode<Value, fidl::encoding::DefaultFuchsiaResourceDialect>,
3927 >
3928 fidl::encoding::Encode<
3929 StoreAccessorSetValueRequest,
3930 fidl::encoding::DefaultFuchsiaResourceDialect,
3931 > for (T0, T1)
3932 {
3933 #[inline]
3934 unsafe fn encode(
3935 self,
3936 encoder: &mut fidl::encoding::Encoder<
3937 '_,
3938 fidl::encoding::DefaultFuchsiaResourceDialect,
3939 >,
3940 offset: usize,
3941 depth: fidl::encoding::Depth,
3942 ) -> fidl::Result<()> {
3943 encoder.debug_check_bounds::<StoreAccessorSetValueRequest>(offset);
3944 self.0.encode(encoder, offset + 0, depth)?;
3948 self.1.encode(encoder, offset + 16, depth)?;
3949 Ok(())
3950 }
3951 }
3952
3953 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3954 for StoreAccessorSetValueRequest
3955 {
3956 #[inline(always)]
3957 fn new_empty() -> Self {
3958 Self {
3959 key: fidl::new_empty!(
3960 fidl::encoding::BoundedString<256>,
3961 fidl::encoding::DefaultFuchsiaResourceDialect
3962 ),
3963 val: fidl::new_empty!(Value, fidl::encoding::DefaultFuchsiaResourceDialect),
3964 }
3965 }
3966
3967 #[inline]
3968 unsafe fn decode(
3969 &mut self,
3970 decoder: &mut fidl::encoding::Decoder<
3971 '_,
3972 fidl::encoding::DefaultFuchsiaResourceDialect,
3973 >,
3974 offset: usize,
3975 _depth: fidl::encoding::Depth,
3976 ) -> fidl::Result<()> {
3977 decoder.debug_check_bounds::<Self>(offset);
3978 fidl::decode!(
3980 fidl::encoding::BoundedString<256>,
3981 fidl::encoding::DefaultFuchsiaResourceDialect,
3982 &mut self.key,
3983 decoder,
3984 offset + 0,
3985 _depth
3986 )?;
3987 fidl::decode!(
3988 Value,
3989 fidl::encoding::DefaultFuchsiaResourceDialect,
3990 &mut self.val,
3991 decoder,
3992 offset + 16,
3993 _depth
3994 )?;
3995 Ok(())
3996 }
3997 }
3998
3999 impl fidl::encoding::ResourceTypeMarker for StoreCreateAccessorRequest {
4000 type Borrowed<'a> = &'a mut Self;
4001 fn take_or_borrow<'a>(
4002 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4003 ) -> Self::Borrowed<'a> {
4004 value
4005 }
4006 }
4007
4008 unsafe impl fidl::encoding::TypeMarker for StoreCreateAccessorRequest {
4009 type Owned = Self;
4010
4011 #[inline(always)]
4012 fn inline_align(_context: fidl::encoding::Context) -> usize {
4013 4
4014 }
4015
4016 #[inline(always)]
4017 fn inline_size(_context: fidl::encoding::Context) -> usize {
4018 8
4019 }
4020 }
4021
4022 unsafe impl
4023 fidl::encoding::Encode<
4024 StoreCreateAccessorRequest,
4025 fidl::encoding::DefaultFuchsiaResourceDialect,
4026 > for &mut StoreCreateAccessorRequest
4027 {
4028 #[inline]
4029 unsafe fn encode(
4030 self,
4031 encoder: &mut fidl::encoding::Encoder<
4032 '_,
4033 fidl::encoding::DefaultFuchsiaResourceDialect,
4034 >,
4035 offset: usize,
4036 _depth: fidl::encoding::Depth,
4037 ) -> fidl::Result<()> {
4038 encoder.debug_check_bounds::<StoreCreateAccessorRequest>(offset);
4039 fidl::encoding::Encode::<StoreCreateAccessorRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
4041 (
4042 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.read_only),
4043 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StoreAccessorMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.accessor_request),
4044 ),
4045 encoder, offset, _depth
4046 )
4047 }
4048 }
4049 unsafe impl<
4050 T0: fidl::encoding::Encode<bool, fidl::encoding::DefaultFuchsiaResourceDialect>,
4051 T1: fidl::encoding::Encode<
4052 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StoreAccessorMarker>>,
4053 fidl::encoding::DefaultFuchsiaResourceDialect,
4054 >,
4055 >
4056 fidl::encoding::Encode<
4057 StoreCreateAccessorRequest,
4058 fidl::encoding::DefaultFuchsiaResourceDialect,
4059 > for (T0, T1)
4060 {
4061 #[inline]
4062 unsafe fn encode(
4063 self,
4064 encoder: &mut fidl::encoding::Encoder<
4065 '_,
4066 fidl::encoding::DefaultFuchsiaResourceDialect,
4067 >,
4068 offset: usize,
4069 depth: fidl::encoding::Depth,
4070 ) -> fidl::Result<()> {
4071 encoder.debug_check_bounds::<StoreCreateAccessorRequest>(offset);
4072 unsafe {
4075 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
4076 (ptr as *mut u32).write_unaligned(0);
4077 }
4078 self.0.encode(encoder, offset + 0, depth)?;
4080 self.1.encode(encoder, offset + 4, depth)?;
4081 Ok(())
4082 }
4083 }
4084
4085 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4086 for StoreCreateAccessorRequest
4087 {
4088 #[inline(always)]
4089 fn new_empty() -> Self {
4090 Self {
4091 read_only: fidl::new_empty!(bool, fidl::encoding::DefaultFuchsiaResourceDialect),
4092 accessor_request: fidl::new_empty!(
4093 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StoreAccessorMarker>>,
4094 fidl::encoding::DefaultFuchsiaResourceDialect
4095 ),
4096 }
4097 }
4098
4099 #[inline]
4100 unsafe fn decode(
4101 &mut self,
4102 decoder: &mut fidl::encoding::Decoder<
4103 '_,
4104 fidl::encoding::DefaultFuchsiaResourceDialect,
4105 >,
4106 offset: usize,
4107 _depth: fidl::encoding::Depth,
4108 ) -> fidl::Result<()> {
4109 decoder.debug_check_bounds::<Self>(offset);
4110 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
4112 let padval = unsafe { (ptr as *const u32).read_unaligned() };
4113 let mask = 0xffffff00u32;
4114 let maskedval = padval & mask;
4115 if maskedval != 0 {
4116 return Err(fidl::Error::NonZeroPadding {
4117 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
4118 });
4119 }
4120 fidl::decode!(
4121 bool,
4122 fidl::encoding::DefaultFuchsiaResourceDialect,
4123 &mut self.read_only,
4124 decoder,
4125 offset + 0,
4126 _depth
4127 )?;
4128 fidl::decode!(
4129 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StoreAccessorMarker>>,
4130 fidl::encoding::DefaultFuchsiaResourceDialect,
4131 &mut self.accessor_request,
4132 decoder,
4133 offset + 4,
4134 _depth
4135 )?;
4136 Ok(())
4137 }
4138 }
4139
4140 impl fidl::encoding::ResourceTypeMarker for Value {
4141 type Borrowed<'a> = &'a mut Self;
4142 fn take_or_borrow<'a>(
4143 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4144 ) -> Self::Borrowed<'a> {
4145 value
4146 }
4147 }
4148
4149 unsafe impl fidl::encoding::TypeMarker for Value {
4150 type Owned = Self;
4151
4152 #[inline(always)]
4153 fn inline_align(_context: fidl::encoding::Context) -> usize {
4154 8
4155 }
4156
4157 #[inline(always)]
4158 fn inline_size(_context: fidl::encoding::Context) -> usize {
4159 16
4160 }
4161 }
4162
4163 unsafe impl fidl::encoding::Encode<Value, fidl::encoding::DefaultFuchsiaResourceDialect>
4164 for &mut Value
4165 {
4166 #[inline]
4167 unsafe fn encode(
4168 self,
4169 encoder: &mut fidl::encoding::Encoder<
4170 '_,
4171 fidl::encoding::DefaultFuchsiaResourceDialect,
4172 >,
4173 offset: usize,
4174 _depth: fidl::encoding::Depth,
4175 ) -> fidl::Result<()> {
4176 encoder.debug_check_bounds::<Value>(offset);
4177 encoder.write_num::<u64>(self.ordinal(), offset);
4178 match self {
4179 Value::Intval(ref val) => {
4180 fidl::encoding::encode_in_envelope::<i64, fidl::encoding::DefaultFuchsiaResourceDialect>(
4181 <i64 as fidl::encoding::ValueTypeMarker>::borrow(val),
4182 encoder, offset + 8, _depth
4183 )
4184 }
4185 Value::Floatval(ref val) => {
4186 fidl::encoding::encode_in_envelope::<f64, fidl::encoding::DefaultFuchsiaResourceDialect>(
4187 <f64 as fidl::encoding::ValueTypeMarker>::borrow(val),
4188 encoder, offset + 8, _depth
4189 )
4190 }
4191 Value::Boolval(ref val) => {
4192 fidl::encoding::encode_in_envelope::<bool, fidl::encoding::DefaultFuchsiaResourceDialect>(
4193 <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
4194 encoder, offset + 8, _depth
4195 )
4196 }
4197 Value::Stringval(ref val) => {
4198 fidl::encoding::encode_in_envelope::<fidl::encoding::BoundedString<12000>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4199 <fidl::encoding::BoundedString<12000> as fidl::encoding::ValueTypeMarker>::borrow(val),
4200 encoder, offset + 8, _depth
4201 )
4202 }
4203 Value::Bytesval(ref mut val) => {
4204 fidl::encoding::encode_in_envelope::<fidl_fuchsia_mem::Buffer, fidl::encoding::DefaultFuchsiaResourceDialect>(
4205 <fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
4206 encoder, offset + 8, _depth
4207 )
4208 }
4209 }
4210 }
4211 }
4212
4213 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Value {
4214 #[inline(always)]
4215 fn new_empty() -> Self {
4216 Self::Intval(fidl::new_empty!(i64, fidl::encoding::DefaultFuchsiaResourceDialect))
4217 }
4218
4219 #[inline]
4220 unsafe fn decode(
4221 &mut self,
4222 decoder: &mut fidl::encoding::Decoder<
4223 '_,
4224 fidl::encoding::DefaultFuchsiaResourceDialect,
4225 >,
4226 offset: usize,
4227 mut depth: fidl::encoding::Depth,
4228 ) -> fidl::Result<()> {
4229 decoder.debug_check_bounds::<Self>(offset);
4230 #[allow(unused_variables)]
4231 let next_out_of_line = decoder.next_out_of_line();
4232 let handles_before = decoder.remaining_handles();
4233 let (ordinal, inlined, num_bytes, num_handles) =
4234 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
4235
4236 let member_inline_size = match ordinal {
4237 1 => <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4238 2 => <f64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4239 3 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4240 4 => <fidl::encoding::BoundedString<12000> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4241 5 => <fidl_fuchsia_mem::Buffer as fidl::encoding::TypeMarker>::inline_size(decoder.context),
4242 _ => return Err(fidl::Error::UnknownUnionTag),
4243 };
4244
4245 if inlined != (member_inline_size <= 4) {
4246 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4247 }
4248 let _inner_offset;
4249 if inlined {
4250 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
4251 _inner_offset = offset + 8;
4252 } else {
4253 depth.increment()?;
4254 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4255 }
4256 match ordinal {
4257 1 => {
4258 #[allow(irrefutable_let_patterns)]
4259 if let Value::Intval(_) = self {
4260 } else {
4262 *self = Value::Intval(fidl::new_empty!(
4264 i64,
4265 fidl::encoding::DefaultFuchsiaResourceDialect
4266 ));
4267 }
4268 #[allow(irrefutable_let_patterns)]
4269 if let Value::Intval(ref mut val) = self {
4270 fidl::decode!(
4271 i64,
4272 fidl::encoding::DefaultFuchsiaResourceDialect,
4273 val,
4274 decoder,
4275 _inner_offset,
4276 depth
4277 )?;
4278 } else {
4279 unreachable!()
4280 }
4281 }
4282 2 => {
4283 #[allow(irrefutable_let_patterns)]
4284 if let Value::Floatval(_) = self {
4285 } else {
4287 *self = Value::Floatval(fidl::new_empty!(
4289 f64,
4290 fidl::encoding::DefaultFuchsiaResourceDialect
4291 ));
4292 }
4293 #[allow(irrefutable_let_patterns)]
4294 if let Value::Floatval(ref mut val) = self {
4295 fidl::decode!(
4296 f64,
4297 fidl::encoding::DefaultFuchsiaResourceDialect,
4298 val,
4299 decoder,
4300 _inner_offset,
4301 depth
4302 )?;
4303 } else {
4304 unreachable!()
4305 }
4306 }
4307 3 => {
4308 #[allow(irrefutable_let_patterns)]
4309 if let Value::Boolval(_) = self {
4310 } else {
4312 *self = Value::Boolval(fidl::new_empty!(
4314 bool,
4315 fidl::encoding::DefaultFuchsiaResourceDialect
4316 ));
4317 }
4318 #[allow(irrefutable_let_patterns)]
4319 if let Value::Boolval(ref mut val) = self {
4320 fidl::decode!(
4321 bool,
4322 fidl::encoding::DefaultFuchsiaResourceDialect,
4323 val,
4324 decoder,
4325 _inner_offset,
4326 depth
4327 )?;
4328 } else {
4329 unreachable!()
4330 }
4331 }
4332 4 => {
4333 #[allow(irrefutable_let_patterns)]
4334 if let Value::Stringval(_) = self {
4335 } else {
4337 *self = Value::Stringval(fidl::new_empty!(
4339 fidl::encoding::BoundedString<12000>,
4340 fidl::encoding::DefaultFuchsiaResourceDialect
4341 ));
4342 }
4343 #[allow(irrefutable_let_patterns)]
4344 if let Value::Stringval(ref mut val) = self {
4345 fidl::decode!(
4346 fidl::encoding::BoundedString<12000>,
4347 fidl::encoding::DefaultFuchsiaResourceDialect,
4348 val,
4349 decoder,
4350 _inner_offset,
4351 depth
4352 )?;
4353 } else {
4354 unreachable!()
4355 }
4356 }
4357 5 => {
4358 #[allow(irrefutable_let_patterns)]
4359 if let Value::Bytesval(_) = self {
4360 } else {
4362 *self = Value::Bytesval(fidl::new_empty!(
4364 fidl_fuchsia_mem::Buffer,
4365 fidl::encoding::DefaultFuchsiaResourceDialect
4366 ));
4367 }
4368 #[allow(irrefutable_let_patterns)]
4369 if let Value::Bytesval(ref mut val) = self {
4370 fidl::decode!(
4371 fidl_fuchsia_mem::Buffer,
4372 fidl::encoding::DefaultFuchsiaResourceDialect,
4373 val,
4374 decoder,
4375 _inner_offset,
4376 depth
4377 )?;
4378 } else {
4379 unreachable!()
4380 }
4381 }
4382 ordinal => panic!("unexpected ordinal {:?}", ordinal),
4383 }
4384 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
4385 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4386 }
4387 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4388 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4389 }
4390 Ok(())
4391 }
4392 }
4393}