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_element__common::*;
11use futures::future::{self, MaybeDone, TryFutureExt};
12use zx_status;
13
14pub type Annotations = Vec<Annotation>;
16
17#[derive(Debug, PartialEq)]
23pub struct Annotation {
24 pub key: AnnotationKey,
26 pub value: AnnotationValue,
28}
29
30impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Annotation {}
31
32#[derive(Debug, PartialEq)]
33pub struct AnnotationControllerUpdateAnnotationsRequest {
34 pub annotations_to_set: Vec<Annotation>,
35 pub annotations_to_delete: Vec<AnnotationKey>,
36}
37
38impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
39 for AnnotationControllerUpdateAnnotationsRequest
40{
41}
42
43#[derive(Debug, PartialEq)]
44pub struct AnnotationControllerGetAnnotationsResponse {
45 pub annotations: Vec<Annotation>,
46}
47
48impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
49 for AnnotationControllerGetAnnotationsResponse
50{
51}
52
53#[derive(Debug, PartialEq)]
54pub struct AnnotationControllerWatchAnnotationsResponse {
55 pub annotations: Vec<Annotation>,
56}
57
58impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
59 for AnnotationControllerWatchAnnotationsResponse
60{
61}
62
63#[derive(Debug, PartialEq)]
64pub struct GraphicalPresenterPresentViewRequest {
65 pub view_spec: ViewSpec,
66 pub annotation_controller: Option<fidl::endpoints::ClientEnd<AnnotationControllerMarker>>,
67 pub view_controller_request: Option<fidl::endpoints::ServerEnd<ViewControllerMarker>>,
68}
69
70impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
71 for GraphicalPresenterPresentViewRequest
72{
73}
74
75#[derive(Debug, PartialEq)]
76pub struct ManagerProposeElementRequest {
77 pub spec: Spec,
78 pub controller: Option<fidl::endpoints::ServerEnd<ControllerMarker>>,
79}
80
81impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
82 for ManagerProposeElementRequest
83{
84}
85
86#[derive(Debug, Default, PartialEq)]
88pub struct Spec {
89 pub component_url: Option<String>,
91 pub annotations: Option<Vec<Annotation>>,
95 #[doc(hidden)]
96 pub __source_breaking: fidl::marker::SourceBreaking,
97}
98
99impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for Spec {}
100
101#[derive(Debug, Default, PartialEq)]
103pub struct ViewSpec {
104 pub view_holder_token: Option<fidl_fuchsia_ui_views::ViewHolderToken>,
108 pub view_ref: Option<fidl_fuchsia_ui_views::ViewRef>,
111 pub annotations: Option<Vec<Annotation>>,
117 pub viewport_creation_token: Option<fidl_fuchsia_ui_views::ViewportCreationToken>,
121 #[doc(hidden)]
122 pub __source_breaking: fidl::marker::SourceBreaking,
123}
124
125impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for ViewSpec {}
126
127#[derive(Debug, PartialEq)]
131pub enum AnnotationValue {
132 Text(String),
133 Buffer(fidl_fuchsia_mem::Buffer),
134}
135
136impl AnnotationValue {
137 #[inline]
138 pub fn ordinal(&self) -> u64 {
139 match *self {
140 Self::Text(_) => 1,
141 Self::Buffer(_) => 2,
142 }
143 }
144}
145
146impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for AnnotationValue {}
147
148#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
149pub struct AnnotationControllerMarker;
150
151impl fidl::endpoints::ProtocolMarker for AnnotationControllerMarker {
152 type Proxy = AnnotationControllerProxy;
153 type RequestStream = AnnotationControllerRequestStream;
154 #[cfg(target_os = "fuchsia")]
155 type SynchronousProxy = AnnotationControllerSynchronousProxy;
156
157 const DEBUG_NAME: &'static str = "(anonymous) AnnotationController";
158}
159pub type AnnotationControllerUpdateAnnotationsResult = Result<(), UpdateAnnotationsError>;
160pub type AnnotationControllerGetAnnotationsResult = Result<Vec<Annotation>, GetAnnotationsError>;
161pub type AnnotationControllerWatchAnnotationsResult =
162 Result<Vec<Annotation>, WatchAnnotationsError>;
163
164pub trait AnnotationControllerProxyInterface: Send + Sync {
165 type UpdateAnnotationsResponseFut: std::future::Future<
166 Output = Result<AnnotationControllerUpdateAnnotationsResult, fidl::Error>,
167 > + Send;
168 fn r#update_annotations(
169 &self,
170 annotations_to_set: Vec<Annotation>,
171 annotations_to_delete: &[AnnotationKey],
172 ) -> Self::UpdateAnnotationsResponseFut;
173 type GetAnnotationsResponseFut: std::future::Future<Output = Result<AnnotationControllerGetAnnotationsResult, fidl::Error>>
174 + Send;
175 fn r#get_annotations(&self) -> Self::GetAnnotationsResponseFut;
176 type WatchAnnotationsResponseFut: std::future::Future<
177 Output = Result<AnnotationControllerWatchAnnotationsResult, fidl::Error>,
178 > + Send;
179 fn r#watch_annotations(&self) -> Self::WatchAnnotationsResponseFut;
180}
181#[derive(Debug)]
182#[cfg(target_os = "fuchsia")]
183pub struct AnnotationControllerSynchronousProxy {
184 client: fidl::client::sync::Client,
185}
186
187#[cfg(target_os = "fuchsia")]
188impl fidl::endpoints::SynchronousProxy for AnnotationControllerSynchronousProxy {
189 type Proxy = AnnotationControllerProxy;
190 type Protocol = AnnotationControllerMarker;
191
192 fn from_channel(inner: fidl::Channel) -> Self {
193 Self::new(inner)
194 }
195
196 fn into_channel(self) -> fidl::Channel {
197 self.client.into_channel()
198 }
199
200 fn as_channel(&self) -> &fidl::Channel {
201 self.client.as_channel()
202 }
203}
204
205#[cfg(target_os = "fuchsia")]
206impl AnnotationControllerSynchronousProxy {
207 pub fn new(channel: fidl::Channel) -> Self {
208 let protocol_name =
209 <AnnotationControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
210 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
211 }
212
213 pub fn into_channel(self) -> fidl::Channel {
214 self.client.into_channel()
215 }
216
217 pub fn wait_for_event(
220 &self,
221 deadline: zx::MonotonicInstant,
222 ) -> Result<AnnotationControllerEvent, fidl::Error> {
223 AnnotationControllerEvent::decode(self.client.wait_for_event(deadline)?)
224 }
225
226 pub fn r#update_annotations(
250 &self,
251 mut annotations_to_set: Vec<Annotation>,
252 mut annotations_to_delete: &[AnnotationKey],
253 ___deadline: zx::MonotonicInstant,
254 ) -> Result<AnnotationControllerUpdateAnnotationsResult, fidl::Error> {
255 let _response = self.client.send_query::<
256 AnnotationControllerUpdateAnnotationsRequest,
257 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, UpdateAnnotationsError>,
258 >(
259 (annotations_to_set.as_mut(), annotations_to_delete,),
260 0x5718e51a2774c686,
261 fidl::encoding::DynamicFlags::empty(),
262 ___deadline,
263 )?;
264 Ok(_response.map(|x| x))
265 }
266
267 pub fn r#get_annotations(
271 &self,
272 ___deadline: zx::MonotonicInstant,
273 ) -> Result<AnnotationControllerGetAnnotationsResult, fidl::Error> {
274 let _response = self
275 .client
276 .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
277 AnnotationControllerGetAnnotationsResponse,
278 GetAnnotationsError,
279 >>(
280 (), 0xae78b17381824fa, fidl::encoding::DynamicFlags::empty(), ___deadline
281 )?;
282 Ok(_response.map(|x| x.annotations))
283 }
284
285 pub fn r#watch_annotations(
295 &self,
296 ___deadline: zx::MonotonicInstant,
297 ) -> Result<AnnotationControllerWatchAnnotationsResult, fidl::Error> {
298 let _response = self
299 .client
300 .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
301 AnnotationControllerWatchAnnotationsResponse,
302 WatchAnnotationsError,
303 >>(
304 (), 0x253b196cae31356f, fidl::encoding::DynamicFlags::empty(), ___deadline
305 )?;
306 Ok(_response.map(|x| x.annotations))
307 }
308}
309
310#[cfg(target_os = "fuchsia")]
311impl From<AnnotationControllerSynchronousProxy> for zx::Handle {
312 fn from(value: AnnotationControllerSynchronousProxy) -> Self {
313 value.into_channel().into()
314 }
315}
316
317#[cfg(target_os = "fuchsia")]
318impl From<fidl::Channel> for AnnotationControllerSynchronousProxy {
319 fn from(value: fidl::Channel) -> Self {
320 Self::new(value)
321 }
322}
323
324#[cfg(target_os = "fuchsia")]
325impl fidl::endpoints::FromClient for AnnotationControllerSynchronousProxy {
326 type Protocol = AnnotationControllerMarker;
327
328 fn from_client(value: fidl::endpoints::ClientEnd<AnnotationControllerMarker>) -> Self {
329 Self::new(value.into_channel())
330 }
331}
332
333#[derive(Debug, Clone)]
334pub struct AnnotationControllerProxy {
335 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
336}
337
338impl fidl::endpoints::Proxy for AnnotationControllerProxy {
339 type Protocol = AnnotationControllerMarker;
340
341 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
342 Self::new(inner)
343 }
344
345 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
346 self.client.into_channel().map_err(|client| Self { client })
347 }
348
349 fn as_channel(&self) -> &::fidl::AsyncChannel {
350 self.client.as_channel()
351 }
352}
353
354impl AnnotationControllerProxy {
355 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
357 let protocol_name =
358 <AnnotationControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
359 Self { client: fidl::client::Client::new(channel, protocol_name) }
360 }
361
362 pub fn take_event_stream(&self) -> AnnotationControllerEventStream {
368 AnnotationControllerEventStream { event_receiver: self.client.take_event_receiver() }
369 }
370
371 pub fn r#update_annotations(
395 &self,
396 mut annotations_to_set: Vec<Annotation>,
397 mut annotations_to_delete: &[AnnotationKey],
398 ) -> fidl::client::QueryResponseFut<
399 AnnotationControllerUpdateAnnotationsResult,
400 fidl::encoding::DefaultFuchsiaResourceDialect,
401 > {
402 AnnotationControllerProxyInterface::r#update_annotations(
403 self,
404 annotations_to_set,
405 annotations_to_delete,
406 )
407 }
408
409 pub fn r#get_annotations(
413 &self,
414 ) -> fidl::client::QueryResponseFut<
415 AnnotationControllerGetAnnotationsResult,
416 fidl::encoding::DefaultFuchsiaResourceDialect,
417 > {
418 AnnotationControllerProxyInterface::r#get_annotations(self)
419 }
420
421 pub fn r#watch_annotations(
431 &self,
432 ) -> fidl::client::QueryResponseFut<
433 AnnotationControllerWatchAnnotationsResult,
434 fidl::encoding::DefaultFuchsiaResourceDialect,
435 > {
436 AnnotationControllerProxyInterface::r#watch_annotations(self)
437 }
438}
439
440impl AnnotationControllerProxyInterface for AnnotationControllerProxy {
441 type UpdateAnnotationsResponseFut = fidl::client::QueryResponseFut<
442 AnnotationControllerUpdateAnnotationsResult,
443 fidl::encoding::DefaultFuchsiaResourceDialect,
444 >;
445 fn r#update_annotations(
446 &self,
447 mut annotations_to_set: Vec<Annotation>,
448 mut annotations_to_delete: &[AnnotationKey],
449 ) -> Self::UpdateAnnotationsResponseFut {
450 fn _decode(
451 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
452 ) -> Result<AnnotationControllerUpdateAnnotationsResult, fidl::Error> {
453 let _response = fidl::client::decode_transaction_body::<
454 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, UpdateAnnotationsError>,
455 fidl::encoding::DefaultFuchsiaResourceDialect,
456 0x5718e51a2774c686,
457 >(_buf?)?;
458 Ok(_response.map(|x| x))
459 }
460 self.client.send_query_and_decode::<
461 AnnotationControllerUpdateAnnotationsRequest,
462 AnnotationControllerUpdateAnnotationsResult,
463 >(
464 (annotations_to_set.as_mut(), annotations_to_delete,),
465 0x5718e51a2774c686,
466 fidl::encoding::DynamicFlags::empty(),
467 _decode,
468 )
469 }
470
471 type GetAnnotationsResponseFut = fidl::client::QueryResponseFut<
472 AnnotationControllerGetAnnotationsResult,
473 fidl::encoding::DefaultFuchsiaResourceDialect,
474 >;
475 fn r#get_annotations(&self) -> Self::GetAnnotationsResponseFut {
476 fn _decode(
477 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
478 ) -> Result<AnnotationControllerGetAnnotationsResult, fidl::Error> {
479 let _response = fidl::client::decode_transaction_body::<
480 fidl::encoding::ResultType<
481 AnnotationControllerGetAnnotationsResponse,
482 GetAnnotationsError,
483 >,
484 fidl::encoding::DefaultFuchsiaResourceDialect,
485 0xae78b17381824fa,
486 >(_buf?)?;
487 Ok(_response.map(|x| x.annotations))
488 }
489 self.client.send_query_and_decode::<
490 fidl::encoding::EmptyPayload,
491 AnnotationControllerGetAnnotationsResult,
492 >(
493 (),
494 0xae78b17381824fa,
495 fidl::encoding::DynamicFlags::empty(),
496 _decode,
497 )
498 }
499
500 type WatchAnnotationsResponseFut = fidl::client::QueryResponseFut<
501 AnnotationControllerWatchAnnotationsResult,
502 fidl::encoding::DefaultFuchsiaResourceDialect,
503 >;
504 fn r#watch_annotations(&self) -> Self::WatchAnnotationsResponseFut {
505 fn _decode(
506 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
507 ) -> Result<AnnotationControllerWatchAnnotationsResult, fidl::Error> {
508 let _response = fidl::client::decode_transaction_body::<
509 fidl::encoding::ResultType<
510 AnnotationControllerWatchAnnotationsResponse,
511 WatchAnnotationsError,
512 >,
513 fidl::encoding::DefaultFuchsiaResourceDialect,
514 0x253b196cae31356f,
515 >(_buf?)?;
516 Ok(_response.map(|x| x.annotations))
517 }
518 self.client.send_query_and_decode::<
519 fidl::encoding::EmptyPayload,
520 AnnotationControllerWatchAnnotationsResult,
521 >(
522 (),
523 0x253b196cae31356f,
524 fidl::encoding::DynamicFlags::empty(),
525 _decode,
526 )
527 }
528}
529
530pub struct AnnotationControllerEventStream {
531 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
532}
533
534impl std::marker::Unpin for AnnotationControllerEventStream {}
535
536impl futures::stream::FusedStream for AnnotationControllerEventStream {
537 fn is_terminated(&self) -> bool {
538 self.event_receiver.is_terminated()
539 }
540}
541
542impl futures::Stream for AnnotationControllerEventStream {
543 type Item = Result<AnnotationControllerEvent, fidl::Error>;
544
545 fn poll_next(
546 mut self: std::pin::Pin<&mut Self>,
547 cx: &mut std::task::Context<'_>,
548 ) -> std::task::Poll<Option<Self::Item>> {
549 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
550 &mut self.event_receiver,
551 cx
552 )?) {
553 Some(buf) => std::task::Poll::Ready(Some(AnnotationControllerEvent::decode(buf))),
554 None => std::task::Poll::Ready(None),
555 }
556 }
557}
558
559#[derive(Debug)]
560pub enum AnnotationControllerEvent {}
561
562impl AnnotationControllerEvent {
563 fn decode(
565 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
566 ) -> Result<AnnotationControllerEvent, fidl::Error> {
567 let (bytes, _handles) = buf.split_mut();
568 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
569 debug_assert_eq!(tx_header.tx_id, 0);
570 match tx_header.ordinal {
571 _ => Err(fidl::Error::UnknownOrdinal {
572 ordinal: tx_header.ordinal,
573 protocol_name:
574 <AnnotationControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
575 }),
576 }
577 }
578}
579
580pub struct AnnotationControllerRequestStream {
582 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
583 is_terminated: bool,
584}
585
586impl std::marker::Unpin for AnnotationControllerRequestStream {}
587
588impl futures::stream::FusedStream for AnnotationControllerRequestStream {
589 fn is_terminated(&self) -> bool {
590 self.is_terminated
591 }
592}
593
594impl fidl::endpoints::RequestStream for AnnotationControllerRequestStream {
595 type Protocol = AnnotationControllerMarker;
596 type ControlHandle = AnnotationControllerControlHandle;
597
598 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
599 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
600 }
601
602 fn control_handle(&self) -> Self::ControlHandle {
603 AnnotationControllerControlHandle { inner: self.inner.clone() }
604 }
605
606 fn into_inner(
607 self,
608 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
609 {
610 (self.inner, self.is_terminated)
611 }
612
613 fn from_inner(
614 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
615 is_terminated: bool,
616 ) -> Self {
617 Self { inner, is_terminated }
618 }
619}
620
621impl futures::Stream for AnnotationControllerRequestStream {
622 type Item = Result<AnnotationControllerRequest, fidl::Error>;
623
624 fn poll_next(
625 mut self: std::pin::Pin<&mut Self>,
626 cx: &mut std::task::Context<'_>,
627 ) -> std::task::Poll<Option<Self::Item>> {
628 let this = &mut *self;
629 if this.inner.check_shutdown(cx) {
630 this.is_terminated = true;
631 return std::task::Poll::Ready(None);
632 }
633 if this.is_terminated {
634 panic!("polled AnnotationControllerRequestStream after completion");
635 }
636 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
637 |bytes, handles| {
638 match this.inner.channel().read_etc(cx, bytes, handles) {
639 std::task::Poll::Ready(Ok(())) => {}
640 std::task::Poll::Pending => return std::task::Poll::Pending,
641 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
642 this.is_terminated = true;
643 return std::task::Poll::Ready(None);
644 }
645 std::task::Poll::Ready(Err(e)) => {
646 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
647 e.into(),
648 ))));
649 }
650 }
651
652 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
654
655 std::task::Poll::Ready(Some(match header.ordinal {
656 0x5718e51a2774c686 => {
657 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
658 let mut req = fidl::new_empty!(AnnotationControllerUpdateAnnotationsRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
659 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AnnotationControllerUpdateAnnotationsRequest>(&header, _body_bytes, handles, &mut req)?;
660 let control_handle = AnnotationControllerControlHandle {
661 inner: this.inner.clone(),
662 };
663 Ok(AnnotationControllerRequest::UpdateAnnotations {annotations_to_set: req.annotations_to_set,
664annotations_to_delete: req.annotations_to_delete,
665
666 responder: AnnotationControllerUpdateAnnotationsResponder {
667 control_handle: std::mem::ManuallyDrop::new(control_handle),
668 tx_id: header.tx_id,
669 },
670 })
671 }
672 0xae78b17381824fa => {
673 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
674 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
675 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
676 let control_handle = AnnotationControllerControlHandle {
677 inner: this.inner.clone(),
678 };
679 Ok(AnnotationControllerRequest::GetAnnotations {
680 responder: AnnotationControllerGetAnnotationsResponder {
681 control_handle: std::mem::ManuallyDrop::new(control_handle),
682 tx_id: header.tx_id,
683 },
684 })
685 }
686 0x253b196cae31356f => {
687 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
688 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
689 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
690 let control_handle = AnnotationControllerControlHandle {
691 inner: this.inner.clone(),
692 };
693 Ok(AnnotationControllerRequest::WatchAnnotations {
694 responder: AnnotationControllerWatchAnnotationsResponder {
695 control_handle: std::mem::ManuallyDrop::new(control_handle),
696 tx_id: header.tx_id,
697 },
698 })
699 }
700 _ => Err(fidl::Error::UnknownOrdinal {
701 ordinal: header.ordinal,
702 protocol_name: <AnnotationControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
703 }),
704 }))
705 },
706 )
707 }
708}
709
710#[derive(Debug)]
713pub enum AnnotationControllerRequest {
714 UpdateAnnotations {
738 annotations_to_set: Vec<Annotation>,
739 annotations_to_delete: Vec<AnnotationKey>,
740 responder: AnnotationControllerUpdateAnnotationsResponder,
741 },
742 GetAnnotations { responder: AnnotationControllerGetAnnotationsResponder },
746 WatchAnnotations { responder: AnnotationControllerWatchAnnotationsResponder },
756}
757
758impl AnnotationControllerRequest {
759 #[allow(irrefutable_let_patterns)]
760 pub fn into_update_annotations(
761 self,
762 ) -> Option<(Vec<Annotation>, Vec<AnnotationKey>, AnnotationControllerUpdateAnnotationsResponder)>
763 {
764 if let AnnotationControllerRequest::UpdateAnnotations {
765 annotations_to_set,
766 annotations_to_delete,
767 responder,
768 } = self
769 {
770 Some((annotations_to_set, annotations_to_delete, responder))
771 } else {
772 None
773 }
774 }
775
776 #[allow(irrefutable_let_patterns)]
777 pub fn into_get_annotations(self) -> Option<(AnnotationControllerGetAnnotationsResponder)> {
778 if let AnnotationControllerRequest::GetAnnotations { responder } = self {
779 Some((responder))
780 } else {
781 None
782 }
783 }
784
785 #[allow(irrefutable_let_patterns)]
786 pub fn into_watch_annotations(self) -> Option<(AnnotationControllerWatchAnnotationsResponder)> {
787 if let AnnotationControllerRequest::WatchAnnotations { responder } = self {
788 Some((responder))
789 } else {
790 None
791 }
792 }
793
794 pub fn method_name(&self) -> &'static str {
796 match *self {
797 AnnotationControllerRequest::UpdateAnnotations { .. } => "update_annotations",
798 AnnotationControllerRequest::GetAnnotations { .. } => "get_annotations",
799 AnnotationControllerRequest::WatchAnnotations { .. } => "watch_annotations",
800 }
801 }
802}
803
804#[derive(Debug, Clone)]
805pub struct AnnotationControllerControlHandle {
806 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
807}
808
809impl fidl::endpoints::ControlHandle for AnnotationControllerControlHandle {
810 fn shutdown(&self) {
811 self.inner.shutdown()
812 }
813 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
814 self.inner.shutdown_with_epitaph(status)
815 }
816
817 fn is_closed(&self) -> bool {
818 self.inner.channel().is_closed()
819 }
820 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
821 self.inner.channel().on_closed()
822 }
823
824 #[cfg(target_os = "fuchsia")]
825 fn signal_peer(
826 &self,
827 clear_mask: zx::Signals,
828 set_mask: zx::Signals,
829 ) -> Result<(), zx_status::Status> {
830 use fidl::Peered;
831 self.inner.channel().signal_peer(clear_mask, set_mask)
832 }
833}
834
835impl AnnotationControllerControlHandle {}
836
837#[must_use = "FIDL methods require a response to be sent"]
838#[derive(Debug)]
839pub struct AnnotationControllerUpdateAnnotationsResponder {
840 control_handle: std::mem::ManuallyDrop<AnnotationControllerControlHandle>,
841 tx_id: u32,
842}
843
844impl std::ops::Drop for AnnotationControllerUpdateAnnotationsResponder {
848 fn drop(&mut self) {
849 self.control_handle.shutdown();
850 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
852 }
853}
854
855impl fidl::endpoints::Responder for AnnotationControllerUpdateAnnotationsResponder {
856 type ControlHandle = AnnotationControllerControlHandle;
857
858 fn control_handle(&self) -> &AnnotationControllerControlHandle {
859 &self.control_handle
860 }
861
862 fn drop_without_shutdown(mut self) {
863 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
865 std::mem::forget(self);
867 }
868}
869
870impl AnnotationControllerUpdateAnnotationsResponder {
871 pub fn send(self, mut result: Result<(), UpdateAnnotationsError>) -> Result<(), fidl::Error> {
875 let _result = self.send_raw(result);
876 if _result.is_err() {
877 self.control_handle.shutdown();
878 }
879 self.drop_without_shutdown();
880 _result
881 }
882
883 pub fn send_no_shutdown_on_err(
885 self,
886 mut result: Result<(), UpdateAnnotationsError>,
887 ) -> Result<(), fidl::Error> {
888 let _result = self.send_raw(result);
889 self.drop_without_shutdown();
890 _result
891 }
892
893 fn send_raw(&self, mut result: Result<(), UpdateAnnotationsError>) -> Result<(), fidl::Error> {
894 self.control_handle.inner.send::<fidl::encoding::ResultType<
895 fidl::encoding::EmptyStruct,
896 UpdateAnnotationsError,
897 >>(
898 result,
899 self.tx_id,
900 0x5718e51a2774c686,
901 fidl::encoding::DynamicFlags::empty(),
902 )
903 }
904}
905
906#[must_use = "FIDL methods require a response to be sent"]
907#[derive(Debug)]
908pub struct AnnotationControllerGetAnnotationsResponder {
909 control_handle: std::mem::ManuallyDrop<AnnotationControllerControlHandle>,
910 tx_id: u32,
911}
912
913impl std::ops::Drop for AnnotationControllerGetAnnotationsResponder {
917 fn drop(&mut self) {
918 self.control_handle.shutdown();
919 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
921 }
922}
923
924impl fidl::endpoints::Responder for AnnotationControllerGetAnnotationsResponder {
925 type ControlHandle = AnnotationControllerControlHandle;
926
927 fn control_handle(&self) -> &AnnotationControllerControlHandle {
928 &self.control_handle
929 }
930
931 fn drop_without_shutdown(mut self) {
932 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
934 std::mem::forget(self);
936 }
937}
938
939impl AnnotationControllerGetAnnotationsResponder {
940 pub fn send(
944 self,
945 mut result: Result<Vec<Annotation>, GetAnnotationsError>,
946 ) -> Result<(), fidl::Error> {
947 let _result = self.send_raw(result);
948 if _result.is_err() {
949 self.control_handle.shutdown();
950 }
951 self.drop_without_shutdown();
952 _result
953 }
954
955 pub fn send_no_shutdown_on_err(
957 self,
958 mut result: Result<Vec<Annotation>, GetAnnotationsError>,
959 ) -> Result<(), fidl::Error> {
960 let _result = self.send_raw(result);
961 self.drop_without_shutdown();
962 _result
963 }
964
965 fn send_raw(
966 &self,
967 mut result: Result<Vec<Annotation>, GetAnnotationsError>,
968 ) -> Result<(), fidl::Error> {
969 self.control_handle.inner.send::<fidl::encoding::ResultType<
970 AnnotationControllerGetAnnotationsResponse,
971 GetAnnotationsError,
972 >>(
973 result.as_mut().map_err(|e| *e).map(|annotations| (annotations.as_mut_slice(),)),
974 self.tx_id,
975 0xae78b17381824fa,
976 fidl::encoding::DynamicFlags::empty(),
977 )
978 }
979}
980
981#[must_use = "FIDL methods require a response to be sent"]
982#[derive(Debug)]
983pub struct AnnotationControllerWatchAnnotationsResponder {
984 control_handle: std::mem::ManuallyDrop<AnnotationControllerControlHandle>,
985 tx_id: u32,
986}
987
988impl std::ops::Drop for AnnotationControllerWatchAnnotationsResponder {
992 fn drop(&mut self) {
993 self.control_handle.shutdown();
994 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
996 }
997}
998
999impl fidl::endpoints::Responder for AnnotationControllerWatchAnnotationsResponder {
1000 type ControlHandle = AnnotationControllerControlHandle;
1001
1002 fn control_handle(&self) -> &AnnotationControllerControlHandle {
1003 &self.control_handle
1004 }
1005
1006 fn drop_without_shutdown(mut self) {
1007 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1009 std::mem::forget(self);
1011 }
1012}
1013
1014impl AnnotationControllerWatchAnnotationsResponder {
1015 pub fn send(
1019 self,
1020 mut result: Result<Vec<Annotation>, WatchAnnotationsError>,
1021 ) -> Result<(), fidl::Error> {
1022 let _result = self.send_raw(result);
1023 if _result.is_err() {
1024 self.control_handle.shutdown();
1025 }
1026 self.drop_without_shutdown();
1027 _result
1028 }
1029
1030 pub fn send_no_shutdown_on_err(
1032 self,
1033 mut result: Result<Vec<Annotation>, WatchAnnotationsError>,
1034 ) -> Result<(), fidl::Error> {
1035 let _result = self.send_raw(result);
1036 self.drop_without_shutdown();
1037 _result
1038 }
1039
1040 fn send_raw(
1041 &self,
1042 mut result: Result<Vec<Annotation>, WatchAnnotationsError>,
1043 ) -> Result<(), fidl::Error> {
1044 self.control_handle.inner.send::<fidl::encoding::ResultType<
1045 AnnotationControllerWatchAnnotationsResponse,
1046 WatchAnnotationsError,
1047 >>(
1048 result.as_mut().map_err(|e| *e).map(|annotations| (annotations.as_mut_slice(),)),
1049 self.tx_id,
1050 0x253b196cae31356f,
1051 fidl::encoding::DynamicFlags::empty(),
1052 )
1053 }
1054}
1055
1056#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1057pub struct ControllerMarker;
1058
1059impl fidl::endpoints::ProtocolMarker for ControllerMarker {
1060 type Proxy = ControllerProxy;
1061 type RequestStream = ControllerRequestStream;
1062 #[cfg(target_os = "fuchsia")]
1063 type SynchronousProxy = ControllerSynchronousProxy;
1064
1065 const DEBUG_NAME: &'static str = "(anonymous) Controller";
1066}
1067
1068pub trait ControllerProxyInterface: Send + Sync {
1069 type UpdateAnnotationsResponseFut: std::future::Future<
1070 Output = Result<AnnotationControllerUpdateAnnotationsResult, fidl::Error>,
1071 > + Send;
1072 fn r#update_annotations(
1073 &self,
1074 annotations_to_set: Vec<Annotation>,
1075 annotations_to_delete: &[AnnotationKey],
1076 ) -> Self::UpdateAnnotationsResponseFut;
1077 type GetAnnotationsResponseFut: std::future::Future<Output = Result<AnnotationControllerGetAnnotationsResult, fidl::Error>>
1078 + Send;
1079 fn r#get_annotations(&self) -> Self::GetAnnotationsResponseFut;
1080 type WatchAnnotationsResponseFut: std::future::Future<
1081 Output = Result<AnnotationControllerWatchAnnotationsResult, fidl::Error>,
1082 > + Send;
1083 fn r#watch_annotations(&self) -> Self::WatchAnnotationsResponseFut;
1084}
1085#[derive(Debug)]
1086#[cfg(target_os = "fuchsia")]
1087pub struct ControllerSynchronousProxy {
1088 client: fidl::client::sync::Client,
1089}
1090
1091#[cfg(target_os = "fuchsia")]
1092impl fidl::endpoints::SynchronousProxy for ControllerSynchronousProxy {
1093 type Proxy = ControllerProxy;
1094 type Protocol = ControllerMarker;
1095
1096 fn from_channel(inner: fidl::Channel) -> Self {
1097 Self::new(inner)
1098 }
1099
1100 fn into_channel(self) -> fidl::Channel {
1101 self.client.into_channel()
1102 }
1103
1104 fn as_channel(&self) -> &fidl::Channel {
1105 self.client.as_channel()
1106 }
1107}
1108
1109#[cfg(target_os = "fuchsia")]
1110impl ControllerSynchronousProxy {
1111 pub fn new(channel: fidl::Channel) -> Self {
1112 let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1113 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1114 }
1115
1116 pub fn into_channel(self) -> fidl::Channel {
1117 self.client.into_channel()
1118 }
1119
1120 pub fn wait_for_event(
1123 &self,
1124 deadline: zx::MonotonicInstant,
1125 ) -> Result<ControllerEvent, fidl::Error> {
1126 ControllerEvent::decode(self.client.wait_for_event(deadline)?)
1127 }
1128
1129 pub fn r#update_annotations(
1153 &self,
1154 mut annotations_to_set: Vec<Annotation>,
1155 mut annotations_to_delete: &[AnnotationKey],
1156 ___deadline: zx::MonotonicInstant,
1157 ) -> Result<AnnotationControllerUpdateAnnotationsResult, fidl::Error> {
1158 let _response = self.client.send_query::<
1159 AnnotationControllerUpdateAnnotationsRequest,
1160 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, UpdateAnnotationsError>,
1161 >(
1162 (annotations_to_set.as_mut(), annotations_to_delete,),
1163 0x5718e51a2774c686,
1164 fidl::encoding::DynamicFlags::empty(),
1165 ___deadline,
1166 )?;
1167 Ok(_response.map(|x| x))
1168 }
1169
1170 pub fn r#get_annotations(
1174 &self,
1175 ___deadline: zx::MonotonicInstant,
1176 ) -> Result<AnnotationControllerGetAnnotationsResult, fidl::Error> {
1177 let _response = self
1178 .client
1179 .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1180 AnnotationControllerGetAnnotationsResponse,
1181 GetAnnotationsError,
1182 >>(
1183 (), 0xae78b17381824fa, fidl::encoding::DynamicFlags::empty(), ___deadline
1184 )?;
1185 Ok(_response.map(|x| x.annotations))
1186 }
1187
1188 pub fn r#watch_annotations(
1198 &self,
1199 ___deadline: zx::MonotonicInstant,
1200 ) -> Result<AnnotationControllerWatchAnnotationsResult, fidl::Error> {
1201 let _response = self
1202 .client
1203 .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
1204 AnnotationControllerWatchAnnotationsResponse,
1205 WatchAnnotationsError,
1206 >>(
1207 (), 0x253b196cae31356f, fidl::encoding::DynamicFlags::empty(), ___deadline
1208 )?;
1209 Ok(_response.map(|x| x.annotations))
1210 }
1211}
1212
1213#[cfg(target_os = "fuchsia")]
1214impl From<ControllerSynchronousProxy> for zx::Handle {
1215 fn from(value: ControllerSynchronousProxy) -> Self {
1216 value.into_channel().into()
1217 }
1218}
1219
1220#[cfg(target_os = "fuchsia")]
1221impl From<fidl::Channel> for ControllerSynchronousProxy {
1222 fn from(value: fidl::Channel) -> Self {
1223 Self::new(value)
1224 }
1225}
1226
1227#[cfg(target_os = "fuchsia")]
1228impl fidl::endpoints::FromClient for ControllerSynchronousProxy {
1229 type Protocol = ControllerMarker;
1230
1231 fn from_client(value: fidl::endpoints::ClientEnd<ControllerMarker>) -> Self {
1232 Self::new(value.into_channel())
1233 }
1234}
1235
1236#[derive(Debug, Clone)]
1237pub struct ControllerProxy {
1238 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1239}
1240
1241impl fidl::endpoints::Proxy for ControllerProxy {
1242 type Protocol = ControllerMarker;
1243
1244 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1245 Self::new(inner)
1246 }
1247
1248 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1249 self.client.into_channel().map_err(|client| Self { client })
1250 }
1251
1252 fn as_channel(&self) -> &::fidl::AsyncChannel {
1253 self.client.as_channel()
1254 }
1255}
1256
1257impl ControllerProxy {
1258 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1260 let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1261 Self { client: fidl::client::Client::new(channel, protocol_name) }
1262 }
1263
1264 pub fn take_event_stream(&self) -> ControllerEventStream {
1270 ControllerEventStream { event_receiver: self.client.take_event_receiver() }
1271 }
1272
1273 pub fn r#update_annotations(
1297 &self,
1298 mut annotations_to_set: Vec<Annotation>,
1299 mut annotations_to_delete: &[AnnotationKey],
1300 ) -> fidl::client::QueryResponseFut<
1301 AnnotationControllerUpdateAnnotationsResult,
1302 fidl::encoding::DefaultFuchsiaResourceDialect,
1303 > {
1304 ControllerProxyInterface::r#update_annotations(
1305 self,
1306 annotations_to_set,
1307 annotations_to_delete,
1308 )
1309 }
1310
1311 pub fn r#get_annotations(
1315 &self,
1316 ) -> fidl::client::QueryResponseFut<
1317 AnnotationControllerGetAnnotationsResult,
1318 fidl::encoding::DefaultFuchsiaResourceDialect,
1319 > {
1320 ControllerProxyInterface::r#get_annotations(self)
1321 }
1322
1323 pub fn r#watch_annotations(
1333 &self,
1334 ) -> fidl::client::QueryResponseFut<
1335 AnnotationControllerWatchAnnotationsResult,
1336 fidl::encoding::DefaultFuchsiaResourceDialect,
1337 > {
1338 ControllerProxyInterface::r#watch_annotations(self)
1339 }
1340}
1341
1342impl ControllerProxyInterface for ControllerProxy {
1343 type UpdateAnnotationsResponseFut = fidl::client::QueryResponseFut<
1344 AnnotationControllerUpdateAnnotationsResult,
1345 fidl::encoding::DefaultFuchsiaResourceDialect,
1346 >;
1347 fn r#update_annotations(
1348 &self,
1349 mut annotations_to_set: Vec<Annotation>,
1350 mut annotations_to_delete: &[AnnotationKey],
1351 ) -> Self::UpdateAnnotationsResponseFut {
1352 fn _decode(
1353 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1354 ) -> Result<AnnotationControllerUpdateAnnotationsResult, fidl::Error> {
1355 let _response = fidl::client::decode_transaction_body::<
1356 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, UpdateAnnotationsError>,
1357 fidl::encoding::DefaultFuchsiaResourceDialect,
1358 0x5718e51a2774c686,
1359 >(_buf?)?;
1360 Ok(_response.map(|x| x))
1361 }
1362 self.client.send_query_and_decode::<
1363 AnnotationControllerUpdateAnnotationsRequest,
1364 AnnotationControllerUpdateAnnotationsResult,
1365 >(
1366 (annotations_to_set.as_mut(), annotations_to_delete,),
1367 0x5718e51a2774c686,
1368 fidl::encoding::DynamicFlags::empty(),
1369 _decode,
1370 )
1371 }
1372
1373 type GetAnnotationsResponseFut = fidl::client::QueryResponseFut<
1374 AnnotationControllerGetAnnotationsResult,
1375 fidl::encoding::DefaultFuchsiaResourceDialect,
1376 >;
1377 fn r#get_annotations(&self) -> Self::GetAnnotationsResponseFut {
1378 fn _decode(
1379 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1380 ) -> Result<AnnotationControllerGetAnnotationsResult, fidl::Error> {
1381 let _response = fidl::client::decode_transaction_body::<
1382 fidl::encoding::ResultType<
1383 AnnotationControllerGetAnnotationsResponse,
1384 GetAnnotationsError,
1385 >,
1386 fidl::encoding::DefaultFuchsiaResourceDialect,
1387 0xae78b17381824fa,
1388 >(_buf?)?;
1389 Ok(_response.map(|x| x.annotations))
1390 }
1391 self.client.send_query_and_decode::<
1392 fidl::encoding::EmptyPayload,
1393 AnnotationControllerGetAnnotationsResult,
1394 >(
1395 (),
1396 0xae78b17381824fa,
1397 fidl::encoding::DynamicFlags::empty(),
1398 _decode,
1399 )
1400 }
1401
1402 type WatchAnnotationsResponseFut = fidl::client::QueryResponseFut<
1403 AnnotationControllerWatchAnnotationsResult,
1404 fidl::encoding::DefaultFuchsiaResourceDialect,
1405 >;
1406 fn r#watch_annotations(&self) -> Self::WatchAnnotationsResponseFut {
1407 fn _decode(
1408 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1409 ) -> Result<AnnotationControllerWatchAnnotationsResult, fidl::Error> {
1410 let _response = fidl::client::decode_transaction_body::<
1411 fidl::encoding::ResultType<
1412 AnnotationControllerWatchAnnotationsResponse,
1413 WatchAnnotationsError,
1414 >,
1415 fidl::encoding::DefaultFuchsiaResourceDialect,
1416 0x253b196cae31356f,
1417 >(_buf?)?;
1418 Ok(_response.map(|x| x.annotations))
1419 }
1420 self.client.send_query_and_decode::<
1421 fidl::encoding::EmptyPayload,
1422 AnnotationControllerWatchAnnotationsResult,
1423 >(
1424 (),
1425 0x253b196cae31356f,
1426 fidl::encoding::DynamicFlags::empty(),
1427 _decode,
1428 )
1429 }
1430}
1431
1432pub struct ControllerEventStream {
1433 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1434}
1435
1436impl std::marker::Unpin for ControllerEventStream {}
1437
1438impl futures::stream::FusedStream for ControllerEventStream {
1439 fn is_terminated(&self) -> bool {
1440 self.event_receiver.is_terminated()
1441 }
1442}
1443
1444impl futures::Stream for ControllerEventStream {
1445 type Item = Result<ControllerEvent, fidl::Error>;
1446
1447 fn poll_next(
1448 mut self: std::pin::Pin<&mut Self>,
1449 cx: &mut std::task::Context<'_>,
1450 ) -> std::task::Poll<Option<Self::Item>> {
1451 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1452 &mut self.event_receiver,
1453 cx
1454 )?) {
1455 Some(buf) => std::task::Poll::Ready(Some(ControllerEvent::decode(buf))),
1456 None => std::task::Poll::Ready(None),
1457 }
1458 }
1459}
1460
1461#[derive(Debug)]
1462pub enum ControllerEvent {}
1463
1464impl ControllerEvent {
1465 fn decode(
1467 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1468 ) -> Result<ControllerEvent, fidl::Error> {
1469 let (bytes, _handles) = buf.split_mut();
1470 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1471 debug_assert_eq!(tx_header.tx_id, 0);
1472 match tx_header.ordinal {
1473 _ => Err(fidl::Error::UnknownOrdinal {
1474 ordinal: tx_header.ordinal,
1475 protocol_name: <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1476 }),
1477 }
1478 }
1479}
1480
1481pub struct ControllerRequestStream {
1483 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1484 is_terminated: bool,
1485}
1486
1487impl std::marker::Unpin for ControllerRequestStream {}
1488
1489impl futures::stream::FusedStream for ControllerRequestStream {
1490 fn is_terminated(&self) -> bool {
1491 self.is_terminated
1492 }
1493}
1494
1495impl fidl::endpoints::RequestStream for ControllerRequestStream {
1496 type Protocol = ControllerMarker;
1497 type ControlHandle = ControllerControlHandle;
1498
1499 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1500 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1501 }
1502
1503 fn control_handle(&self) -> Self::ControlHandle {
1504 ControllerControlHandle { inner: self.inner.clone() }
1505 }
1506
1507 fn into_inner(
1508 self,
1509 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1510 {
1511 (self.inner, self.is_terminated)
1512 }
1513
1514 fn from_inner(
1515 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1516 is_terminated: bool,
1517 ) -> Self {
1518 Self { inner, is_terminated }
1519 }
1520}
1521
1522impl futures::Stream for ControllerRequestStream {
1523 type Item = Result<ControllerRequest, fidl::Error>;
1524
1525 fn poll_next(
1526 mut self: std::pin::Pin<&mut Self>,
1527 cx: &mut std::task::Context<'_>,
1528 ) -> std::task::Poll<Option<Self::Item>> {
1529 let this = &mut *self;
1530 if this.inner.check_shutdown(cx) {
1531 this.is_terminated = true;
1532 return std::task::Poll::Ready(None);
1533 }
1534 if this.is_terminated {
1535 panic!("polled ControllerRequestStream after completion");
1536 }
1537 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1538 |bytes, handles| {
1539 match this.inner.channel().read_etc(cx, bytes, handles) {
1540 std::task::Poll::Ready(Ok(())) => {}
1541 std::task::Poll::Pending => return std::task::Poll::Pending,
1542 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1543 this.is_terminated = true;
1544 return std::task::Poll::Ready(None);
1545 }
1546 std::task::Poll::Ready(Err(e)) => {
1547 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1548 e.into(),
1549 ))));
1550 }
1551 }
1552
1553 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1555
1556 std::task::Poll::Ready(Some(match header.ordinal {
1557 0x5718e51a2774c686 => {
1558 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1559 let mut req = fidl::new_empty!(
1560 AnnotationControllerUpdateAnnotationsRequest,
1561 fidl::encoding::DefaultFuchsiaResourceDialect
1562 );
1563 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AnnotationControllerUpdateAnnotationsRequest>(&header, _body_bytes, handles, &mut req)?;
1564 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1565 Ok(ControllerRequest::UpdateAnnotations {
1566 annotations_to_set: req.annotations_to_set,
1567 annotations_to_delete: req.annotations_to_delete,
1568
1569 responder: ControllerUpdateAnnotationsResponder {
1570 control_handle: std::mem::ManuallyDrop::new(control_handle),
1571 tx_id: header.tx_id,
1572 },
1573 })
1574 }
1575 0xae78b17381824fa => {
1576 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1577 let mut req = fidl::new_empty!(
1578 fidl::encoding::EmptyPayload,
1579 fidl::encoding::DefaultFuchsiaResourceDialect
1580 );
1581 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1582 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1583 Ok(ControllerRequest::GetAnnotations {
1584 responder: ControllerGetAnnotationsResponder {
1585 control_handle: std::mem::ManuallyDrop::new(control_handle),
1586 tx_id: header.tx_id,
1587 },
1588 })
1589 }
1590 0x253b196cae31356f => {
1591 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1592 let mut req = fidl::new_empty!(
1593 fidl::encoding::EmptyPayload,
1594 fidl::encoding::DefaultFuchsiaResourceDialect
1595 );
1596 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
1597 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
1598 Ok(ControllerRequest::WatchAnnotations {
1599 responder: ControllerWatchAnnotationsResponder {
1600 control_handle: std::mem::ManuallyDrop::new(control_handle),
1601 tx_id: header.tx_id,
1602 },
1603 })
1604 }
1605 _ => Err(fidl::Error::UnknownOrdinal {
1606 ordinal: header.ordinal,
1607 protocol_name:
1608 <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1609 }),
1610 }))
1611 },
1612 )
1613 }
1614}
1615
1616#[derive(Debug)]
1626pub enum ControllerRequest {
1627 UpdateAnnotations {
1651 annotations_to_set: Vec<Annotation>,
1652 annotations_to_delete: Vec<AnnotationKey>,
1653 responder: ControllerUpdateAnnotationsResponder,
1654 },
1655 GetAnnotations { responder: ControllerGetAnnotationsResponder },
1659 WatchAnnotations { responder: ControllerWatchAnnotationsResponder },
1669}
1670
1671impl ControllerRequest {
1672 #[allow(irrefutable_let_patterns)]
1673 pub fn into_update_annotations(
1674 self,
1675 ) -> Option<(Vec<Annotation>, Vec<AnnotationKey>, ControllerUpdateAnnotationsResponder)> {
1676 if let ControllerRequest::UpdateAnnotations {
1677 annotations_to_set,
1678 annotations_to_delete,
1679 responder,
1680 } = self
1681 {
1682 Some((annotations_to_set, annotations_to_delete, responder))
1683 } else {
1684 None
1685 }
1686 }
1687
1688 #[allow(irrefutable_let_patterns)]
1689 pub fn into_get_annotations(self) -> Option<(ControllerGetAnnotationsResponder)> {
1690 if let ControllerRequest::GetAnnotations { responder } = self {
1691 Some((responder))
1692 } else {
1693 None
1694 }
1695 }
1696
1697 #[allow(irrefutable_let_patterns)]
1698 pub fn into_watch_annotations(self) -> Option<(ControllerWatchAnnotationsResponder)> {
1699 if let ControllerRequest::WatchAnnotations { responder } = self {
1700 Some((responder))
1701 } else {
1702 None
1703 }
1704 }
1705
1706 pub fn method_name(&self) -> &'static str {
1708 match *self {
1709 ControllerRequest::UpdateAnnotations { .. } => "update_annotations",
1710 ControllerRequest::GetAnnotations { .. } => "get_annotations",
1711 ControllerRequest::WatchAnnotations { .. } => "watch_annotations",
1712 }
1713 }
1714}
1715
1716#[derive(Debug, Clone)]
1717pub struct ControllerControlHandle {
1718 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1719}
1720
1721impl fidl::endpoints::ControlHandle for ControllerControlHandle {
1722 fn shutdown(&self) {
1723 self.inner.shutdown()
1724 }
1725 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1726 self.inner.shutdown_with_epitaph(status)
1727 }
1728
1729 fn is_closed(&self) -> bool {
1730 self.inner.channel().is_closed()
1731 }
1732 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1733 self.inner.channel().on_closed()
1734 }
1735
1736 #[cfg(target_os = "fuchsia")]
1737 fn signal_peer(
1738 &self,
1739 clear_mask: zx::Signals,
1740 set_mask: zx::Signals,
1741 ) -> Result<(), zx_status::Status> {
1742 use fidl::Peered;
1743 self.inner.channel().signal_peer(clear_mask, set_mask)
1744 }
1745}
1746
1747impl ControllerControlHandle {}
1748
1749#[must_use = "FIDL methods require a response to be sent"]
1750#[derive(Debug)]
1751pub struct ControllerUpdateAnnotationsResponder {
1752 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1753 tx_id: u32,
1754}
1755
1756impl std::ops::Drop for ControllerUpdateAnnotationsResponder {
1760 fn drop(&mut self) {
1761 self.control_handle.shutdown();
1762 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1764 }
1765}
1766
1767impl fidl::endpoints::Responder for ControllerUpdateAnnotationsResponder {
1768 type ControlHandle = ControllerControlHandle;
1769
1770 fn control_handle(&self) -> &ControllerControlHandle {
1771 &self.control_handle
1772 }
1773
1774 fn drop_without_shutdown(mut self) {
1775 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1777 std::mem::forget(self);
1779 }
1780}
1781
1782impl ControllerUpdateAnnotationsResponder {
1783 pub fn send(self, mut result: Result<(), UpdateAnnotationsError>) -> Result<(), fidl::Error> {
1787 let _result = self.send_raw(result);
1788 if _result.is_err() {
1789 self.control_handle.shutdown();
1790 }
1791 self.drop_without_shutdown();
1792 _result
1793 }
1794
1795 pub fn send_no_shutdown_on_err(
1797 self,
1798 mut result: Result<(), UpdateAnnotationsError>,
1799 ) -> Result<(), fidl::Error> {
1800 let _result = self.send_raw(result);
1801 self.drop_without_shutdown();
1802 _result
1803 }
1804
1805 fn send_raw(&self, mut result: Result<(), UpdateAnnotationsError>) -> Result<(), fidl::Error> {
1806 self.control_handle.inner.send::<fidl::encoding::ResultType<
1807 fidl::encoding::EmptyStruct,
1808 UpdateAnnotationsError,
1809 >>(
1810 result,
1811 self.tx_id,
1812 0x5718e51a2774c686,
1813 fidl::encoding::DynamicFlags::empty(),
1814 )
1815 }
1816}
1817
1818#[must_use = "FIDL methods require a response to be sent"]
1819#[derive(Debug)]
1820pub struct ControllerGetAnnotationsResponder {
1821 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1822 tx_id: u32,
1823}
1824
1825impl std::ops::Drop for ControllerGetAnnotationsResponder {
1829 fn drop(&mut self) {
1830 self.control_handle.shutdown();
1831 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1833 }
1834}
1835
1836impl fidl::endpoints::Responder for ControllerGetAnnotationsResponder {
1837 type ControlHandle = ControllerControlHandle;
1838
1839 fn control_handle(&self) -> &ControllerControlHandle {
1840 &self.control_handle
1841 }
1842
1843 fn drop_without_shutdown(mut self) {
1844 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1846 std::mem::forget(self);
1848 }
1849}
1850
1851impl ControllerGetAnnotationsResponder {
1852 pub fn send(
1856 self,
1857 mut result: Result<Vec<Annotation>, GetAnnotationsError>,
1858 ) -> Result<(), fidl::Error> {
1859 let _result = self.send_raw(result);
1860 if _result.is_err() {
1861 self.control_handle.shutdown();
1862 }
1863 self.drop_without_shutdown();
1864 _result
1865 }
1866
1867 pub fn send_no_shutdown_on_err(
1869 self,
1870 mut result: Result<Vec<Annotation>, GetAnnotationsError>,
1871 ) -> Result<(), fidl::Error> {
1872 let _result = self.send_raw(result);
1873 self.drop_without_shutdown();
1874 _result
1875 }
1876
1877 fn send_raw(
1878 &self,
1879 mut result: Result<Vec<Annotation>, GetAnnotationsError>,
1880 ) -> Result<(), fidl::Error> {
1881 self.control_handle.inner.send::<fidl::encoding::ResultType<
1882 AnnotationControllerGetAnnotationsResponse,
1883 GetAnnotationsError,
1884 >>(
1885 result.as_mut().map_err(|e| *e).map(|annotations| (annotations.as_mut_slice(),)),
1886 self.tx_id,
1887 0xae78b17381824fa,
1888 fidl::encoding::DynamicFlags::empty(),
1889 )
1890 }
1891}
1892
1893#[must_use = "FIDL methods require a response to be sent"]
1894#[derive(Debug)]
1895pub struct ControllerWatchAnnotationsResponder {
1896 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
1897 tx_id: u32,
1898}
1899
1900impl std::ops::Drop for ControllerWatchAnnotationsResponder {
1904 fn drop(&mut self) {
1905 self.control_handle.shutdown();
1906 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1908 }
1909}
1910
1911impl fidl::endpoints::Responder for ControllerWatchAnnotationsResponder {
1912 type ControlHandle = ControllerControlHandle;
1913
1914 fn control_handle(&self) -> &ControllerControlHandle {
1915 &self.control_handle
1916 }
1917
1918 fn drop_without_shutdown(mut self) {
1919 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1921 std::mem::forget(self);
1923 }
1924}
1925
1926impl ControllerWatchAnnotationsResponder {
1927 pub fn send(
1931 self,
1932 mut result: Result<Vec<Annotation>, WatchAnnotationsError>,
1933 ) -> Result<(), fidl::Error> {
1934 let _result = self.send_raw(result);
1935 if _result.is_err() {
1936 self.control_handle.shutdown();
1937 }
1938 self.drop_without_shutdown();
1939 _result
1940 }
1941
1942 pub fn send_no_shutdown_on_err(
1944 self,
1945 mut result: Result<Vec<Annotation>, WatchAnnotationsError>,
1946 ) -> Result<(), fidl::Error> {
1947 let _result = self.send_raw(result);
1948 self.drop_without_shutdown();
1949 _result
1950 }
1951
1952 fn send_raw(
1953 &self,
1954 mut result: Result<Vec<Annotation>, WatchAnnotationsError>,
1955 ) -> Result<(), fidl::Error> {
1956 self.control_handle.inner.send::<fidl::encoding::ResultType<
1957 AnnotationControllerWatchAnnotationsResponse,
1958 WatchAnnotationsError,
1959 >>(
1960 result.as_mut().map_err(|e| *e).map(|annotations| (annotations.as_mut_slice(),)),
1961 self.tx_id,
1962 0x253b196cae31356f,
1963 fidl::encoding::DynamicFlags::empty(),
1964 )
1965 }
1966}
1967
1968#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1969pub struct GraphicalPresenterMarker;
1970
1971impl fidl::endpoints::ProtocolMarker for GraphicalPresenterMarker {
1972 type Proxy = GraphicalPresenterProxy;
1973 type RequestStream = GraphicalPresenterRequestStream;
1974 #[cfg(target_os = "fuchsia")]
1975 type SynchronousProxy = GraphicalPresenterSynchronousProxy;
1976
1977 const DEBUG_NAME: &'static str = "fuchsia.element.GraphicalPresenter";
1978}
1979impl fidl::endpoints::DiscoverableProtocolMarker for GraphicalPresenterMarker {}
1980pub type GraphicalPresenterPresentViewResult = Result<(), PresentViewError>;
1981
1982pub trait GraphicalPresenterProxyInterface: Send + Sync {
1983 type PresentViewResponseFut: std::future::Future<Output = Result<GraphicalPresenterPresentViewResult, fidl::Error>>
1984 + Send;
1985 fn r#present_view(
1986 &self,
1987 view_spec: ViewSpec,
1988 annotation_controller: Option<fidl::endpoints::ClientEnd<AnnotationControllerMarker>>,
1989 view_controller_request: Option<fidl::endpoints::ServerEnd<ViewControllerMarker>>,
1990 ) -> Self::PresentViewResponseFut;
1991}
1992#[derive(Debug)]
1993#[cfg(target_os = "fuchsia")]
1994pub struct GraphicalPresenterSynchronousProxy {
1995 client: fidl::client::sync::Client,
1996}
1997
1998#[cfg(target_os = "fuchsia")]
1999impl fidl::endpoints::SynchronousProxy for GraphicalPresenterSynchronousProxy {
2000 type Proxy = GraphicalPresenterProxy;
2001 type Protocol = GraphicalPresenterMarker;
2002
2003 fn from_channel(inner: fidl::Channel) -> Self {
2004 Self::new(inner)
2005 }
2006
2007 fn into_channel(self) -> fidl::Channel {
2008 self.client.into_channel()
2009 }
2010
2011 fn as_channel(&self) -> &fidl::Channel {
2012 self.client.as_channel()
2013 }
2014}
2015
2016#[cfg(target_os = "fuchsia")]
2017impl GraphicalPresenterSynchronousProxy {
2018 pub fn new(channel: fidl::Channel) -> Self {
2019 let protocol_name =
2020 <GraphicalPresenterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2021 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2022 }
2023
2024 pub fn into_channel(self) -> fidl::Channel {
2025 self.client.into_channel()
2026 }
2027
2028 pub fn wait_for_event(
2031 &self,
2032 deadline: zx::MonotonicInstant,
2033 ) -> Result<GraphicalPresenterEvent, fidl::Error> {
2034 GraphicalPresenterEvent::decode(self.client.wait_for_event(deadline)?)
2035 }
2036
2037 pub fn r#present_view(
2057 &self,
2058 mut view_spec: ViewSpec,
2059 mut annotation_controller: Option<fidl::endpoints::ClientEnd<AnnotationControllerMarker>>,
2060 mut view_controller_request: Option<fidl::endpoints::ServerEnd<ViewControllerMarker>>,
2061 ___deadline: zx::MonotonicInstant,
2062 ) -> Result<GraphicalPresenterPresentViewResult, fidl::Error> {
2063 let _response = self.client.send_query::<
2064 GraphicalPresenterPresentViewRequest,
2065 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, PresentViewError>,
2066 >(
2067 (&mut view_spec, annotation_controller, view_controller_request,),
2068 0x396042dd1422ac7a,
2069 fidl::encoding::DynamicFlags::empty(),
2070 ___deadline,
2071 )?;
2072 Ok(_response.map(|x| x))
2073 }
2074}
2075
2076#[cfg(target_os = "fuchsia")]
2077impl From<GraphicalPresenterSynchronousProxy> for zx::Handle {
2078 fn from(value: GraphicalPresenterSynchronousProxy) -> Self {
2079 value.into_channel().into()
2080 }
2081}
2082
2083#[cfg(target_os = "fuchsia")]
2084impl From<fidl::Channel> for GraphicalPresenterSynchronousProxy {
2085 fn from(value: fidl::Channel) -> Self {
2086 Self::new(value)
2087 }
2088}
2089
2090#[cfg(target_os = "fuchsia")]
2091impl fidl::endpoints::FromClient for GraphicalPresenterSynchronousProxy {
2092 type Protocol = GraphicalPresenterMarker;
2093
2094 fn from_client(value: fidl::endpoints::ClientEnd<GraphicalPresenterMarker>) -> Self {
2095 Self::new(value.into_channel())
2096 }
2097}
2098
2099#[derive(Debug, Clone)]
2100pub struct GraphicalPresenterProxy {
2101 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2102}
2103
2104impl fidl::endpoints::Proxy for GraphicalPresenterProxy {
2105 type Protocol = GraphicalPresenterMarker;
2106
2107 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2108 Self::new(inner)
2109 }
2110
2111 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2112 self.client.into_channel().map_err(|client| Self { client })
2113 }
2114
2115 fn as_channel(&self) -> &::fidl::AsyncChannel {
2116 self.client.as_channel()
2117 }
2118}
2119
2120impl GraphicalPresenterProxy {
2121 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2123 let protocol_name =
2124 <GraphicalPresenterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2125 Self { client: fidl::client::Client::new(channel, protocol_name) }
2126 }
2127
2128 pub fn take_event_stream(&self) -> GraphicalPresenterEventStream {
2134 GraphicalPresenterEventStream { event_receiver: self.client.take_event_receiver() }
2135 }
2136
2137 pub fn r#present_view(
2157 &self,
2158 mut view_spec: ViewSpec,
2159 mut annotation_controller: Option<fidl::endpoints::ClientEnd<AnnotationControllerMarker>>,
2160 mut view_controller_request: Option<fidl::endpoints::ServerEnd<ViewControllerMarker>>,
2161 ) -> fidl::client::QueryResponseFut<
2162 GraphicalPresenterPresentViewResult,
2163 fidl::encoding::DefaultFuchsiaResourceDialect,
2164 > {
2165 GraphicalPresenterProxyInterface::r#present_view(
2166 self,
2167 view_spec,
2168 annotation_controller,
2169 view_controller_request,
2170 )
2171 }
2172}
2173
2174impl GraphicalPresenterProxyInterface for GraphicalPresenterProxy {
2175 type PresentViewResponseFut = fidl::client::QueryResponseFut<
2176 GraphicalPresenterPresentViewResult,
2177 fidl::encoding::DefaultFuchsiaResourceDialect,
2178 >;
2179 fn r#present_view(
2180 &self,
2181 mut view_spec: ViewSpec,
2182 mut annotation_controller: Option<fidl::endpoints::ClientEnd<AnnotationControllerMarker>>,
2183 mut view_controller_request: Option<fidl::endpoints::ServerEnd<ViewControllerMarker>>,
2184 ) -> Self::PresentViewResponseFut {
2185 fn _decode(
2186 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2187 ) -> Result<GraphicalPresenterPresentViewResult, fidl::Error> {
2188 let _response = fidl::client::decode_transaction_body::<
2189 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, PresentViewError>,
2190 fidl::encoding::DefaultFuchsiaResourceDialect,
2191 0x396042dd1422ac7a,
2192 >(_buf?)?;
2193 Ok(_response.map(|x| x))
2194 }
2195 self.client.send_query_and_decode::<
2196 GraphicalPresenterPresentViewRequest,
2197 GraphicalPresenterPresentViewResult,
2198 >(
2199 (&mut view_spec, annotation_controller, view_controller_request,),
2200 0x396042dd1422ac7a,
2201 fidl::encoding::DynamicFlags::empty(),
2202 _decode,
2203 )
2204 }
2205}
2206
2207pub struct GraphicalPresenterEventStream {
2208 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2209}
2210
2211impl std::marker::Unpin for GraphicalPresenterEventStream {}
2212
2213impl futures::stream::FusedStream for GraphicalPresenterEventStream {
2214 fn is_terminated(&self) -> bool {
2215 self.event_receiver.is_terminated()
2216 }
2217}
2218
2219impl futures::Stream for GraphicalPresenterEventStream {
2220 type Item = Result<GraphicalPresenterEvent, fidl::Error>;
2221
2222 fn poll_next(
2223 mut self: std::pin::Pin<&mut Self>,
2224 cx: &mut std::task::Context<'_>,
2225 ) -> std::task::Poll<Option<Self::Item>> {
2226 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2227 &mut self.event_receiver,
2228 cx
2229 )?) {
2230 Some(buf) => std::task::Poll::Ready(Some(GraphicalPresenterEvent::decode(buf))),
2231 None => std::task::Poll::Ready(None),
2232 }
2233 }
2234}
2235
2236#[derive(Debug)]
2237pub enum GraphicalPresenterEvent {}
2238
2239impl GraphicalPresenterEvent {
2240 fn decode(
2242 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2243 ) -> Result<GraphicalPresenterEvent, fidl::Error> {
2244 let (bytes, _handles) = buf.split_mut();
2245 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2246 debug_assert_eq!(tx_header.tx_id, 0);
2247 match tx_header.ordinal {
2248 _ => Err(fidl::Error::UnknownOrdinal {
2249 ordinal: tx_header.ordinal,
2250 protocol_name:
2251 <GraphicalPresenterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2252 }),
2253 }
2254 }
2255}
2256
2257pub struct GraphicalPresenterRequestStream {
2259 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2260 is_terminated: bool,
2261}
2262
2263impl std::marker::Unpin for GraphicalPresenterRequestStream {}
2264
2265impl futures::stream::FusedStream for GraphicalPresenterRequestStream {
2266 fn is_terminated(&self) -> bool {
2267 self.is_terminated
2268 }
2269}
2270
2271impl fidl::endpoints::RequestStream for GraphicalPresenterRequestStream {
2272 type Protocol = GraphicalPresenterMarker;
2273 type ControlHandle = GraphicalPresenterControlHandle;
2274
2275 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2276 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2277 }
2278
2279 fn control_handle(&self) -> Self::ControlHandle {
2280 GraphicalPresenterControlHandle { inner: self.inner.clone() }
2281 }
2282
2283 fn into_inner(
2284 self,
2285 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2286 {
2287 (self.inner, self.is_terminated)
2288 }
2289
2290 fn from_inner(
2291 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2292 is_terminated: bool,
2293 ) -> Self {
2294 Self { inner, is_terminated }
2295 }
2296}
2297
2298impl futures::Stream for GraphicalPresenterRequestStream {
2299 type Item = Result<GraphicalPresenterRequest, fidl::Error>;
2300
2301 fn poll_next(
2302 mut self: std::pin::Pin<&mut Self>,
2303 cx: &mut std::task::Context<'_>,
2304 ) -> std::task::Poll<Option<Self::Item>> {
2305 let this = &mut *self;
2306 if this.inner.check_shutdown(cx) {
2307 this.is_terminated = true;
2308 return std::task::Poll::Ready(None);
2309 }
2310 if this.is_terminated {
2311 panic!("polled GraphicalPresenterRequestStream after completion");
2312 }
2313 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2314 |bytes, handles| {
2315 match this.inner.channel().read_etc(cx, bytes, handles) {
2316 std::task::Poll::Ready(Ok(())) => {}
2317 std::task::Poll::Pending => return std::task::Poll::Pending,
2318 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2319 this.is_terminated = true;
2320 return std::task::Poll::Ready(None);
2321 }
2322 std::task::Poll::Ready(Err(e)) => {
2323 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2324 e.into(),
2325 ))));
2326 }
2327 }
2328
2329 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2331
2332 std::task::Poll::Ready(Some(match header.ordinal {
2333 0x396042dd1422ac7a => {
2334 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2335 let mut req = fidl::new_empty!(GraphicalPresenterPresentViewRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2336 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GraphicalPresenterPresentViewRequest>(&header, _body_bytes, handles, &mut req)?;
2337 let control_handle = GraphicalPresenterControlHandle {
2338 inner: this.inner.clone(),
2339 };
2340 Ok(GraphicalPresenterRequest::PresentView {view_spec: req.view_spec,
2341annotation_controller: req.annotation_controller,
2342view_controller_request: req.view_controller_request,
2343
2344 responder: GraphicalPresenterPresentViewResponder {
2345 control_handle: std::mem::ManuallyDrop::new(control_handle),
2346 tx_id: header.tx_id,
2347 },
2348 })
2349 }
2350 _ => Err(fidl::Error::UnknownOrdinal {
2351 ordinal: header.ordinal,
2352 protocol_name: <GraphicalPresenterMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2353 }),
2354 }))
2355 },
2356 )
2357 }
2358}
2359
2360#[derive(Debug)]
2363pub enum GraphicalPresenterRequest {
2364 PresentView {
2384 view_spec: ViewSpec,
2385 annotation_controller: Option<fidl::endpoints::ClientEnd<AnnotationControllerMarker>>,
2386 view_controller_request: Option<fidl::endpoints::ServerEnd<ViewControllerMarker>>,
2387 responder: GraphicalPresenterPresentViewResponder,
2388 },
2389}
2390
2391impl GraphicalPresenterRequest {
2392 #[allow(irrefutable_let_patterns)]
2393 pub fn into_present_view(
2394 self,
2395 ) -> Option<(
2396 ViewSpec,
2397 Option<fidl::endpoints::ClientEnd<AnnotationControllerMarker>>,
2398 Option<fidl::endpoints::ServerEnd<ViewControllerMarker>>,
2399 GraphicalPresenterPresentViewResponder,
2400 )> {
2401 if let GraphicalPresenterRequest::PresentView {
2402 view_spec,
2403 annotation_controller,
2404 view_controller_request,
2405 responder,
2406 } = self
2407 {
2408 Some((view_spec, annotation_controller, view_controller_request, responder))
2409 } else {
2410 None
2411 }
2412 }
2413
2414 pub fn method_name(&self) -> &'static str {
2416 match *self {
2417 GraphicalPresenterRequest::PresentView { .. } => "present_view",
2418 }
2419 }
2420}
2421
2422#[derive(Debug, Clone)]
2423pub struct GraphicalPresenterControlHandle {
2424 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2425}
2426
2427impl fidl::endpoints::ControlHandle for GraphicalPresenterControlHandle {
2428 fn shutdown(&self) {
2429 self.inner.shutdown()
2430 }
2431 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2432 self.inner.shutdown_with_epitaph(status)
2433 }
2434
2435 fn is_closed(&self) -> bool {
2436 self.inner.channel().is_closed()
2437 }
2438 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2439 self.inner.channel().on_closed()
2440 }
2441
2442 #[cfg(target_os = "fuchsia")]
2443 fn signal_peer(
2444 &self,
2445 clear_mask: zx::Signals,
2446 set_mask: zx::Signals,
2447 ) -> Result<(), zx_status::Status> {
2448 use fidl::Peered;
2449 self.inner.channel().signal_peer(clear_mask, set_mask)
2450 }
2451}
2452
2453impl GraphicalPresenterControlHandle {}
2454
2455#[must_use = "FIDL methods require a response to be sent"]
2456#[derive(Debug)]
2457pub struct GraphicalPresenterPresentViewResponder {
2458 control_handle: std::mem::ManuallyDrop<GraphicalPresenterControlHandle>,
2459 tx_id: u32,
2460}
2461
2462impl std::ops::Drop for GraphicalPresenterPresentViewResponder {
2466 fn drop(&mut self) {
2467 self.control_handle.shutdown();
2468 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2470 }
2471}
2472
2473impl fidl::endpoints::Responder for GraphicalPresenterPresentViewResponder {
2474 type ControlHandle = GraphicalPresenterControlHandle;
2475
2476 fn control_handle(&self) -> &GraphicalPresenterControlHandle {
2477 &self.control_handle
2478 }
2479
2480 fn drop_without_shutdown(mut self) {
2481 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2483 std::mem::forget(self);
2485 }
2486}
2487
2488impl GraphicalPresenterPresentViewResponder {
2489 pub fn send(self, mut result: Result<(), PresentViewError>) -> Result<(), fidl::Error> {
2493 let _result = self.send_raw(result);
2494 if _result.is_err() {
2495 self.control_handle.shutdown();
2496 }
2497 self.drop_without_shutdown();
2498 _result
2499 }
2500
2501 pub fn send_no_shutdown_on_err(
2503 self,
2504 mut result: Result<(), PresentViewError>,
2505 ) -> Result<(), fidl::Error> {
2506 let _result = self.send_raw(result);
2507 self.drop_without_shutdown();
2508 _result
2509 }
2510
2511 fn send_raw(&self, mut result: Result<(), PresentViewError>) -> Result<(), fidl::Error> {
2512 self.control_handle.inner.send::<fidl::encoding::ResultType<
2513 fidl::encoding::EmptyStruct,
2514 PresentViewError,
2515 >>(
2516 result,
2517 self.tx_id,
2518 0x396042dd1422ac7a,
2519 fidl::encoding::DynamicFlags::empty(),
2520 )
2521 }
2522}
2523
2524#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2525pub struct ManagerMarker;
2526
2527impl fidl::endpoints::ProtocolMarker for ManagerMarker {
2528 type Proxy = ManagerProxy;
2529 type RequestStream = ManagerRequestStream;
2530 #[cfg(target_os = "fuchsia")]
2531 type SynchronousProxy = ManagerSynchronousProxy;
2532
2533 const DEBUG_NAME: &'static str = "fuchsia.element.Manager";
2534}
2535impl fidl::endpoints::DiscoverableProtocolMarker for ManagerMarker {}
2536pub type ManagerProposeElementResult = Result<(), ManagerError>;
2537pub type ManagerRemoveElementResult = Result<(), ManagerError>;
2538
2539pub trait ManagerProxyInterface: Send + Sync {
2540 type ProposeElementResponseFut: std::future::Future<Output = Result<ManagerProposeElementResult, fidl::Error>>
2541 + Send;
2542 fn r#propose_element(
2543 &self,
2544 spec: Spec,
2545 controller: Option<fidl::endpoints::ServerEnd<ControllerMarker>>,
2546 ) -> Self::ProposeElementResponseFut;
2547 type RemoveElementResponseFut: std::future::Future<Output = Result<ManagerRemoveElementResult, fidl::Error>>
2548 + Send;
2549 fn r#remove_element(&self, name: &str) -> Self::RemoveElementResponseFut;
2550}
2551#[derive(Debug)]
2552#[cfg(target_os = "fuchsia")]
2553pub struct ManagerSynchronousProxy {
2554 client: fidl::client::sync::Client,
2555}
2556
2557#[cfg(target_os = "fuchsia")]
2558impl fidl::endpoints::SynchronousProxy for ManagerSynchronousProxy {
2559 type Proxy = ManagerProxy;
2560 type Protocol = ManagerMarker;
2561
2562 fn from_channel(inner: fidl::Channel) -> Self {
2563 Self::new(inner)
2564 }
2565
2566 fn into_channel(self) -> fidl::Channel {
2567 self.client.into_channel()
2568 }
2569
2570 fn as_channel(&self) -> &fidl::Channel {
2571 self.client.as_channel()
2572 }
2573}
2574
2575#[cfg(target_os = "fuchsia")]
2576impl ManagerSynchronousProxy {
2577 pub fn new(channel: fidl::Channel) -> Self {
2578 let protocol_name = <ManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2579 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2580 }
2581
2582 pub fn into_channel(self) -> fidl::Channel {
2583 self.client.into_channel()
2584 }
2585
2586 pub fn wait_for_event(
2589 &self,
2590 deadline: zx::MonotonicInstant,
2591 ) -> Result<ManagerEvent, fidl::Error> {
2592 ManagerEvent::decode(self.client.wait_for_event(deadline)?)
2593 }
2594
2595 pub fn r#propose_element(
2596 &self,
2597 mut spec: Spec,
2598 mut controller: Option<fidl::endpoints::ServerEnd<ControllerMarker>>,
2599 ___deadline: zx::MonotonicInstant,
2600 ) -> Result<ManagerProposeElementResult, fidl::Error> {
2601 let _response = self.client.send_query::<
2602 ManagerProposeElementRequest,
2603 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ManagerError>,
2604 >(
2605 (&mut spec, controller,),
2606 0x2af76679cd73b902,
2607 fidl::encoding::DynamicFlags::empty(),
2608 ___deadline,
2609 )?;
2610 Ok(_response.map(|x| x))
2611 }
2612
2613 pub fn r#remove_element(
2617 &self,
2618 mut name: &str,
2619 ___deadline: zx::MonotonicInstant,
2620 ) -> Result<ManagerRemoveElementResult, fidl::Error> {
2621 let _response = self.client.send_query::<
2622 ManagerRemoveElementRequest,
2623 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ManagerError>,
2624 >(
2625 (name,),
2626 0x1e65d66515e64b52,
2627 fidl::encoding::DynamicFlags::empty(),
2628 ___deadline,
2629 )?;
2630 Ok(_response.map(|x| x))
2631 }
2632}
2633
2634#[cfg(target_os = "fuchsia")]
2635impl From<ManagerSynchronousProxy> for zx::Handle {
2636 fn from(value: ManagerSynchronousProxy) -> Self {
2637 value.into_channel().into()
2638 }
2639}
2640
2641#[cfg(target_os = "fuchsia")]
2642impl From<fidl::Channel> for ManagerSynchronousProxy {
2643 fn from(value: fidl::Channel) -> Self {
2644 Self::new(value)
2645 }
2646}
2647
2648#[cfg(target_os = "fuchsia")]
2649impl fidl::endpoints::FromClient for ManagerSynchronousProxy {
2650 type Protocol = ManagerMarker;
2651
2652 fn from_client(value: fidl::endpoints::ClientEnd<ManagerMarker>) -> Self {
2653 Self::new(value.into_channel())
2654 }
2655}
2656
2657#[derive(Debug, Clone)]
2658pub struct ManagerProxy {
2659 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2660}
2661
2662impl fidl::endpoints::Proxy for ManagerProxy {
2663 type Protocol = ManagerMarker;
2664
2665 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2666 Self::new(inner)
2667 }
2668
2669 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2670 self.client.into_channel().map_err(|client| Self { client })
2671 }
2672
2673 fn as_channel(&self) -> &::fidl::AsyncChannel {
2674 self.client.as_channel()
2675 }
2676}
2677
2678impl ManagerProxy {
2679 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2681 let protocol_name = <ManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2682 Self { client: fidl::client::Client::new(channel, protocol_name) }
2683 }
2684
2685 pub fn take_event_stream(&self) -> ManagerEventStream {
2691 ManagerEventStream { event_receiver: self.client.take_event_receiver() }
2692 }
2693
2694 pub fn r#propose_element(
2695 &self,
2696 mut spec: Spec,
2697 mut controller: Option<fidl::endpoints::ServerEnd<ControllerMarker>>,
2698 ) -> fidl::client::QueryResponseFut<
2699 ManagerProposeElementResult,
2700 fidl::encoding::DefaultFuchsiaResourceDialect,
2701 > {
2702 ManagerProxyInterface::r#propose_element(self, spec, controller)
2703 }
2704
2705 pub fn r#remove_element(
2709 &self,
2710 mut name: &str,
2711 ) -> fidl::client::QueryResponseFut<
2712 ManagerRemoveElementResult,
2713 fidl::encoding::DefaultFuchsiaResourceDialect,
2714 > {
2715 ManagerProxyInterface::r#remove_element(self, name)
2716 }
2717}
2718
2719impl ManagerProxyInterface for ManagerProxy {
2720 type ProposeElementResponseFut = fidl::client::QueryResponseFut<
2721 ManagerProposeElementResult,
2722 fidl::encoding::DefaultFuchsiaResourceDialect,
2723 >;
2724 fn r#propose_element(
2725 &self,
2726 mut spec: Spec,
2727 mut controller: Option<fidl::endpoints::ServerEnd<ControllerMarker>>,
2728 ) -> Self::ProposeElementResponseFut {
2729 fn _decode(
2730 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2731 ) -> Result<ManagerProposeElementResult, fidl::Error> {
2732 let _response = fidl::client::decode_transaction_body::<
2733 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ManagerError>,
2734 fidl::encoding::DefaultFuchsiaResourceDialect,
2735 0x2af76679cd73b902,
2736 >(_buf?)?;
2737 Ok(_response.map(|x| x))
2738 }
2739 self.client
2740 .send_query_and_decode::<ManagerProposeElementRequest, ManagerProposeElementResult>(
2741 (&mut spec, controller),
2742 0x2af76679cd73b902,
2743 fidl::encoding::DynamicFlags::empty(),
2744 _decode,
2745 )
2746 }
2747
2748 type RemoveElementResponseFut = fidl::client::QueryResponseFut<
2749 ManagerRemoveElementResult,
2750 fidl::encoding::DefaultFuchsiaResourceDialect,
2751 >;
2752 fn r#remove_element(&self, mut name: &str) -> Self::RemoveElementResponseFut {
2753 fn _decode(
2754 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2755 ) -> Result<ManagerRemoveElementResult, fidl::Error> {
2756 let _response = fidl::client::decode_transaction_body::<
2757 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ManagerError>,
2758 fidl::encoding::DefaultFuchsiaResourceDialect,
2759 0x1e65d66515e64b52,
2760 >(_buf?)?;
2761 Ok(_response.map(|x| x))
2762 }
2763 self.client
2764 .send_query_and_decode::<ManagerRemoveElementRequest, ManagerRemoveElementResult>(
2765 (name,),
2766 0x1e65d66515e64b52,
2767 fidl::encoding::DynamicFlags::empty(),
2768 _decode,
2769 )
2770 }
2771}
2772
2773pub struct ManagerEventStream {
2774 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
2775}
2776
2777impl std::marker::Unpin for ManagerEventStream {}
2778
2779impl futures::stream::FusedStream for ManagerEventStream {
2780 fn is_terminated(&self) -> bool {
2781 self.event_receiver.is_terminated()
2782 }
2783}
2784
2785impl futures::Stream for ManagerEventStream {
2786 type Item = Result<ManagerEvent, fidl::Error>;
2787
2788 fn poll_next(
2789 mut self: std::pin::Pin<&mut Self>,
2790 cx: &mut std::task::Context<'_>,
2791 ) -> std::task::Poll<Option<Self::Item>> {
2792 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
2793 &mut self.event_receiver,
2794 cx
2795 )?) {
2796 Some(buf) => std::task::Poll::Ready(Some(ManagerEvent::decode(buf))),
2797 None => std::task::Poll::Ready(None),
2798 }
2799 }
2800}
2801
2802#[derive(Debug)]
2803pub enum ManagerEvent {}
2804
2805impl ManagerEvent {
2806 fn decode(
2808 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
2809 ) -> Result<ManagerEvent, fidl::Error> {
2810 let (bytes, _handles) = buf.split_mut();
2811 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2812 debug_assert_eq!(tx_header.tx_id, 0);
2813 match tx_header.ordinal {
2814 _ => Err(fidl::Error::UnknownOrdinal {
2815 ordinal: tx_header.ordinal,
2816 protocol_name: <ManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2817 }),
2818 }
2819 }
2820}
2821
2822pub struct ManagerRequestStream {
2824 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2825 is_terminated: bool,
2826}
2827
2828impl std::marker::Unpin for ManagerRequestStream {}
2829
2830impl futures::stream::FusedStream for ManagerRequestStream {
2831 fn is_terminated(&self) -> bool {
2832 self.is_terminated
2833 }
2834}
2835
2836impl fidl::endpoints::RequestStream for ManagerRequestStream {
2837 type Protocol = ManagerMarker;
2838 type ControlHandle = ManagerControlHandle;
2839
2840 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2841 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2842 }
2843
2844 fn control_handle(&self) -> Self::ControlHandle {
2845 ManagerControlHandle { inner: self.inner.clone() }
2846 }
2847
2848 fn into_inner(
2849 self,
2850 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2851 {
2852 (self.inner, self.is_terminated)
2853 }
2854
2855 fn from_inner(
2856 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2857 is_terminated: bool,
2858 ) -> Self {
2859 Self { inner, is_terminated }
2860 }
2861}
2862
2863impl futures::Stream for ManagerRequestStream {
2864 type Item = Result<ManagerRequest, fidl::Error>;
2865
2866 fn poll_next(
2867 mut self: std::pin::Pin<&mut Self>,
2868 cx: &mut std::task::Context<'_>,
2869 ) -> std::task::Poll<Option<Self::Item>> {
2870 let this = &mut *self;
2871 if this.inner.check_shutdown(cx) {
2872 this.is_terminated = true;
2873 return std::task::Poll::Ready(None);
2874 }
2875 if this.is_terminated {
2876 panic!("polled ManagerRequestStream after completion");
2877 }
2878 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2879 |bytes, handles| {
2880 match this.inner.channel().read_etc(cx, bytes, handles) {
2881 std::task::Poll::Ready(Ok(())) => {}
2882 std::task::Poll::Pending => return std::task::Poll::Pending,
2883 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2884 this.is_terminated = true;
2885 return std::task::Poll::Ready(None);
2886 }
2887 std::task::Poll::Ready(Err(e)) => {
2888 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2889 e.into(),
2890 ))));
2891 }
2892 }
2893
2894 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2896
2897 std::task::Poll::Ready(Some(match header.ordinal {
2898 0x2af76679cd73b902 => {
2899 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2900 let mut req = fidl::new_empty!(
2901 ManagerProposeElementRequest,
2902 fidl::encoding::DefaultFuchsiaResourceDialect
2903 );
2904 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ManagerProposeElementRequest>(&header, _body_bytes, handles, &mut req)?;
2905 let control_handle = ManagerControlHandle { inner: this.inner.clone() };
2906 Ok(ManagerRequest::ProposeElement {
2907 spec: req.spec,
2908 controller: req.controller,
2909
2910 responder: ManagerProposeElementResponder {
2911 control_handle: std::mem::ManuallyDrop::new(control_handle),
2912 tx_id: header.tx_id,
2913 },
2914 })
2915 }
2916 0x1e65d66515e64b52 => {
2917 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2918 let mut req = fidl::new_empty!(
2919 ManagerRemoveElementRequest,
2920 fidl::encoding::DefaultFuchsiaResourceDialect
2921 );
2922 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ManagerRemoveElementRequest>(&header, _body_bytes, handles, &mut req)?;
2923 let control_handle = ManagerControlHandle { inner: this.inner.clone() };
2924 Ok(ManagerRequest::RemoveElement {
2925 name: req.name,
2926
2927 responder: ManagerRemoveElementResponder {
2928 control_handle: std::mem::ManuallyDrop::new(control_handle),
2929 tx_id: header.tx_id,
2930 },
2931 })
2932 }
2933 _ => Err(fidl::Error::UnknownOrdinal {
2934 ordinal: header.ordinal,
2935 protocol_name:
2936 <ManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2937 }),
2938 }))
2939 },
2940 )
2941 }
2942}
2943
2944#[derive(Debug)]
2957pub enum ManagerRequest {
2958 ProposeElement {
2959 spec: Spec,
2960 controller: Option<fidl::endpoints::ServerEnd<ControllerMarker>>,
2961 responder: ManagerProposeElementResponder,
2962 },
2963 RemoveElement { name: String, responder: ManagerRemoveElementResponder },
2967}
2968
2969impl ManagerRequest {
2970 #[allow(irrefutable_let_patterns)]
2971 pub fn into_propose_element(
2972 self,
2973 ) -> Option<(
2974 Spec,
2975 Option<fidl::endpoints::ServerEnd<ControllerMarker>>,
2976 ManagerProposeElementResponder,
2977 )> {
2978 if let ManagerRequest::ProposeElement { spec, controller, responder } = self {
2979 Some((spec, controller, responder))
2980 } else {
2981 None
2982 }
2983 }
2984
2985 #[allow(irrefutable_let_patterns)]
2986 pub fn into_remove_element(self) -> Option<(String, ManagerRemoveElementResponder)> {
2987 if let ManagerRequest::RemoveElement { name, responder } = self {
2988 Some((name, responder))
2989 } else {
2990 None
2991 }
2992 }
2993
2994 pub fn method_name(&self) -> &'static str {
2996 match *self {
2997 ManagerRequest::ProposeElement { .. } => "propose_element",
2998 ManagerRequest::RemoveElement { .. } => "remove_element",
2999 }
3000 }
3001}
3002
3003#[derive(Debug, Clone)]
3004pub struct ManagerControlHandle {
3005 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3006}
3007
3008impl fidl::endpoints::ControlHandle for ManagerControlHandle {
3009 fn shutdown(&self) {
3010 self.inner.shutdown()
3011 }
3012 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3013 self.inner.shutdown_with_epitaph(status)
3014 }
3015
3016 fn is_closed(&self) -> bool {
3017 self.inner.channel().is_closed()
3018 }
3019 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3020 self.inner.channel().on_closed()
3021 }
3022
3023 #[cfg(target_os = "fuchsia")]
3024 fn signal_peer(
3025 &self,
3026 clear_mask: zx::Signals,
3027 set_mask: zx::Signals,
3028 ) -> Result<(), zx_status::Status> {
3029 use fidl::Peered;
3030 self.inner.channel().signal_peer(clear_mask, set_mask)
3031 }
3032}
3033
3034impl ManagerControlHandle {}
3035
3036#[must_use = "FIDL methods require a response to be sent"]
3037#[derive(Debug)]
3038pub struct ManagerProposeElementResponder {
3039 control_handle: std::mem::ManuallyDrop<ManagerControlHandle>,
3040 tx_id: u32,
3041}
3042
3043impl std::ops::Drop for ManagerProposeElementResponder {
3047 fn drop(&mut self) {
3048 self.control_handle.shutdown();
3049 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3051 }
3052}
3053
3054impl fidl::endpoints::Responder for ManagerProposeElementResponder {
3055 type ControlHandle = ManagerControlHandle;
3056
3057 fn control_handle(&self) -> &ManagerControlHandle {
3058 &self.control_handle
3059 }
3060
3061 fn drop_without_shutdown(mut self) {
3062 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3064 std::mem::forget(self);
3066 }
3067}
3068
3069impl ManagerProposeElementResponder {
3070 pub fn send(self, mut result: Result<(), ManagerError>) -> Result<(), fidl::Error> {
3074 let _result = self.send_raw(result);
3075 if _result.is_err() {
3076 self.control_handle.shutdown();
3077 }
3078 self.drop_without_shutdown();
3079 _result
3080 }
3081
3082 pub fn send_no_shutdown_on_err(
3084 self,
3085 mut result: Result<(), ManagerError>,
3086 ) -> Result<(), fidl::Error> {
3087 let _result = self.send_raw(result);
3088 self.drop_without_shutdown();
3089 _result
3090 }
3091
3092 fn send_raw(&self, mut result: Result<(), ManagerError>) -> Result<(), fidl::Error> {
3093 self.control_handle.inner.send::<fidl::encoding::ResultType<
3094 fidl::encoding::EmptyStruct,
3095 ManagerError,
3096 >>(
3097 result,
3098 self.tx_id,
3099 0x2af76679cd73b902,
3100 fidl::encoding::DynamicFlags::empty(),
3101 )
3102 }
3103}
3104
3105#[must_use = "FIDL methods require a response to be sent"]
3106#[derive(Debug)]
3107pub struct ManagerRemoveElementResponder {
3108 control_handle: std::mem::ManuallyDrop<ManagerControlHandle>,
3109 tx_id: u32,
3110}
3111
3112impl std::ops::Drop for ManagerRemoveElementResponder {
3116 fn drop(&mut self) {
3117 self.control_handle.shutdown();
3118 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3120 }
3121}
3122
3123impl fidl::endpoints::Responder for ManagerRemoveElementResponder {
3124 type ControlHandle = ManagerControlHandle;
3125
3126 fn control_handle(&self) -> &ManagerControlHandle {
3127 &self.control_handle
3128 }
3129
3130 fn drop_without_shutdown(mut self) {
3131 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3133 std::mem::forget(self);
3135 }
3136}
3137
3138impl ManagerRemoveElementResponder {
3139 pub fn send(self, mut result: Result<(), ManagerError>) -> Result<(), fidl::Error> {
3143 let _result = self.send_raw(result);
3144 if _result.is_err() {
3145 self.control_handle.shutdown();
3146 }
3147 self.drop_without_shutdown();
3148 _result
3149 }
3150
3151 pub fn send_no_shutdown_on_err(
3153 self,
3154 mut result: Result<(), ManagerError>,
3155 ) -> Result<(), fidl::Error> {
3156 let _result = self.send_raw(result);
3157 self.drop_without_shutdown();
3158 _result
3159 }
3160
3161 fn send_raw(&self, mut result: Result<(), ManagerError>) -> Result<(), fidl::Error> {
3162 self.control_handle.inner.send::<fidl::encoding::ResultType<
3163 fidl::encoding::EmptyStruct,
3164 ManagerError,
3165 >>(
3166 result,
3167 self.tx_id,
3168 0x1e65d66515e64b52,
3169 fidl::encoding::DynamicFlags::empty(),
3170 )
3171 }
3172}
3173
3174#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3175pub struct ViewControllerMarker;
3176
3177impl fidl::endpoints::ProtocolMarker for ViewControllerMarker {
3178 type Proxy = ViewControllerProxy;
3179 type RequestStream = ViewControllerRequestStream;
3180 #[cfg(target_os = "fuchsia")]
3181 type SynchronousProxy = ViewControllerSynchronousProxy;
3182
3183 const DEBUG_NAME: &'static str = "(anonymous) ViewController";
3184}
3185
3186pub trait ViewControllerProxyInterface: Send + Sync {
3187 fn r#dismiss(&self) -> Result<(), fidl::Error>;
3188}
3189#[derive(Debug)]
3190#[cfg(target_os = "fuchsia")]
3191pub struct ViewControllerSynchronousProxy {
3192 client: fidl::client::sync::Client,
3193}
3194
3195#[cfg(target_os = "fuchsia")]
3196impl fidl::endpoints::SynchronousProxy for ViewControllerSynchronousProxy {
3197 type Proxy = ViewControllerProxy;
3198 type Protocol = ViewControllerMarker;
3199
3200 fn from_channel(inner: fidl::Channel) -> Self {
3201 Self::new(inner)
3202 }
3203
3204 fn into_channel(self) -> fidl::Channel {
3205 self.client.into_channel()
3206 }
3207
3208 fn as_channel(&self) -> &fidl::Channel {
3209 self.client.as_channel()
3210 }
3211}
3212
3213#[cfg(target_os = "fuchsia")]
3214impl ViewControllerSynchronousProxy {
3215 pub fn new(channel: fidl::Channel) -> Self {
3216 let protocol_name = <ViewControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3217 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
3218 }
3219
3220 pub fn into_channel(self) -> fidl::Channel {
3221 self.client.into_channel()
3222 }
3223
3224 pub fn wait_for_event(
3227 &self,
3228 deadline: zx::MonotonicInstant,
3229 ) -> Result<ViewControllerEvent, fidl::Error> {
3230 ViewControllerEvent::decode(self.client.wait_for_event(deadline)?)
3231 }
3232
3233 pub fn r#dismiss(&self) -> Result<(), fidl::Error> {
3241 self.client.send::<fidl::encoding::EmptyPayload>(
3242 (),
3243 0x794061fcab05a3dc,
3244 fidl::encoding::DynamicFlags::empty(),
3245 )
3246 }
3247}
3248
3249#[cfg(target_os = "fuchsia")]
3250impl From<ViewControllerSynchronousProxy> for zx::Handle {
3251 fn from(value: ViewControllerSynchronousProxy) -> Self {
3252 value.into_channel().into()
3253 }
3254}
3255
3256#[cfg(target_os = "fuchsia")]
3257impl From<fidl::Channel> for ViewControllerSynchronousProxy {
3258 fn from(value: fidl::Channel) -> Self {
3259 Self::new(value)
3260 }
3261}
3262
3263#[cfg(target_os = "fuchsia")]
3264impl fidl::endpoints::FromClient for ViewControllerSynchronousProxy {
3265 type Protocol = ViewControllerMarker;
3266
3267 fn from_client(value: fidl::endpoints::ClientEnd<ViewControllerMarker>) -> Self {
3268 Self::new(value.into_channel())
3269 }
3270}
3271
3272#[derive(Debug, Clone)]
3273pub struct ViewControllerProxy {
3274 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
3275}
3276
3277impl fidl::endpoints::Proxy for ViewControllerProxy {
3278 type Protocol = ViewControllerMarker;
3279
3280 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
3281 Self::new(inner)
3282 }
3283
3284 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
3285 self.client.into_channel().map_err(|client| Self { client })
3286 }
3287
3288 fn as_channel(&self) -> &::fidl::AsyncChannel {
3289 self.client.as_channel()
3290 }
3291}
3292
3293impl ViewControllerProxy {
3294 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
3296 let protocol_name = <ViewControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
3297 Self { client: fidl::client::Client::new(channel, protocol_name) }
3298 }
3299
3300 pub fn take_event_stream(&self) -> ViewControllerEventStream {
3306 ViewControllerEventStream { event_receiver: self.client.take_event_receiver() }
3307 }
3308
3309 pub fn r#dismiss(&self) -> Result<(), fidl::Error> {
3317 ViewControllerProxyInterface::r#dismiss(self)
3318 }
3319}
3320
3321impl ViewControllerProxyInterface for ViewControllerProxy {
3322 fn r#dismiss(&self) -> Result<(), fidl::Error> {
3323 self.client.send::<fidl::encoding::EmptyPayload>(
3324 (),
3325 0x794061fcab05a3dc,
3326 fidl::encoding::DynamicFlags::empty(),
3327 )
3328 }
3329}
3330
3331pub struct ViewControllerEventStream {
3332 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3333}
3334
3335impl std::marker::Unpin for ViewControllerEventStream {}
3336
3337impl futures::stream::FusedStream for ViewControllerEventStream {
3338 fn is_terminated(&self) -> bool {
3339 self.event_receiver.is_terminated()
3340 }
3341}
3342
3343impl futures::Stream for ViewControllerEventStream {
3344 type Item = Result<ViewControllerEvent, fidl::Error>;
3345
3346 fn poll_next(
3347 mut self: std::pin::Pin<&mut Self>,
3348 cx: &mut std::task::Context<'_>,
3349 ) -> std::task::Poll<Option<Self::Item>> {
3350 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3351 &mut self.event_receiver,
3352 cx
3353 )?) {
3354 Some(buf) => std::task::Poll::Ready(Some(ViewControllerEvent::decode(buf))),
3355 None => std::task::Poll::Ready(None),
3356 }
3357 }
3358}
3359
3360#[derive(Debug)]
3361pub enum ViewControllerEvent {
3362 OnPresented {},
3363}
3364
3365impl ViewControllerEvent {
3366 #[allow(irrefutable_let_patterns)]
3367 pub fn into_on_presented(self) -> Option<()> {
3368 if let ViewControllerEvent::OnPresented {} = self { Some(()) } else { None }
3369 }
3370
3371 fn decode(
3373 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3374 ) -> Result<ViewControllerEvent, fidl::Error> {
3375 let (bytes, _handles) = buf.split_mut();
3376 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3377 debug_assert_eq!(tx_header.tx_id, 0);
3378 match tx_header.ordinal {
3379 0x26977e68369330b5 => {
3380 let mut out = fidl::new_empty!(
3381 fidl::encoding::EmptyPayload,
3382 fidl::encoding::DefaultFuchsiaResourceDialect
3383 );
3384 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&tx_header, _body_bytes, _handles, &mut out)?;
3385 Ok((ViewControllerEvent::OnPresented {}))
3386 }
3387 _ => Err(fidl::Error::UnknownOrdinal {
3388 ordinal: tx_header.ordinal,
3389 protocol_name:
3390 <ViewControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3391 }),
3392 }
3393 }
3394}
3395
3396pub struct ViewControllerRequestStream {
3398 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3399 is_terminated: bool,
3400}
3401
3402impl std::marker::Unpin for ViewControllerRequestStream {}
3403
3404impl futures::stream::FusedStream for ViewControllerRequestStream {
3405 fn is_terminated(&self) -> bool {
3406 self.is_terminated
3407 }
3408}
3409
3410impl fidl::endpoints::RequestStream for ViewControllerRequestStream {
3411 type Protocol = ViewControllerMarker;
3412 type ControlHandle = ViewControllerControlHandle;
3413
3414 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3415 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3416 }
3417
3418 fn control_handle(&self) -> Self::ControlHandle {
3419 ViewControllerControlHandle { inner: self.inner.clone() }
3420 }
3421
3422 fn into_inner(
3423 self,
3424 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3425 {
3426 (self.inner, self.is_terminated)
3427 }
3428
3429 fn from_inner(
3430 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3431 is_terminated: bool,
3432 ) -> Self {
3433 Self { inner, is_terminated }
3434 }
3435}
3436
3437impl futures::Stream for ViewControllerRequestStream {
3438 type Item = Result<ViewControllerRequest, fidl::Error>;
3439
3440 fn poll_next(
3441 mut self: std::pin::Pin<&mut Self>,
3442 cx: &mut std::task::Context<'_>,
3443 ) -> std::task::Poll<Option<Self::Item>> {
3444 let this = &mut *self;
3445 if this.inner.check_shutdown(cx) {
3446 this.is_terminated = true;
3447 return std::task::Poll::Ready(None);
3448 }
3449 if this.is_terminated {
3450 panic!("polled ViewControllerRequestStream after completion");
3451 }
3452 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3453 |bytes, handles| {
3454 match this.inner.channel().read_etc(cx, bytes, handles) {
3455 std::task::Poll::Ready(Ok(())) => {}
3456 std::task::Poll::Pending => return std::task::Poll::Pending,
3457 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3458 this.is_terminated = true;
3459 return std::task::Poll::Ready(None);
3460 }
3461 std::task::Poll::Ready(Err(e)) => {
3462 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3463 e.into(),
3464 ))));
3465 }
3466 }
3467
3468 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3470
3471 std::task::Poll::Ready(Some(match header.ordinal {
3472 0x794061fcab05a3dc => {
3473 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
3474 let mut req = fidl::new_empty!(
3475 fidl::encoding::EmptyPayload,
3476 fidl::encoding::DefaultFuchsiaResourceDialect
3477 );
3478 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3479 let control_handle =
3480 ViewControllerControlHandle { inner: this.inner.clone() };
3481 Ok(ViewControllerRequest::Dismiss { control_handle })
3482 }
3483 _ => Err(fidl::Error::UnknownOrdinal {
3484 ordinal: header.ordinal,
3485 protocol_name:
3486 <ViewControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3487 }),
3488 }))
3489 },
3490 )
3491 }
3492}
3493
3494#[derive(Debug)]
3497pub enum ViewControllerRequest {
3498 Dismiss { control_handle: ViewControllerControlHandle },
3506}
3507
3508impl ViewControllerRequest {
3509 #[allow(irrefutable_let_patterns)]
3510 pub fn into_dismiss(self) -> Option<(ViewControllerControlHandle)> {
3511 if let ViewControllerRequest::Dismiss { control_handle } = self {
3512 Some((control_handle))
3513 } else {
3514 None
3515 }
3516 }
3517
3518 pub fn method_name(&self) -> &'static str {
3520 match *self {
3521 ViewControllerRequest::Dismiss { .. } => "dismiss",
3522 }
3523 }
3524}
3525
3526#[derive(Debug, Clone)]
3527pub struct ViewControllerControlHandle {
3528 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3529}
3530
3531impl fidl::endpoints::ControlHandle for ViewControllerControlHandle {
3532 fn shutdown(&self) {
3533 self.inner.shutdown()
3534 }
3535 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3536 self.inner.shutdown_with_epitaph(status)
3537 }
3538
3539 fn is_closed(&self) -> bool {
3540 self.inner.channel().is_closed()
3541 }
3542 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3543 self.inner.channel().on_closed()
3544 }
3545
3546 #[cfg(target_os = "fuchsia")]
3547 fn signal_peer(
3548 &self,
3549 clear_mask: zx::Signals,
3550 set_mask: zx::Signals,
3551 ) -> Result<(), zx_status::Status> {
3552 use fidl::Peered;
3553 self.inner.channel().signal_peer(clear_mask, set_mask)
3554 }
3555}
3556
3557impl ViewControllerControlHandle {
3558 pub fn send_on_presented(&self) -> Result<(), fidl::Error> {
3559 self.inner.send::<fidl::encoding::EmptyPayload>(
3560 (),
3561 0,
3562 0x26977e68369330b5,
3563 fidl::encoding::DynamicFlags::empty(),
3564 )
3565 }
3566}
3567
3568mod internal {
3569 use super::*;
3570
3571 impl fidl::encoding::ResourceTypeMarker for Annotation {
3572 type Borrowed<'a> = &'a mut Self;
3573 fn take_or_borrow<'a>(
3574 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3575 ) -> Self::Borrowed<'a> {
3576 value
3577 }
3578 }
3579
3580 unsafe impl fidl::encoding::TypeMarker for Annotation {
3581 type Owned = Self;
3582
3583 #[inline(always)]
3584 fn inline_align(_context: fidl::encoding::Context) -> usize {
3585 8
3586 }
3587
3588 #[inline(always)]
3589 fn inline_size(_context: fidl::encoding::Context) -> usize {
3590 48
3591 }
3592 }
3593
3594 unsafe impl fidl::encoding::Encode<Annotation, fidl::encoding::DefaultFuchsiaResourceDialect>
3595 for &mut Annotation
3596 {
3597 #[inline]
3598 unsafe fn encode(
3599 self,
3600 encoder: &mut fidl::encoding::Encoder<
3601 '_,
3602 fidl::encoding::DefaultFuchsiaResourceDialect,
3603 >,
3604 offset: usize,
3605 _depth: fidl::encoding::Depth,
3606 ) -> fidl::Result<()> {
3607 encoder.debug_check_bounds::<Annotation>(offset);
3608 fidl::encoding::Encode::<Annotation, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3610 (
3611 <AnnotationKey as fidl::encoding::ValueTypeMarker>::borrow(&self.key),
3612 <AnnotationValue as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.value),
3613 ),
3614 encoder, offset, _depth
3615 )
3616 }
3617 }
3618 unsafe impl<
3619 T0: fidl::encoding::Encode<AnnotationKey, fidl::encoding::DefaultFuchsiaResourceDialect>,
3620 T1: fidl::encoding::Encode<AnnotationValue, fidl::encoding::DefaultFuchsiaResourceDialect>,
3621 > fidl::encoding::Encode<Annotation, fidl::encoding::DefaultFuchsiaResourceDialect>
3622 for (T0, T1)
3623 {
3624 #[inline]
3625 unsafe fn encode(
3626 self,
3627 encoder: &mut fidl::encoding::Encoder<
3628 '_,
3629 fidl::encoding::DefaultFuchsiaResourceDialect,
3630 >,
3631 offset: usize,
3632 depth: fidl::encoding::Depth,
3633 ) -> fidl::Result<()> {
3634 encoder.debug_check_bounds::<Annotation>(offset);
3635 self.0.encode(encoder, offset + 0, depth)?;
3639 self.1.encode(encoder, offset + 32, depth)?;
3640 Ok(())
3641 }
3642 }
3643
3644 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Annotation {
3645 #[inline(always)]
3646 fn new_empty() -> Self {
3647 Self {
3648 key: fidl::new_empty!(AnnotationKey, fidl::encoding::DefaultFuchsiaResourceDialect),
3649 value: fidl::new_empty!(
3650 AnnotationValue,
3651 fidl::encoding::DefaultFuchsiaResourceDialect
3652 ),
3653 }
3654 }
3655
3656 #[inline]
3657 unsafe fn decode(
3658 &mut self,
3659 decoder: &mut fidl::encoding::Decoder<
3660 '_,
3661 fidl::encoding::DefaultFuchsiaResourceDialect,
3662 >,
3663 offset: usize,
3664 _depth: fidl::encoding::Depth,
3665 ) -> fidl::Result<()> {
3666 decoder.debug_check_bounds::<Self>(offset);
3667 fidl::decode!(
3669 AnnotationKey,
3670 fidl::encoding::DefaultFuchsiaResourceDialect,
3671 &mut self.key,
3672 decoder,
3673 offset + 0,
3674 _depth
3675 )?;
3676 fidl::decode!(
3677 AnnotationValue,
3678 fidl::encoding::DefaultFuchsiaResourceDialect,
3679 &mut self.value,
3680 decoder,
3681 offset + 32,
3682 _depth
3683 )?;
3684 Ok(())
3685 }
3686 }
3687
3688 impl fidl::encoding::ResourceTypeMarker for AnnotationControllerUpdateAnnotationsRequest {
3689 type Borrowed<'a> = &'a mut Self;
3690 fn take_or_borrow<'a>(
3691 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3692 ) -> Self::Borrowed<'a> {
3693 value
3694 }
3695 }
3696
3697 unsafe impl fidl::encoding::TypeMarker for AnnotationControllerUpdateAnnotationsRequest {
3698 type Owned = Self;
3699
3700 #[inline(always)]
3701 fn inline_align(_context: fidl::encoding::Context) -> usize {
3702 8
3703 }
3704
3705 #[inline(always)]
3706 fn inline_size(_context: fidl::encoding::Context) -> usize {
3707 32
3708 }
3709 }
3710
3711 unsafe impl
3712 fidl::encoding::Encode<
3713 AnnotationControllerUpdateAnnotationsRequest,
3714 fidl::encoding::DefaultFuchsiaResourceDialect,
3715 > for &mut AnnotationControllerUpdateAnnotationsRequest
3716 {
3717 #[inline]
3718 unsafe fn encode(
3719 self,
3720 encoder: &mut fidl::encoding::Encoder<
3721 '_,
3722 fidl::encoding::DefaultFuchsiaResourceDialect,
3723 >,
3724 offset: usize,
3725 _depth: fidl::encoding::Depth,
3726 ) -> fidl::Result<()> {
3727 encoder.debug_check_bounds::<AnnotationControllerUpdateAnnotationsRequest>(offset);
3728 fidl::encoding::Encode::<AnnotationControllerUpdateAnnotationsRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3730 (
3731 <fidl::encoding::Vector<Annotation, 1024> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.annotations_to_set),
3732 <fidl::encoding::Vector<AnnotationKey, 1024> as fidl::encoding::ValueTypeMarker>::borrow(&self.annotations_to_delete),
3733 ),
3734 encoder, offset, _depth
3735 )
3736 }
3737 }
3738 unsafe impl<
3739 T0: fidl::encoding::Encode<
3740 fidl::encoding::Vector<Annotation, 1024>,
3741 fidl::encoding::DefaultFuchsiaResourceDialect,
3742 >,
3743 T1: fidl::encoding::Encode<
3744 fidl::encoding::Vector<AnnotationKey, 1024>,
3745 fidl::encoding::DefaultFuchsiaResourceDialect,
3746 >,
3747 >
3748 fidl::encoding::Encode<
3749 AnnotationControllerUpdateAnnotationsRequest,
3750 fidl::encoding::DefaultFuchsiaResourceDialect,
3751 > for (T0, T1)
3752 {
3753 #[inline]
3754 unsafe fn encode(
3755 self,
3756 encoder: &mut fidl::encoding::Encoder<
3757 '_,
3758 fidl::encoding::DefaultFuchsiaResourceDialect,
3759 >,
3760 offset: usize,
3761 depth: fidl::encoding::Depth,
3762 ) -> fidl::Result<()> {
3763 encoder.debug_check_bounds::<AnnotationControllerUpdateAnnotationsRequest>(offset);
3764 self.0.encode(encoder, offset + 0, depth)?;
3768 self.1.encode(encoder, offset + 16, depth)?;
3769 Ok(())
3770 }
3771 }
3772
3773 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3774 for AnnotationControllerUpdateAnnotationsRequest
3775 {
3776 #[inline(always)]
3777 fn new_empty() -> Self {
3778 Self {
3779 annotations_to_set: fidl::new_empty!(fidl::encoding::Vector<Annotation, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect),
3780 annotations_to_delete: fidl::new_empty!(fidl::encoding::Vector<AnnotationKey, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect),
3781 }
3782 }
3783
3784 #[inline]
3785 unsafe fn decode(
3786 &mut self,
3787 decoder: &mut fidl::encoding::Decoder<
3788 '_,
3789 fidl::encoding::DefaultFuchsiaResourceDialect,
3790 >,
3791 offset: usize,
3792 _depth: fidl::encoding::Depth,
3793 ) -> fidl::Result<()> {
3794 decoder.debug_check_bounds::<Self>(offset);
3795 fidl::decode!(fidl::encoding::Vector<Annotation, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.annotations_to_set, decoder, offset + 0, _depth)?;
3797 fidl::decode!(fidl::encoding::Vector<AnnotationKey, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.annotations_to_delete, decoder, offset + 16, _depth)?;
3798 Ok(())
3799 }
3800 }
3801
3802 impl fidl::encoding::ResourceTypeMarker for AnnotationControllerGetAnnotationsResponse {
3803 type Borrowed<'a> = &'a mut Self;
3804 fn take_or_borrow<'a>(
3805 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3806 ) -> Self::Borrowed<'a> {
3807 value
3808 }
3809 }
3810
3811 unsafe impl fidl::encoding::TypeMarker for AnnotationControllerGetAnnotationsResponse {
3812 type Owned = Self;
3813
3814 #[inline(always)]
3815 fn inline_align(_context: fidl::encoding::Context) -> usize {
3816 8
3817 }
3818
3819 #[inline(always)]
3820 fn inline_size(_context: fidl::encoding::Context) -> usize {
3821 16
3822 }
3823 }
3824
3825 unsafe impl
3826 fidl::encoding::Encode<
3827 AnnotationControllerGetAnnotationsResponse,
3828 fidl::encoding::DefaultFuchsiaResourceDialect,
3829 > for &mut AnnotationControllerGetAnnotationsResponse
3830 {
3831 #[inline]
3832 unsafe fn encode(
3833 self,
3834 encoder: &mut fidl::encoding::Encoder<
3835 '_,
3836 fidl::encoding::DefaultFuchsiaResourceDialect,
3837 >,
3838 offset: usize,
3839 _depth: fidl::encoding::Depth,
3840 ) -> fidl::Result<()> {
3841 encoder.debug_check_bounds::<AnnotationControllerGetAnnotationsResponse>(offset);
3842 fidl::encoding::Encode::<AnnotationControllerGetAnnotationsResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3844 (
3845 <fidl::encoding::Vector<Annotation, 1024> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.annotations),
3846 ),
3847 encoder, offset, _depth
3848 )
3849 }
3850 }
3851 unsafe impl<
3852 T0: fidl::encoding::Encode<
3853 fidl::encoding::Vector<Annotation, 1024>,
3854 fidl::encoding::DefaultFuchsiaResourceDialect,
3855 >,
3856 >
3857 fidl::encoding::Encode<
3858 AnnotationControllerGetAnnotationsResponse,
3859 fidl::encoding::DefaultFuchsiaResourceDialect,
3860 > for (T0,)
3861 {
3862 #[inline]
3863 unsafe fn encode(
3864 self,
3865 encoder: &mut fidl::encoding::Encoder<
3866 '_,
3867 fidl::encoding::DefaultFuchsiaResourceDialect,
3868 >,
3869 offset: usize,
3870 depth: fidl::encoding::Depth,
3871 ) -> fidl::Result<()> {
3872 encoder.debug_check_bounds::<AnnotationControllerGetAnnotationsResponse>(offset);
3873 self.0.encode(encoder, offset + 0, depth)?;
3877 Ok(())
3878 }
3879 }
3880
3881 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3882 for AnnotationControllerGetAnnotationsResponse
3883 {
3884 #[inline(always)]
3885 fn new_empty() -> Self {
3886 Self {
3887 annotations: fidl::new_empty!(fidl::encoding::Vector<Annotation, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect),
3888 }
3889 }
3890
3891 #[inline]
3892 unsafe fn decode(
3893 &mut self,
3894 decoder: &mut fidl::encoding::Decoder<
3895 '_,
3896 fidl::encoding::DefaultFuchsiaResourceDialect,
3897 >,
3898 offset: usize,
3899 _depth: fidl::encoding::Depth,
3900 ) -> fidl::Result<()> {
3901 decoder.debug_check_bounds::<Self>(offset);
3902 fidl::decode!(fidl::encoding::Vector<Annotation, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.annotations, decoder, offset + 0, _depth)?;
3904 Ok(())
3905 }
3906 }
3907
3908 impl fidl::encoding::ResourceTypeMarker for AnnotationControllerWatchAnnotationsResponse {
3909 type Borrowed<'a> = &'a mut Self;
3910 fn take_or_borrow<'a>(
3911 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
3912 ) -> Self::Borrowed<'a> {
3913 value
3914 }
3915 }
3916
3917 unsafe impl fidl::encoding::TypeMarker for AnnotationControllerWatchAnnotationsResponse {
3918 type Owned = Self;
3919
3920 #[inline(always)]
3921 fn inline_align(_context: fidl::encoding::Context) -> usize {
3922 8
3923 }
3924
3925 #[inline(always)]
3926 fn inline_size(_context: fidl::encoding::Context) -> usize {
3927 16
3928 }
3929 }
3930
3931 unsafe impl
3932 fidl::encoding::Encode<
3933 AnnotationControllerWatchAnnotationsResponse,
3934 fidl::encoding::DefaultFuchsiaResourceDialect,
3935 > for &mut AnnotationControllerWatchAnnotationsResponse
3936 {
3937 #[inline]
3938 unsafe fn encode(
3939 self,
3940 encoder: &mut fidl::encoding::Encoder<
3941 '_,
3942 fidl::encoding::DefaultFuchsiaResourceDialect,
3943 >,
3944 offset: usize,
3945 _depth: fidl::encoding::Depth,
3946 ) -> fidl::Result<()> {
3947 encoder.debug_check_bounds::<AnnotationControllerWatchAnnotationsResponse>(offset);
3948 fidl::encoding::Encode::<AnnotationControllerWatchAnnotationsResponse, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
3950 (
3951 <fidl::encoding::Vector<Annotation, 1024> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.annotations),
3952 ),
3953 encoder, offset, _depth
3954 )
3955 }
3956 }
3957 unsafe impl<
3958 T0: fidl::encoding::Encode<
3959 fidl::encoding::Vector<Annotation, 1024>,
3960 fidl::encoding::DefaultFuchsiaResourceDialect,
3961 >,
3962 >
3963 fidl::encoding::Encode<
3964 AnnotationControllerWatchAnnotationsResponse,
3965 fidl::encoding::DefaultFuchsiaResourceDialect,
3966 > for (T0,)
3967 {
3968 #[inline]
3969 unsafe fn encode(
3970 self,
3971 encoder: &mut fidl::encoding::Encoder<
3972 '_,
3973 fidl::encoding::DefaultFuchsiaResourceDialect,
3974 >,
3975 offset: usize,
3976 depth: fidl::encoding::Depth,
3977 ) -> fidl::Result<()> {
3978 encoder.debug_check_bounds::<AnnotationControllerWatchAnnotationsResponse>(offset);
3979 self.0.encode(encoder, offset + 0, depth)?;
3983 Ok(())
3984 }
3985 }
3986
3987 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
3988 for AnnotationControllerWatchAnnotationsResponse
3989 {
3990 #[inline(always)]
3991 fn new_empty() -> Self {
3992 Self {
3993 annotations: fidl::new_empty!(fidl::encoding::Vector<Annotation, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect),
3994 }
3995 }
3996
3997 #[inline]
3998 unsafe fn decode(
3999 &mut self,
4000 decoder: &mut fidl::encoding::Decoder<
4001 '_,
4002 fidl::encoding::DefaultFuchsiaResourceDialect,
4003 >,
4004 offset: usize,
4005 _depth: fidl::encoding::Depth,
4006 ) -> fidl::Result<()> {
4007 decoder.debug_check_bounds::<Self>(offset);
4008 fidl::decode!(fidl::encoding::Vector<Annotation, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.annotations, decoder, offset + 0, _depth)?;
4010 Ok(())
4011 }
4012 }
4013
4014 impl fidl::encoding::ResourceTypeMarker for GraphicalPresenterPresentViewRequest {
4015 type Borrowed<'a> = &'a mut Self;
4016 fn take_or_borrow<'a>(
4017 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4018 ) -> Self::Borrowed<'a> {
4019 value
4020 }
4021 }
4022
4023 unsafe impl fidl::encoding::TypeMarker for GraphicalPresenterPresentViewRequest {
4024 type Owned = Self;
4025
4026 #[inline(always)]
4027 fn inline_align(_context: fidl::encoding::Context) -> usize {
4028 8
4029 }
4030
4031 #[inline(always)]
4032 fn inline_size(_context: fidl::encoding::Context) -> usize {
4033 24
4034 }
4035 }
4036
4037 unsafe impl
4038 fidl::encoding::Encode<
4039 GraphicalPresenterPresentViewRequest,
4040 fidl::encoding::DefaultFuchsiaResourceDialect,
4041 > for &mut GraphicalPresenterPresentViewRequest
4042 {
4043 #[inline]
4044 unsafe fn encode(
4045 self,
4046 encoder: &mut fidl::encoding::Encoder<
4047 '_,
4048 fidl::encoding::DefaultFuchsiaResourceDialect,
4049 >,
4050 offset: usize,
4051 _depth: fidl::encoding::Depth,
4052 ) -> fidl::Result<()> {
4053 encoder.debug_check_bounds::<GraphicalPresenterPresentViewRequest>(offset);
4054 fidl::encoding::Encode::<
4056 GraphicalPresenterPresentViewRequest,
4057 fidl::encoding::DefaultFuchsiaResourceDialect,
4058 >::encode(
4059 (
4060 <ViewSpec as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4061 &mut self.view_spec,
4062 ),
4063 <fidl::encoding::Optional<
4064 fidl::encoding::Endpoint<
4065 fidl::endpoints::ClientEnd<AnnotationControllerMarker>,
4066 >,
4067 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4068 &mut self.annotation_controller,
4069 ),
4070 <fidl::encoding::Optional<
4071 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ViewControllerMarker>>,
4072 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4073 &mut self.view_controller_request,
4074 ),
4075 ),
4076 encoder,
4077 offset,
4078 _depth,
4079 )
4080 }
4081 }
4082 unsafe impl<
4083 T0: fidl::encoding::Encode<ViewSpec, fidl::encoding::DefaultFuchsiaResourceDialect>,
4084 T1: fidl::encoding::Encode<
4085 fidl::encoding::Optional<
4086 fidl::encoding::Endpoint<
4087 fidl::endpoints::ClientEnd<AnnotationControllerMarker>,
4088 >,
4089 >,
4090 fidl::encoding::DefaultFuchsiaResourceDialect,
4091 >,
4092 T2: fidl::encoding::Encode<
4093 fidl::encoding::Optional<
4094 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ViewControllerMarker>>,
4095 >,
4096 fidl::encoding::DefaultFuchsiaResourceDialect,
4097 >,
4098 >
4099 fidl::encoding::Encode<
4100 GraphicalPresenterPresentViewRequest,
4101 fidl::encoding::DefaultFuchsiaResourceDialect,
4102 > for (T0, T1, T2)
4103 {
4104 #[inline]
4105 unsafe fn encode(
4106 self,
4107 encoder: &mut fidl::encoding::Encoder<
4108 '_,
4109 fidl::encoding::DefaultFuchsiaResourceDialect,
4110 >,
4111 offset: usize,
4112 depth: fidl::encoding::Depth,
4113 ) -> fidl::Result<()> {
4114 encoder.debug_check_bounds::<GraphicalPresenterPresentViewRequest>(offset);
4115 self.0.encode(encoder, offset + 0, depth)?;
4119 self.1.encode(encoder, offset + 16, depth)?;
4120 self.2.encode(encoder, offset + 20, depth)?;
4121 Ok(())
4122 }
4123 }
4124
4125 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4126 for GraphicalPresenterPresentViewRequest
4127 {
4128 #[inline(always)]
4129 fn new_empty() -> Self {
4130 Self {
4131 view_spec: fidl::new_empty!(
4132 ViewSpec,
4133 fidl::encoding::DefaultFuchsiaResourceDialect
4134 ),
4135 annotation_controller: fidl::new_empty!(
4136 fidl::encoding::Optional<
4137 fidl::encoding::Endpoint<
4138 fidl::endpoints::ClientEnd<AnnotationControllerMarker>,
4139 >,
4140 >,
4141 fidl::encoding::DefaultFuchsiaResourceDialect
4142 ),
4143 view_controller_request: fidl::new_empty!(
4144 fidl::encoding::Optional<
4145 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ViewControllerMarker>>,
4146 >,
4147 fidl::encoding::DefaultFuchsiaResourceDialect
4148 ),
4149 }
4150 }
4151
4152 #[inline]
4153 unsafe fn decode(
4154 &mut self,
4155 decoder: &mut fidl::encoding::Decoder<
4156 '_,
4157 fidl::encoding::DefaultFuchsiaResourceDialect,
4158 >,
4159 offset: usize,
4160 _depth: fidl::encoding::Depth,
4161 ) -> fidl::Result<()> {
4162 decoder.debug_check_bounds::<Self>(offset);
4163 fidl::decode!(
4165 ViewSpec,
4166 fidl::encoding::DefaultFuchsiaResourceDialect,
4167 &mut self.view_spec,
4168 decoder,
4169 offset + 0,
4170 _depth
4171 )?;
4172 fidl::decode!(
4173 fidl::encoding::Optional<
4174 fidl::encoding::Endpoint<
4175 fidl::endpoints::ClientEnd<AnnotationControllerMarker>,
4176 >,
4177 >,
4178 fidl::encoding::DefaultFuchsiaResourceDialect,
4179 &mut self.annotation_controller,
4180 decoder,
4181 offset + 16,
4182 _depth
4183 )?;
4184 fidl::decode!(
4185 fidl::encoding::Optional<
4186 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ViewControllerMarker>>,
4187 >,
4188 fidl::encoding::DefaultFuchsiaResourceDialect,
4189 &mut self.view_controller_request,
4190 decoder,
4191 offset + 20,
4192 _depth
4193 )?;
4194 Ok(())
4195 }
4196 }
4197
4198 impl fidl::encoding::ResourceTypeMarker for ManagerProposeElementRequest {
4199 type Borrowed<'a> = &'a mut Self;
4200 fn take_or_borrow<'a>(
4201 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4202 ) -> Self::Borrowed<'a> {
4203 value
4204 }
4205 }
4206
4207 unsafe impl fidl::encoding::TypeMarker for ManagerProposeElementRequest {
4208 type Owned = Self;
4209
4210 #[inline(always)]
4211 fn inline_align(_context: fidl::encoding::Context) -> usize {
4212 8
4213 }
4214
4215 #[inline(always)]
4216 fn inline_size(_context: fidl::encoding::Context) -> usize {
4217 24
4218 }
4219 }
4220
4221 unsafe impl
4222 fidl::encoding::Encode<
4223 ManagerProposeElementRequest,
4224 fidl::encoding::DefaultFuchsiaResourceDialect,
4225 > for &mut ManagerProposeElementRequest
4226 {
4227 #[inline]
4228 unsafe fn encode(
4229 self,
4230 encoder: &mut fidl::encoding::Encoder<
4231 '_,
4232 fidl::encoding::DefaultFuchsiaResourceDialect,
4233 >,
4234 offset: usize,
4235 _depth: fidl::encoding::Depth,
4236 ) -> fidl::Result<()> {
4237 encoder.debug_check_bounds::<ManagerProposeElementRequest>(offset);
4238 fidl::encoding::Encode::<
4240 ManagerProposeElementRequest,
4241 fidl::encoding::DefaultFuchsiaResourceDialect,
4242 >::encode(
4243 (
4244 <Spec as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.spec),
4245 <fidl::encoding::Optional<
4246 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
4247 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
4248 &mut self.controller
4249 ),
4250 ),
4251 encoder,
4252 offset,
4253 _depth,
4254 )
4255 }
4256 }
4257 unsafe impl<
4258 T0: fidl::encoding::Encode<Spec, fidl::encoding::DefaultFuchsiaResourceDialect>,
4259 T1: fidl::encoding::Encode<
4260 fidl::encoding::Optional<
4261 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
4262 >,
4263 fidl::encoding::DefaultFuchsiaResourceDialect,
4264 >,
4265 >
4266 fidl::encoding::Encode<
4267 ManagerProposeElementRequest,
4268 fidl::encoding::DefaultFuchsiaResourceDialect,
4269 > for (T0, T1)
4270 {
4271 #[inline]
4272 unsafe fn encode(
4273 self,
4274 encoder: &mut fidl::encoding::Encoder<
4275 '_,
4276 fidl::encoding::DefaultFuchsiaResourceDialect,
4277 >,
4278 offset: usize,
4279 depth: fidl::encoding::Depth,
4280 ) -> fidl::Result<()> {
4281 encoder.debug_check_bounds::<ManagerProposeElementRequest>(offset);
4282 unsafe {
4285 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
4286 (ptr as *mut u64).write_unaligned(0);
4287 }
4288 self.0.encode(encoder, offset + 0, depth)?;
4290 self.1.encode(encoder, offset + 16, depth)?;
4291 Ok(())
4292 }
4293 }
4294
4295 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
4296 for ManagerProposeElementRequest
4297 {
4298 #[inline(always)]
4299 fn new_empty() -> Self {
4300 Self {
4301 spec: fidl::new_empty!(Spec, fidl::encoding::DefaultFuchsiaResourceDialect),
4302 controller: fidl::new_empty!(
4303 fidl::encoding::Optional<
4304 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
4305 >,
4306 fidl::encoding::DefaultFuchsiaResourceDialect
4307 ),
4308 }
4309 }
4310
4311 #[inline]
4312 unsafe fn decode(
4313 &mut self,
4314 decoder: &mut fidl::encoding::Decoder<
4315 '_,
4316 fidl::encoding::DefaultFuchsiaResourceDialect,
4317 >,
4318 offset: usize,
4319 _depth: fidl::encoding::Depth,
4320 ) -> fidl::Result<()> {
4321 decoder.debug_check_bounds::<Self>(offset);
4322 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
4324 let padval = unsafe { (ptr as *const u64).read_unaligned() };
4325 let mask = 0xffffffff00000000u64;
4326 let maskedval = padval & mask;
4327 if maskedval != 0 {
4328 return Err(fidl::Error::NonZeroPadding {
4329 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
4330 });
4331 }
4332 fidl::decode!(
4333 Spec,
4334 fidl::encoding::DefaultFuchsiaResourceDialect,
4335 &mut self.spec,
4336 decoder,
4337 offset + 0,
4338 _depth
4339 )?;
4340 fidl::decode!(
4341 fidl::encoding::Optional<
4342 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
4343 >,
4344 fidl::encoding::DefaultFuchsiaResourceDialect,
4345 &mut self.controller,
4346 decoder,
4347 offset + 16,
4348 _depth
4349 )?;
4350 Ok(())
4351 }
4352 }
4353
4354 impl Spec {
4355 #[inline(always)]
4356 fn max_ordinal_present(&self) -> u64 {
4357 if let Some(_) = self.annotations {
4358 return 2;
4359 }
4360 if let Some(_) = self.component_url {
4361 return 1;
4362 }
4363 0
4364 }
4365 }
4366
4367 impl fidl::encoding::ResourceTypeMarker for Spec {
4368 type Borrowed<'a> = &'a mut Self;
4369 fn take_or_borrow<'a>(
4370 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4371 ) -> Self::Borrowed<'a> {
4372 value
4373 }
4374 }
4375
4376 unsafe impl fidl::encoding::TypeMarker for Spec {
4377 type Owned = Self;
4378
4379 #[inline(always)]
4380 fn inline_align(_context: fidl::encoding::Context) -> usize {
4381 8
4382 }
4383
4384 #[inline(always)]
4385 fn inline_size(_context: fidl::encoding::Context) -> usize {
4386 16
4387 }
4388 }
4389
4390 unsafe impl fidl::encoding::Encode<Spec, fidl::encoding::DefaultFuchsiaResourceDialect>
4391 for &mut Spec
4392 {
4393 unsafe fn encode(
4394 self,
4395 encoder: &mut fidl::encoding::Encoder<
4396 '_,
4397 fidl::encoding::DefaultFuchsiaResourceDialect,
4398 >,
4399 offset: usize,
4400 mut depth: fidl::encoding::Depth,
4401 ) -> fidl::Result<()> {
4402 encoder.debug_check_bounds::<Spec>(offset);
4403 let max_ordinal: u64 = self.max_ordinal_present();
4405 encoder.write_num(max_ordinal, offset);
4406 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4407 if max_ordinal == 0 {
4409 return Ok(());
4410 }
4411 depth.increment()?;
4412 let envelope_size = 8;
4413 let bytes_len = max_ordinal as usize * envelope_size;
4414 #[allow(unused_variables)]
4415 let offset = encoder.out_of_line_offset(bytes_len);
4416 let mut _prev_end_offset: usize = 0;
4417 if 1 > max_ordinal {
4418 return Ok(());
4419 }
4420
4421 let cur_offset: usize = (1 - 1) * envelope_size;
4424
4425 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4427
4428 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<4096>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4433 self.component_url.as_ref().map(<fidl::encoding::BoundedString<4096> as fidl::encoding::ValueTypeMarker>::borrow),
4434 encoder, offset + cur_offset, depth
4435 )?;
4436
4437 _prev_end_offset = cur_offset + envelope_size;
4438 if 2 > max_ordinal {
4439 return Ok(());
4440 }
4441
4442 let cur_offset: usize = (2 - 1) * envelope_size;
4445
4446 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4448
4449 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4454 self.annotations.as_mut().map(<fidl::encoding::Vector<Annotation, 1024> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
4455 encoder, offset + cur_offset, depth
4456 )?;
4457
4458 _prev_end_offset = cur_offset + envelope_size;
4459
4460 Ok(())
4461 }
4462 }
4463
4464 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for Spec {
4465 #[inline(always)]
4466 fn new_empty() -> Self {
4467 Self::default()
4468 }
4469
4470 unsafe fn decode(
4471 &mut self,
4472 decoder: &mut fidl::encoding::Decoder<
4473 '_,
4474 fidl::encoding::DefaultFuchsiaResourceDialect,
4475 >,
4476 offset: usize,
4477 mut depth: fidl::encoding::Depth,
4478 ) -> fidl::Result<()> {
4479 decoder.debug_check_bounds::<Self>(offset);
4480 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4481 None => return Err(fidl::Error::NotNullable),
4482 Some(len) => len,
4483 };
4484 if len == 0 {
4486 return Ok(());
4487 };
4488 depth.increment()?;
4489 let envelope_size = 8;
4490 let bytes_len = len * envelope_size;
4491 let offset = decoder.out_of_line_offset(bytes_len)?;
4492 let mut _next_ordinal_to_read = 0;
4494 let mut next_offset = offset;
4495 let end_offset = offset + bytes_len;
4496 _next_ordinal_to_read += 1;
4497 if next_offset >= end_offset {
4498 return Ok(());
4499 }
4500
4501 while _next_ordinal_to_read < 1 {
4503 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4504 _next_ordinal_to_read += 1;
4505 next_offset += envelope_size;
4506 }
4507
4508 let next_out_of_line = decoder.next_out_of_line();
4509 let handles_before = decoder.remaining_handles();
4510 if let Some((inlined, num_bytes, num_handles)) =
4511 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4512 {
4513 let member_inline_size = <fidl::encoding::BoundedString<4096> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4514 if inlined != (member_inline_size <= 4) {
4515 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4516 }
4517 let inner_offset;
4518 let mut inner_depth = depth.clone();
4519 if inlined {
4520 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4521 inner_offset = next_offset;
4522 } else {
4523 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4524 inner_depth.increment()?;
4525 }
4526 let val_ref = self.component_url.get_or_insert_with(|| {
4527 fidl::new_empty!(
4528 fidl::encoding::BoundedString<4096>,
4529 fidl::encoding::DefaultFuchsiaResourceDialect
4530 )
4531 });
4532 fidl::decode!(
4533 fidl::encoding::BoundedString<4096>,
4534 fidl::encoding::DefaultFuchsiaResourceDialect,
4535 val_ref,
4536 decoder,
4537 inner_offset,
4538 inner_depth
4539 )?;
4540 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4541 {
4542 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4543 }
4544 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4545 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4546 }
4547 }
4548
4549 next_offset += envelope_size;
4550 _next_ordinal_to_read += 1;
4551 if next_offset >= end_offset {
4552 return Ok(());
4553 }
4554
4555 while _next_ordinal_to_read < 2 {
4557 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4558 _next_ordinal_to_read += 1;
4559 next_offset += envelope_size;
4560 }
4561
4562 let next_out_of_line = decoder.next_out_of_line();
4563 let handles_before = decoder.remaining_handles();
4564 if let Some((inlined, num_bytes, num_handles)) =
4565 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4566 {
4567 let member_inline_size = <fidl::encoding::Vector<Annotation, 1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4568 if inlined != (member_inline_size <= 4) {
4569 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4570 }
4571 let inner_offset;
4572 let mut inner_depth = depth.clone();
4573 if inlined {
4574 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4575 inner_offset = next_offset;
4576 } else {
4577 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4578 inner_depth.increment()?;
4579 }
4580 let val_ref =
4581 self.annotations.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<Annotation, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect));
4582 fidl::decode!(fidl::encoding::Vector<Annotation, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4583 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4584 {
4585 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4586 }
4587 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4588 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4589 }
4590 }
4591
4592 next_offset += envelope_size;
4593
4594 while next_offset < end_offset {
4596 _next_ordinal_to_read += 1;
4597 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4598 next_offset += envelope_size;
4599 }
4600
4601 Ok(())
4602 }
4603 }
4604
4605 impl ViewSpec {
4606 #[inline(always)]
4607 fn max_ordinal_present(&self) -> u64 {
4608 if let Some(_) = self.viewport_creation_token {
4609 return 4;
4610 }
4611 if let Some(_) = self.annotations {
4612 return 3;
4613 }
4614 if let Some(_) = self.view_ref {
4615 return 2;
4616 }
4617 if let Some(_) = self.view_holder_token {
4618 return 1;
4619 }
4620 0
4621 }
4622 }
4623
4624 impl fidl::encoding::ResourceTypeMarker for ViewSpec {
4625 type Borrowed<'a> = &'a mut Self;
4626 fn take_or_borrow<'a>(
4627 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
4628 ) -> Self::Borrowed<'a> {
4629 value
4630 }
4631 }
4632
4633 unsafe impl fidl::encoding::TypeMarker for ViewSpec {
4634 type Owned = Self;
4635
4636 #[inline(always)]
4637 fn inline_align(_context: fidl::encoding::Context) -> usize {
4638 8
4639 }
4640
4641 #[inline(always)]
4642 fn inline_size(_context: fidl::encoding::Context) -> usize {
4643 16
4644 }
4645 }
4646
4647 unsafe impl fidl::encoding::Encode<ViewSpec, fidl::encoding::DefaultFuchsiaResourceDialect>
4648 for &mut ViewSpec
4649 {
4650 unsafe fn encode(
4651 self,
4652 encoder: &mut fidl::encoding::Encoder<
4653 '_,
4654 fidl::encoding::DefaultFuchsiaResourceDialect,
4655 >,
4656 offset: usize,
4657 mut depth: fidl::encoding::Depth,
4658 ) -> fidl::Result<()> {
4659 encoder.debug_check_bounds::<ViewSpec>(offset);
4660 let max_ordinal: u64 = self.max_ordinal_present();
4662 encoder.write_num(max_ordinal, offset);
4663 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4664 if max_ordinal == 0 {
4666 return Ok(());
4667 }
4668 depth.increment()?;
4669 let envelope_size = 8;
4670 let bytes_len = max_ordinal as usize * envelope_size;
4671 #[allow(unused_variables)]
4672 let offset = encoder.out_of_line_offset(bytes_len);
4673 let mut _prev_end_offset: usize = 0;
4674 if 1 > max_ordinal {
4675 return Ok(());
4676 }
4677
4678 let cur_offset: usize = (1 - 1) * envelope_size;
4681
4682 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4684
4685 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_ui_views::ViewHolderToken, fidl::encoding::DefaultFuchsiaResourceDialect>(
4690 self.view_holder_token.as_mut().map(<fidl_fuchsia_ui_views::ViewHolderToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
4691 encoder, offset + cur_offset, depth
4692 )?;
4693
4694 _prev_end_offset = cur_offset + envelope_size;
4695 if 2 > max_ordinal {
4696 return Ok(());
4697 }
4698
4699 let cur_offset: usize = (2 - 1) * envelope_size;
4702
4703 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4705
4706 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_ui_views::ViewRef, fidl::encoding::DefaultFuchsiaResourceDialect>(
4711 self.view_ref.as_mut().map(<fidl_fuchsia_ui_views::ViewRef as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
4712 encoder, offset + cur_offset, depth
4713 )?;
4714
4715 _prev_end_offset = cur_offset + envelope_size;
4716 if 3 > max_ordinal {
4717 return Ok(());
4718 }
4719
4720 let cur_offset: usize = (3 - 1) * envelope_size;
4723
4724 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4726
4727 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<Annotation, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect>(
4732 self.annotations.as_mut().map(<fidl::encoding::Vector<Annotation, 1024> as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
4733 encoder, offset + cur_offset, depth
4734 )?;
4735
4736 _prev_end_offset = cur_offset + envelope_size;
4737 if 4 > max_ordinal {
4738 return Ok(());
4739 }
4740
4741 let cur_offset: usize = (4 - 1) * envelope_size;
4744
4745 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4747
4748 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_ui_views::ViewportCreationToken, fidl::encoding::DefaultFuchsiaResourceDialect>(
4753 self.viewport_creation_token.as_mut().map(<fidl_fuchsia_ui_views::ViewportCreationToken as fidl::encoding::ResourceTypeMarker>::take_or_borrow),
4754 encoder, offset + cur_offset, depth
4755 )?;
4756
4757 _prev_end_offset = cur_offset + envelope_size;
4758
4759 Ok(())
4760 }
4761 }
4762
4763 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect> for ViewSpec {
4764 #[inline(always)]
4765 fn new_empty() -> Self {
4766 Self::default()
4767 }
4768
4769 unsafe fn decode(
4770 &mut self,
4771 decoder: &mut fidl::encoding::Decoder<
4772 '_,
4773 fidl::encoding::DefaultFuchsiaResourceDialect,
4774 >,
4775 offset: usize,
4776 mut depth: fidl::encoding::Depth,
4777 ) -> fidl::Result<()> {
4778 decoder.debug_check_bounds::<Self>(offset);
4779 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4780 None => return Err(fidl::Error::NotNullable),
4781 Some(len) => len,
4782 };
4783 if len == 0 {
4785 return Ok(());
4786 };
4787 depth.increment()?;
4788 let envelope_size = 8;
4789 let bytes_len = len * envelope_size;
4790 let offset = decoder.out_of_line_offset(bytes_len)?;
4791 let mut _next_ordinal_to_read = 0;
4793 let mut next_offset = offset;
4794 let end_offset = offset + bytes_len;
4795 _next_ordinal_to_read += 1;
4796 if next_offset >= end_offset {
4797 return Ok(());
4798 }
4799
4800 while _next_ordinal_to_read < 1 {
4802 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4803 _next_ordinal_to_read += 1;
4804 next_offset += envelope_size;
4805 }
4806
4807 let next_out_of_line = decoder.next_out_of_line();
4808 let handles_before = decoder.remaining_handles();
4809 if let Some((inlined, num_bytes, num_handles)) =
4810 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4811 {
4812 let member_inline_size = <fidl_fuchsia_ui_views::ViewHolderToken as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4813 if inlined != (member_inline_size <= 4) {
4814 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4815 }
4816 let inner_offset;
4817 let mut inner_depth = depth.clone();
4818 if inlined {
4819 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4820 inner_offset = next_offset;
4821 } else {
4822 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4823 inner_depth.increment()?;
4824 }
4825 let val_ref = self.view_holder_token.get_or_insert_with(|| {
4826 fidl::new_empty!(
4827 fidl_fuchsia_ui_views::ViewHolderToken,
4828 fidl::encoding::DefaultFuchsiaResourceDialect
4829 )
4830 });
4831 fidl::decode!(
4832 fidl_fuchsia_ui_views::ViewHolderToken,
4833 fidl::encoding::DefaultFuchsiaResourceDialect,
4834 val_ref,
4835 decoder,
4836 inner_offset,
4837 inner_depth
4838 )?;
4839 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4840 {
4841 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4842 }
4843 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4844 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4845 }
4846 }
4847
4848 next_offset += envelope_size;
4849 _next_ordinal_to_read += 1;
4850 if next_offset >= end_offset {
4851 return Ok(());
4852 }
4853
4854 while _next_ordinal_to_read < 2 {
4856 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4857 _next_ordinal_to_read += 1;
4858 next_offset += envelope_size;
4859 }
4860
4861 let next_out_of_line = decoder.next_out_of_line();
4862 let handles_before = decoder.remaining_handles();
4863 if let Some((inlined, num_bytes, num_handles)) =
4864 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4865 {
4866 let member_inline_size =
4867 <fidl_fuchsia_ui_views::ViewRef as fidl::encoding::TypeMarker>::inline_size(
4868 decoder.context,
4869 );
4870 if inlined != (member_inline_size <= 4) {
4871 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4872 }
4873 let inner_offset;
4874 let mut inner_depth = depth.clone();
4875 if inlined {
4876 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4877 inner_offset = next_offset;
4878 } else {
4879 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4880 inner_depth.increment()?;
4881 }
4882 let val_ref = self.view_ref.get_or_insert_with(|| {
4883 fidl::new_empty!(
4884 fidl_fuchsia_ui_views::ViewRef,
4885 fidl::encoding::DefaultFuchsiaResourceDialect
4886 )
4887 });
4888 fidl::decode!(
4889 fidl_fuchsia_ui_views::ViewRef,
4890 fidl::encoding::DefaultFuchsiaResourceDialect,
4891 val_ref,
4892 decoder,
4893 inner_offset,
4894 inner_depth
4895 )?;
4896 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4897 {
4898 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4899 }
4900 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4901 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4902 }
4903 }
4904
4905 next_offset += envelope_size;
4906 _next_ordinal_to_read += 1;
4907 if next_offset >= end_offset {
4908 return Ok(());
4909 }
4910
4911 while _next_ordinal_to_read < 3 {
4913 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4914 _next_ordinal_to_read += 1;
4915 next_offset += envelope_size;
4916 }
4917
4918 let next_out_of_line = decoder.next_out_of_line();
4919 let handles_before = decoder.remaining_handles();
4920 if let Some((inlined, num_bytes, num_handles)) =
4921 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4922 {
4923 let member_inline_size = <fidl::encoding::Vector<Annotation, 1024> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4924 if inlined != (member_inline_size <= 4) {
4925 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4926 }
4927 let inner_offset;
4928 let mut inner_depth = depth.clone();
4929 if inlined {
4930 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4931 inner_offset = next_offset;
4932 } else {
4933 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4934 inner_depth.increment()?;
4935 }
4936 let val_ref =
4937 self.annotations.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<Annotation, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect));
4938 fidl::decode!(fidl::encoding::Vector<Annotation, 1024>, fidl::encoding::DefaultFuchsiaResourceDialect, val_ref, decoder, inner_offset, inner_depth)?;
4939 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4940 {
4941 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4942 }
4943 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4944 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4945 }
4946 }
4947
4948 next_offset += envelope_size;
4949 _next_ordinal_to_read += 1;
4950 if next_offset >= end_offset {
4951 return Ok(());
4952 }
4953
4954 while _next_ordinal_to_read < 4 {
4956 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4957 _next_ordinal_to_read += 1;
4958 next_offset += envelope_size;
4959 }
4960
4961 let next_out_of_line = decoder.next_out_of_line();
4962 let handles_before = decoder.remaining_handles();
4963 if let Some((inlined, num_bytes, num_handles)) =
4964 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4965 {
4966 let member_inline_size = <fidl_fuchsia_ui_views::ViewportCreationToken as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4967 if inlined != (member_inline_size <= 4) {
4968 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4969 }
4970 let inner_offset;
4971 let mut inner_depth = depth.clone();
4972 if inlined {
4973 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4974 inner_offset = next_offset;
4975 } else {
4976 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4977 inner_depth.increment()?;
4978 }
4979 let val_ref = self.viewport_creation_token.get_or_insert_with(|| {
4980 fidl::new_empty!(
4981 fidl_fuchsia_ui_views::ViewportCreationToken,
4982 fidl::encoding::DefaultFuchsiaResourceDialect
4983 )
4984 });
4985 fidl::decode!(
4986 fidl_fuchsia_ui_views::ViewportCreationToken,
4987 fidl::encoding::DefaultFuchsiaResourceDialect,
4988 val_ref,
4989 decoder,
4990 inner_offset,
4991 inner_depth
4992 )?;
4993 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4994 {
4995 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4996 }
4997 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4998 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4999 }
5000 }
5001
5002 next_offset += envelope_size;
5003
5004 while next_offset < end_offset {
5006 _next_ordinal_to_read += 1;
5007 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5008 next_offset += envelope_size;
5009 }
5010
5011 Ok(())
5012 }
5013 }
5014
5015 impl fidl::encoding::ResourceTypeMarker for AnnotationValue {
5016 type Borrowed<'a> = &'a mut Self;
5017 fn take_or_borrow<'a>(
5018 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
5019 ) -> Self::Borrowed<'a> {
5020 value
5021 }
5022 }
5023
5024 unsafe impl fidl::encoding::TypeMarker for AnnotationValue {
5025 type Owned = Self;
5026
5027 #[inline(always)]
5028 fn inline_align(_context: fidl::encoding::Context) -> usize {
5029 8
5030 }
5031
5032 #[inline(always)]
5033 fn inline_size(_context: fidl::encoding::Context) -> usize {
5034 16
5035 }
5036 }
5037
5038 unsafe impl
5039 fidl::encoding::Encode<AnnotationValue, fidl::encoding::DefaultFuchsiaResourceDialect>
5040 for &mut AnnotationValue
5041 {
5042 #[inline]
5043 unsafe fn encode(
5044 self,
5045 encoder: &mut fidl::encoding::Encoder<
5046 '_,
5047 fidl::encoding::DefaultFuchsiaResourceDialect,
5048 >,
5049 offset: usize,
5050 _depth: fidl::encoding::Depth,
5051 ) -> fidl::Result<()> {
5052 encoder.debug_check_bounds::<AnnotationValue>(offset);
5053 encoder.write_num::<u64>(self.ordinal(), offset);
5054 match self {
5055 AnnotationValue::Text(ref val) => {
5056 fidl::encoding::encode_in_envelope::<fidl::encoding::UnboundedString, fidl::encoding::DefaultFuchsiaResourceDialect>(
5057 <fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(val),
5058 encoder, offset + 8, _depth
5059 )
5060 }
5061 AnnotationValue::Buffer(ref mut val) => {
5062 fidl::encoding::encode_in_envelope::<fidl_fuchsia_mem::Buffer, fidl::encoding::DefaultFuchsiaResourceDialect>(
5063 <fidl_fuchsia_mem::Buffer as fidl::encoding::ResourceTypeMarker>::take_or_borrow(val),
5064 encoder, offset + 8, _depth
5065 )
5066 }
5067 }
5068 }
5069 }
5070
5071 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
5072 for AnnotationValue
5073 {
5074 #[inline(always)]
5075 fn new_empty() -> Self {
5076 Self::Text(fidl::new_empty!(
5077 fidl::encoding::UnboundedString,
5078 fidl::encoding::DefaultFuchsiaResourceDialect
5079 ))
5080 }
5081
5082 #[inline]
5083 unsafe fn decode(
5084 &mut self,
5085 decoder: &mut fidl::encoding::Decoder<
5086 '_,
5087 fidl::encoding::DefaultFuchsiaResourceDialect,
5088 >,
5089 offset: usize,
5090 mut depth: fidl::encoding::Depth,
5091 ) -> fidl::Result<()> {
5092 decoder.debug_check_bounds::<Self>(offset);
5093 #[allow(unused_variables)]
5094 let next_out_of_line = decoder.next_out_of_line();
5095 let handles_before = decoder.remaining_handles();
5096 let (ordinal, inlined, num_bytes, num_handles) =
5097 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
5098
5099 let member_inline_size = match ordinal {
5100 1 => <fidl::encoding::UnboundedString as fidl::encoding::TypeMarker>::inline_size(
5101 decoder.context,
5102 ),
5103 2 => <fidl_fuchsia_mem::Buffer as fidl::encoding::TypeMarker>::inline_size(
5104 decoder.context,
5105 ),
5106 _ => return Err(fidl::Error::UnknownUnionTag),
5107 };
5108
5109 if inlined != (member_inline_size <= 4) {
5110 return Err(fidl::Error::InvalidInlineBitInEnvelope);
5111 }
5112 let _inner_offset;
5113 if inlined {
5114 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
5115 _inner_offset = offset + 8;
5116 } else {
5117 depth.increment()?;
5118 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5119 }
5120 match ordinal {
5121 1 => {
5122 #[allow(irrefutable_let_patterns)]
5123 if let AnnotationValue::Text(_) = self {
5124 } else {
5126 *self = AnnotationValue::Text(fidl::new_empty!(
5128 fidl::encoding::UnboundedString,
5129 fidl::encoding::DefaultFuchsiaResourceDialect
5130 ));
5131 }
5132 #[allow(irrefutable_let_patterns)]
5133 if let AnnotationValue::Text(ref mut val) = self {
5134 fidl::decode!(
5135 fidl::encoding::UnboundedString,
5136 fidl::encoding::DefaultFuchsiaResourceDialect,
5137 val,
5138 decoder,
5139 _inner_offset,
5140 depth
5141 )?;
5142 } else {
5143 unreachable!()
5144 }
5145 }
5146 2 => {
5147 #[allow(irrefutable_let_patterns)]
5148 if let AnnotationValue::Buffer(_) = self {
5149 } else {
5151 *self = AnnotationValue::Buffer(fidl::new_empty!(
5153 fidl_fuchsia_mem::Buffer,
5154 fidl::encoding::DefaultFuchsiaResourceDialect
5155 ));
5156 }
5157 #[allow(irrefutable_let_patterns)]
5158 if let AnnotationValue::Buffer(ref mut val) = self {
5159 fidl::decode!(
5160 fidl_fuchsia_mem::Buffer,
5161 fidl::encoding::DefaultFuchsiaResourceDialect,
5162 val,
5163 decoder,
5164 _inner_offset,
5165 depth
5166 )?;
5167 } else {
5168 unreachable!()
5169 }
5170 }
5171 ordinal => panic!("unexpected ordinal {:?}", ordinal),
5172 }
5173 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
5174 return Err(fidl::Error::InvalidNumBytesInEnvelope);
5175 }
5176 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5177 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5178 }
5179 Ok(())
5180 }
5181 }
5182}