fidl_fuchsia_element_common/
fidl_fuchsia_element_common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11/// A list of annotation keys.
12pub type AnnotationKeys = Vec<AnnotationKey>;
13
14/// The name of the element in its collection. If not provided to `ProposeElement`, a random name is
15/// chosen.
16pub const ANNOTATION_KEY_NAME: &str = "name";
17
18/// If present, the element will persist over a reboot.
19pub const ANNOTATION_KEY_PERSIST_ELEMENT: &str = "persist_element";
20
21/// The component URL of the element.
22pub const ANNOTATION_KEY_URL: &str = "url";
23
24pub const MANAGER_NAMESPACE: &str = "element_manager";
25
26/// Maximum number of annotations for a single element or view.
27pub const MAX_ANNOTATIONS_PER_ELEMENT: u32 = 1024;
28
29/// Maximum length of `AnnotationKey.namespace`.
30pub const MAX_ANNOTATION_KEY_NAMESPACE_SIZE: u32 = 128;
31
32/// Maximum length of `AnnotationKey.value`.
33pub const MAX_ANNOTATION_KEY_VALUE_SIZE: u32 = 128;
34
35/// An error returned from `ElementController/GetAnnotations`.
36#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
37#[repr(u32)]
38pub enum GetAnnotationsError {
39    /// The `AnnotationValue.buffer` of an annotation could not be read.
40    BufferReadFailed = 1,
41}
42
43impl GetAnnotationsError {
44    #[inline]
45    pub fn from_primitive(prim: u32) -> Option<Self> {
46        match prim {
47            1 => Some(Self::BufferReadFailed),
48            _ => None,
49        }
50    }
51
52    #[inline]
53    pub const fn into_primitive(self) -> u32 {
54        self as u32
55    }
56}
57
58#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
59#[repr(u32)]
60pub enum ManagerError {
61    /// The element spec was malformed.
62    InvalidArgs = 1,
63    /// The element's component URL could not be resolved.
64    NotFound = 2,
65    /// Unable to persist a proposed element because there was an issue writing to persistent
66    /// storage.  The proposed element will not have been started.
67    UnableToPersist = 3,
68}
69
70impl ManagerError {
71    #[inline]
72    pub fn from_primitive(prim: u32) -> Option<Self> {
73        match prim {
74            1 => Some(Self::InvalidArgs),
75            2 => Some(Self::NotFound),
76            3 => Some(Self::UnableToPersist),
77            _ => None,
78        }
79    }
80
81    #[inline]
82    pub const fn into_primitive(self) -> u32 {
83        self as u32
84    }
85}
86
87/// An error returned when `GraphicalPresenter` fails to present a view.
88#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
89#[repr(u32)]
90pub enum PresentViewError {
91    /// The provided `ViewSpec` is invalid.
92    InvalidArgs = 1,
93}
94
95impl PresentViewError {
96    #[inline]
97    pub fn from_primitive(prim: u32) -> Option<Self> {
98        match prim {
99            1 => Some(Self::InvalidArgs),
100            _ => None,
101        }
102    }
103
104    #[inline]
105    pub const fn into_primitive(self) -> u32 {
106        self as u32
107    }
108}
109
110/// Errors that can be returned when using the Manager protocol.
111#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
112#[repr(u32)]
113pub enum ProposeElementError {
114    /// The element spec was malformed.
115    InvalidArgs = 1,
116    /// The element's component URL could not be resolved.
117    NotFound = 2,
118}
119
120impl ProposeElementError {
121    #[inline]
122    pub fn from_primitive(prim: u32) -> Option<Self> {
123        match prim {
124            1 => Some(Self::InvalidArgs),
125            2 => Some(Self::NotFound),
126            _ => None,
127        }
128    }
129
130    #[inline]
131    pub const fn into_primitive(self) -> u32 {
132        self as u32
133    }
134}
135
136/// An error returned from `AnnotationController/UpdateAnnotations`
137#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
138#[repr(u32)]
139pub enum UpdateAnnotationsError {
140    /// The arguments passed to `UpdateAnnotations` are malformed.
141    InvalidArgs = 1,
142    /// The total number of annotations will exceed [`MAX_ANNOTATIONS_PER_ELEMENT`]
143    /// as a result of updating the annotations.
144    TooManyAnnotations = 2,
145}
146
147impl UpdateAnnotationsError {
148    #[inline]
149    pub fn from_primitive(prim: u32) -> Option<Self> {
150        match prim {
151            1 => Some(Self::InvalidArgs),
152            2 => Some(Self::TooManyAnnotations),
153            _ => None,
154        }
155    }
156
157    #[inline]
158    pub const fn into_primitive(self) -> u32 {
159        self as u32
160    }
161}
162
163/// An error returned from `AnnotationController/WatchAnnotations` and
164/// `ElementController/WatchAnnotations`.
165#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
166pub enum WatchAnnotationsError {
167    /// The `AnnotationValue.buffer` of an annotation could not be read.
168    BufferReadFailed,
169    #[doc(hidden)]
170    __SourceBreaking { unknown_ordinal: u32 },
171}
172
173/// Pattern that matches an unknown `WatchAnnotationsError` member.
174#[macro_export]
175macro_rules! WatchAnnotationsErrorUnknown {
176    () => {
177        _
178    };
179}
180
181impl WatchAnnotationsError {
182    #[inline]
183    pub fn from_primitive(prim: u32) -> Option<Self> {
184        match prim {
185            1 => Some(Self::BufferReadFailed),
186            _ => None,
187        }
188    }
189
190    #[inline]
191    pub fn from_primitive_allow_unknown(prim: u32) -> Self {
192        match prim {
193            1 => Self::BufferReadFailed,
194            unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
195        }
196    }
197
198    #[inline]
199    pub fn unknown() -> Self {
200        Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
201    }
202
203    #[inline]
204    pub const fn into_primitive(self) -> u32 {
205        match self {
206            Self::BufferReadFailed => 1,
207            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
208        }
209    }
210
211    #[inline]
212    pub fn is_unknown(&self) -> bool {
213        match self {
214            Self::__SourceBreaking { unknown_ordinal: _ } => true,
215            _ => false,
216        }
217    }
218}
219
220/// The key of an [`fuchsia.element/Annotation`].
221#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
222pub struct AnnotationKey {
223    /// A namespace that disambiguates groups of keys across clients.
224    ///
225    /// This is intended to group related keys together under the same
226    /// identifier, and avoid naming collisions. For example, a session may
227    /// use a custom namespace to define annotations that are specific
228    /// to its implementation.
229    ///
230    /// The namespace is required and must be non-empty.
231    ///
232    /// The namespace "global" is represents the global namespace, reserved for
233    /// annotations common across many products and session components.
234    ///
235    /// To ensure compatibility, clients should use a unique namespace,
236    /// like a UUID or the client's component URL, when introducing new keys.
237    pub namespace: String,
238    /// An identifier for this annotation, uniquely identifying the annotation
239    /// within `namespace`.
240    pub value: String,
241}
242
243impl fidl::Persistable for AnnotationKey {}
244
245#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
246pub struct ManagerRemoveElementRequest {
247    pub name: String,
248}
249
250impl fidl::Persistable for ManagerRemoveElementRequest {}
251
252mod internal {
253    use super::*;
254    unsafe impl fidl::encoding::TypeMarker for GetAnnotationsError {
255        type Owned = Self;
256
257        #[inline(always)]
258        fn inline_align(_context: fidl::encoding::Context) -> usize {
259            std::mem::align_of::<u32>()
260        }
261
262        #[inline(always)]
263        fn inline_size(_context: fidl::encoding::Context) -> usize {
264            std::mem::size_of::<u32>()
265        }
266
267        #[inline(always)]
268        fn encode_is_copy() -> bool {
269            true
270        }
271
272        #[inline(always)]
273        fn decode_is_copy() -> bool {
274            false
275        }
276    }
277
278    impl fidl::encoding::ValueTypeMarker for GetAnnotationsError {
279        type Borrowed<'a> = Self;
280        #[inline(always)]
281        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
282            *value
283        }
284    }
285
286    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
287        for GetAnnotationsError
288    {
289        #[inline]
290        unsafe fn encode(
291            self,
292            encoder: &mut fidl::encoding::Encoder<'_, D>,
293            offset: usize,
294            _depth: fidl::encoding::Depth,
295        ) -> fidl::Result<()> {
296            encoder.debug_check_bounds::<Self>(offset);
297            encoder.write_num(self.into_primitive(), offset);
298            Ok(())
299        }
300    }
301
302    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GetAnnotationsError {
303        #[inline(always)]
304        fn new_empty() -> Self {
305            Self::BufferReadFailed
306        }
307
308        #[inline]
309        unsafe fn decode(
310            &mut self,
311            decoder: &mut fidl::encoding::Decoder<'_, D>,
312            offset: usize,
313            _depth: fidl::encoding::Depth,
314        ) -> fidl::Result<()> {
315            decoder.debug_check_bounds::<Self>(offset);
316            let prim = decoder.read_num::<u32>(offset);
317
318            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
319            Ok(())
320        }
321    }
322    unsafe impl fidl::encoding::TypeMarker for ManagerError {
323        type Owned = Self;
324
325        #[inline(always)]
326        fn inline_align(_context: fidl::encoding::Context) -> usize {
327            std::mem::align_of::<u32>()
328        }
329
330        #[inline(always)]
331        fn inline_size(_context: fidl::encoding::Context) -> usize {
332            std::mem::size_of::<u32>()
333        }
334
335        #[inline(always)]
336        fn encode_is_copy() -> bool {
337            true
338        }
339
340        #[inline(always)]
341        fn decode_is_copy() -> bool {
342            false
343        }
344    }
345
346    impl fidl::encoding::ValueTypeMarker for ManagerError {
347        type Borrowed<'a> = Self;
348        #[inline(always)]
349        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
350            *value
351        }
352    }
353
354    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ManagerError {
355        #[inline]
356        unsafe fn encode(
357            self,
358            encoder: &mut fidl::encoding::Encoder<'_, D>,
359            offset: usize,
360            _depth: fidl::encoding::Depth,
361        ) -> fidl::Result<()> {
362            encoder.debug_check_bounds::<Self>(offset);
363            encoder.write_num(self.into_primitive(), offset);
364            Ok(())
365        }
366    }
367
368    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ManagerError {
369        #[inline(always)]
370        fn new_empty() -> Self {
371            Self::InvalidArgs
372        }
373
374        #[inline]
375        unsafe fn decode(
376            &mut self,
377            decoder: &mut fidl::encoding::Decoder<'_, D>,
378            offset: usize,
379            _depth: fidl::encoding::Depth,
380        ) -> fidl::Result<()> {
381            decoder.debug_check_bounds::<Self>(offset);
382            let prim = decoder.read_num::<u32>(offset);
383
384            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
385            Ok(())
386        }
387    }
388    unsafe impl fidl::encoding::TypeMarker for PresentViewError {
389        type Owned = Self;
390
391        #[inline(always)]
392        fn inline_align(_context: fidl::encoding::Context) -> usize {
393            std::mem::align_of::<u32>()
394        }
395
396        #[inline(always)]
397        fn inline_size(_context: fidl::encoding::Context) -> usize {
398            std::mem::size_of::<u32>()
399        }
400
401        #[inline(always)]
402        fn encode_is_copy() -> bool {
403            true
404        }
405
406        #[inline(always)]
407        fn decode_is_copy() -> bool {
408            false
409        }
410    }
411
412    impl fidl::encoding::ValueTypeMarker for PresentViewError {
413        type Borrowed<'a> = Self;
414        #[inline(always)]
415        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
416            *value
417        }
418    }
419
420    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
421        for PresentViewError
422    {
423        #[inline]
424        unsafe fn encode(
425            self,
426            encoder: &mut fidl::encoding::Encoder<'_, D>,
427            offset: usize,
428            _depth: fidl::encoding::Depth,
429        ) -> fidl::Result<()> {
430            encoder.debug_check_bounds::<Self>(offset);
431            encoder.write_num(self.into_primitive(), offset);
432            Ok(())
433        }
434    }
435
436    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PresentViewError {
437        #[inline(always)]
438        fn new_empty() -> Self {
439            Self::InvalidArgs
440        }
441
442        #[inline]
443        unsafe fn decode(
444            &mut self,
445            decoder: &mut fidl::encoding::Decoder<'_, D>,
446            offset: usize,
447            _depth: fidl::encoding::Depth,
448        ) -> fidl::Result<()> {
449            decoder.debug_check_bounds::<Self>(offset);
450            let prim = decoder.read_num::<u32>(offset);
451
452            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
453            Ok(())
454        }
455    }
456    unsafe impl fidl::encoding::TypeMarker for ProposeElementError {
457        type Owned = Self;
458
459        #[inline(always)]
460        fn inline_align(_context: fidl::encoding::Context) -> usize {
461            std::mem::align_of::<u32>()
462        }
463
464        #[inline(always)]
465        fn inline_size(_context: fidl::encoding::Context) -> usize {
466            std::mem::size_of::<u32>()
467        }
468
469        #[inline(always)]
470        fn encode_is_copy() -> bool {
471            true
472        }
473
474        #[inline(always)]
475        fn decode_is_copy() -> bool {
476            false
477        }
478    }
479
480    impl fidl::encoding::ValueTypeMarker for ProposeElementError {
481        type Borrowed<'a> = Self;
482        #[inline(always)]
483        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
484            *value
485        }
486    }
487
488    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
489        for ProposeElementError
490    {
491        #[inline]
492        unsafe fn encode(
493            self,
494            encoder: &mut fidl::encoding::Encoder<'_, D>,
495            offset: usize,
496            _depth: fidl::encoding::Depth,
497        ) -> fidl::Result<()> {
498            encoder.debug_check_bounds::<Self>(offset);
499            encoder.write_num(self.into_primitive(), offset);
500            Ok(())
501        }
502    }
503
504    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ProposeElementError {
505        #[inline(always)]
506        fn new_empty() -> Self {
507            Self::InvalidArgs
508        }
509
510        #[inline]
511        unsafe fn decode(
512            &mut self,
513            decoder: &mut fidl::encoding::Decoder<'_, D>,
514            offset: usize,
515            _depth: fidl::encoding::Depth,
516        ) -> fidl::Result<()> {
517            decoder.debug_check_bounds::<Self>(offset);
518            let prim = decoder.read_num::<u32>(offset);
519
520            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
521            Ok(())
522        }
523    }
524    unsafe impl fidl::encoding::TypeMarker for UpdateAnnotationsError {
525        type Owned = Self;
526
527        #[inline(always)]
528        fn inline_align(_context: fidl::encoding::Context) -> usize {
529            std::mem::align_of::<u32>()
530        }
531
532        #[inline(always)]
533        fn inline_size(_context: fidl::encoding::Context) -> usize {
534            std::mem::size_of::<u32>()
535        }
536
537        #[inline(always)]
538        fn encode_is_copy() -> bool {
539            true
540        }
541
542        #[inline(always)]
543        fn decode_is_copy() -> bool {
544            false
545        }
546    }
547
548    impl fidl::encoding::ValueTypeMarker for UpdateAnnotationsError {
549        type Borrowed<'a> = Self;
550        #[inline(always)]
551        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
552            *value
553        }
554    }
555
556    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
557        for UpdateAnnotationsError
558    {
559        #[inline]
560        unsafe fn encode(
561            self,
562            encoder: &mut fidl::encoding::Encoder<'_, D>,
563            offset: usize,
564            _depth: fidl::encoding::Depth,
565        ) -> fidl::Result<()> {
566            encoder.debug_check_bounds::<Self>(offset);
567            encoder.write_num(self.into_primitive(), offset);
568            Ok(())
569        }
570    }
571
572    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
573        for UpdateAnnotationsError
574    {
575        #[inline(always)]
576        fn new_empty() -> Self {
577            Self::InvalidArgs
578        }
579
580        #[inline]
581        unsafe fn decode(
582            &mut self,
583            decoder: &mut fidl::encoding::Decoder<'_, D>,
584            offset: usize,
585            _depth: fidl::encoding::Depth,
586        ) -> fidl::Result<()> {
587            decoder.debug_check_bounds::<Self>(offset);
588            let prim = decoder.read_num::<u32>(offset);
589
590            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
591            Ok(())
592        }
593    }
594    unsafe impl fidl::encoding::TypeMarker for WatchAnnotationsError {
595        type Owned = Self;
596
597        #[inline(always)]
598        fn inline_align(_context: fidl::encoding::Context) -> usize {
599            std::mem::align_of::<u32>()
600        }
601
602        #[inline(always)]
603        fn inline_size(_context: fidl::encoding::Context) -> usize {
604            std::mem::size_of::<u32>()
605        }
606
607        #[inline(always)]
608        fn encode_is_copy() -> bool {
609            false
610        }
611
612        #[inline(always)]
613        fn decode_is_copy() -> bool {
614            false
615        }
616    }
617
618    impl fidl::encoding::ValueTypeMarker for WatchAnnotationsError {
619        type Borrowed<'a> = Self;
620        #[inline(always)]
621        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
622            *value
623        }
624    }
625
626    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
627        for WatchAnnotationsError
628    {
629        #[inline]
630        unsafe fn encode(
631            self,
632            encoder: &mut fidl::encoding::Encoder<'_, D>,
633            offset: usize,
634            _depth: fidl::encoding::Depth,
635        ) -> fidl::Result<()> {
636            encoder.debug_check_bounds::<Self>(offset);
637            encoder.write_num(self.into_primitive(), offset);
638            Ok(())
639        }
640    }
641
642    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WatchAnnotationsError {
643        #[inline(always)]
644        fn new_empty() -> Self {
645            Self::unknown()
646        }
647
648        #[inline]
649        unsafe fn decode(
650            &mut self,
651            decoder: &mut fidl::encoding::Decoder<'_, D>,
652            offset: usize,
653            _depth: fidl::encoding::Depth,
654        ) -> fidl::Result<()> {
655            decoder.debug_check_bounds::<Self>(offset);
656            let prim = decoder.read_num::<u32>(offset);
657
658            *self = Self::from_primitive_allow_unknown(prim);
659            Ok(())
660        }
661    }
662
663    impl fidl::encoding::ValueTypeMarker for AnnotationKey {
664        type Borrowed<'a> = &'a Self;
665        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
666            value
667        }
668    }
669
670    unsafe impl fidl::encoding::TypeMarker for AnnotationKey {
671        type Owned = Self;
672
673        #[inline(always)]
674        fn inline_align(_context: fidl::encoding::Context) -> usize {
675            8
676        }
677
678        #[inline(always)]
679        fn inline_size(_context: fidl::encoding::Context) -> usize {
680            32
681        }
682    }
683
684    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AnnotationKey, D>
685        for &AnnotationKey
686    {
687        #[inline]
688        unsafe fn encode(
689            self,
690            encoder: &mut fidl::encoding::Encoder<'_, D>,
691            offset: usize,
692            _depth: fidl::encoding::Depth,
693        ) -> fidl::Result<()> {
694            encoder.debug_check_bounds::<AnnotationKey>(offset);
695            // Delegate to tuple encoding.
696            fidl::encoding::Encode::<AnnotationKey, D>::encode(
697                (
698                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(
699                        &self.namespace,
700                    ),
701                    <fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(
702                        &self.value,
703                    ),
704                ),
705                encoder,
706                offset,
707                _depth,
708            )
709        }
710    }
711    unsafe impl<
712            D: fidl::encoding::ResourceDialect,
713            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
714            T1: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
715        > fidl::encoding::Encode<AnnotationKey, D> for (T0, T1)
716    {
717        #[inline]
718        unsafe fn encode(
719            self,
720            encoder: &mut fidl::encoding::Encoder<'_, D>,
721            offset: usize,
722            depth: fidl::encoding::Depth,
723        ) -> fidl::Result<()> {
724            encoder.debug_check_bounds::<AnnotationKey>(offset);
725            // Zero out padding regions. There's no need to apply masks
726            // because the unmasked parts will be overwritten by fields.
727            // Write the fields.
728            self.0.encode(encoder, offset + 0, depth)?;
729            self.1.encode(encoder, offset + 16, depth)?;
730            Ok(())
731        }
732    }
733
734    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AnnotationKey {
735        #[inline(always)]
736        fn new_empty() -> Self {
737            Self {
738                namespace: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
739                value: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
740            }
741        }
742
743        #[inline]
744        unsafe fn decode(
745            &mut self,
746            decoder: &mut fidl::encoding::Decoder<'_, D>,
747            offset: usize,
748            _depth: fidl::encoding::Depth,
749        ) -> fidl::Result<()> {
750            decoder.debug_check_bounds::<Self>(offset);
751            // Verify that padding bytes are zero.
752            fidl::decode!(
753                fidl::encoding::BoundedString<128>,
754                D,
755                &mut self.namespace,
756                decoder,
757                offset + 0,
758                _depth
759            )?;
760            fidl::decode!(
761                fidl::encoding::BoundedString<128>,
762                D,
763                &mut self.value,
764                decoder,
765                offset + 16,
766                _depth
767            )?;
768            Ok(())
769        }
770    }
771
772    impl fidl::encoding::ValueTypeMarker for ManagerRemoveElementRequest {
773        type Borrowed<'a> = &'a Self;
774        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
775            value
776        }
777    }
778
779    unsafe impl fidl::encoding::TypeMarker for ManagerRemoveElementRequest {
780        type Owned = Self;
781
782        #[inline(always)]
783        fn inline_align(_context: fidl::encoding::Context) -> usize {
784            8
785        }
786
787        #[inline(always)]
788        fn inline_size(_context: fidl::encoding::Context) -> usize {
789            16
790        }
791    }
792
793    unsafe impl<D: fidl::encoding::ResourceDialect>
794        fidl::encoding::Encode<ManagerRemoveElementRequest, D> for &ManagerRemoveElementRequest
795    {
796        #[inline]
797        unsafe fn encode(
798            self,
799            encoder: &mut fidl::encoding::Encoder<'_, D>,
800            offset: usize,
801            _depth: fidl::encoding::Depth,
802        ) -> fidl::Result<()> {
803            encoder.debug_check_bounds::<ManagerRemoveElementRequest>(offset);
804            // Delegate to tuple encoding.
805            fidl::encoding::Encode::<ManagerRemoveElementRequest, D>::encode(
806                (<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
807                    &self.name,
808                ),),
809                encoder,
810                offset,
811                _depth,
812            )
813        }
814    }
815    unsafe impl<
816            D: fidl::encoding::ResourceDialect,
817            T0: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
818        > fidl::encoding::Encode<ManagerRemoveElementRequest, D> for (T0,)
819    {
820        #[inline]
821        unsafe fn encode(
822            self,
823            encoder: &mut fidl::encoding::Encoder<'_, D>,
824            offset: usize,
825            depth: fidl::encoding::Depth,
826        ) -> fidl::Result<()> {
827            encoder.debug_check_bounds::<ManagerRemoveElementRequest>(offset);
828            // Zero out padding regions. There's no need to apply masks
829            // because the unmasked parts will be overwritten by fields.
830            // Write the fields.
831            self.0.encode(encoder, offset + 0, depth)?;
832            Ok(())
833        }
834    }
835
836    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
837        for ManagerRemoveElementRequest
838    {
839        #[inline(always)]
840        fn new_empty() -> Self {
841            Self { name: fidl::new_empty!(fidl::encoding::UnboundedString, D) }
842        }
843
844        #[inline]
845        unsafe fn decode(
846            &mut self,
847            decoder: &mut fidl::encoding::Decoder<'_, D>,
848            offset: usize,
849            _depth: fidl::encoding::Depth,
850        ) -> fidl::Result<()> {
851            decoder.debug_check_bounds::<Self>(offset);
852            // Verify that padding bytes are zero.
853            fidl::decode!(
854                fidl::encoding::UnboundedString,
855                D,
856                &mut self.name,
857                decoder,
858                offset + 0,
859                _depth
860            )?;
861            Ok(())
862        }
863    }
864}