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