fidl_fuchsia_bluetooth_avrcp_common/
fidl_fuchsia_bluetooth_avrcp_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/// The total number of attributes that can be set. The custom attributes + the 4
12/// defined attributes, `PlayerApplicationSettingAttributeId`. 4 + 127 = 131.
13pub const MAX_ATTRIBUTES: u64 = 131;
14
15/// The maximum number of possible values an attribute can take on.
16/// Defined by AVRCP 1.6.2 Sec 6.5.2
17pub const MAX_ATTRIBUTE_VALUES: u64 = 255;
18
19/// The maximum length of an attribute value in the media attributes.
20/// Defined by AVRCP 1.6.2 Sec 6.6.1.
21pub const MAX_ATTRIBUTE_VALUE_LENGTH: u64 = 65535;
22
23/// The maximum number of custom attributes that can be used.
24/// Defined by AVRCP 1.6.2 Appendix F.
25pub const MAX_CUSTOM_ATTRIBUTES: u64 = 127;
26
27/// The maximum number of MediaPlayerItems that can be returned from a call to
28/// GetFileSystemItems.
29/// This value is arbitrary and is meant to limit the number of items that can be returned.
30/// AVRCP 1.6.2, Section 6.10.4.2.2 defines the `Number of Items` parameter as a uint16.
31pub const MAX_FILESYSTEM_ITEMS: u16 = 16;
32
33/// The maximum number of MediaPlayerItems that can be returned from a call to
34/// GetMediaPlayerItems.
35/// This value is arbitrary and is meant to limit the number of items that can be returned.
36/// AVRCP 1.6.2, Section 6.10.4.2.2 defines the `Number of Items` parameter as a uint16.
37pub const MAX_MEDIA_PLAYER_ITEMS: u16 = 16;
38
39/// The maximum number of Notification Event IDs that can be supported by the TG.
40/// 0x0E to 0xFF are reserved for future use.
41/// Defined by AVRCP 1.6.2 Appendix H.
42pub const MAX_NOTIFICATIONS: u8 = 255;
43
44/// The maximum number of MediaPlayerItems that can be returned from a call to
45/// GetFileSystemItems.
46/// This value is arbitrary and is meant to limit the number of items that can be returned.
47/// AVRCP 1.6.2, Section 6.10.4.2.2 defines the `Number of Items` parameter as a uint16.
48pub const MAX_NOW_PLAYING_ITEMS: u16 = 16;
49
50/// The maximum number of MediaAttributeId that can be returned from a call to
51/// GetFileSystemItems or GetNowPlayingItems.
52/// This value based on list of media attributes available as per
53/// AVRCP 1.6.2, 26 Appendix E: list of media attributes.
54pub const MAX_NUM_MEDIA_ATTRIBUTES: u8 = 8;
55
56bitflags! {
57    /// The Major Player Type associated with a media player.
58    /// Defined by AVRCP 1.6.2 section 6.10.2.1.
59    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
60    pub struct MajorPlayerType: u8 {
61        const AUDIO = 1;
62        const VIDEO = 2;
63        const BROADCASTING_AUDIO = 4;
64        const BROADCASTING_VIDEO = 8;
65    }
66}
67
68impl MajorPlayerType {
69    #[deprecated = "Strict bits should not use `has_unknown_bits`"]
70    #[inline(always)]
71    pub fn has_unknown_bits(&self) -> bool {
72        false
73    }
74
75    #[deprecated = "Strict bits should not use `get_unknown_bits`"]
76    #[inline(always)]
77    pub fn get_unknown_bits(&self) -> u8 {
78        0
79    }
80}
81
82bitflags! {
83    /// Change notifications that a controller client can register.
84    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
85    pub struct Notifications: u32 {
86        /// AVRCP `EVENT_PLAYBACK_STATUS_CHANGED` Notification
87        const PLAYBACK_STATUS = 1;
88        /// AVRCP `EVENT_TRACK_CHANGED` Notification
89        const TRACK = 2;
90        /// AVRCP `EVENT_TRACK_POS_CHANGED` Notification
91        const TRACK_POS = 4;
92        /// AVRCP `EVENT_BATT_STATUS_CHANGED` Notification
93        const BATT_STATUS = 8;
94        /// AVRCP `EVENT_SYSTEM_STATUS_CHANGED` Notification
95        const SYSTEM_STATUS = 16;
96        /// AVRCP `EVENT_PLAYER_APPLICATION_SETTINGS_CHANGED` Notification
97        const PLAYER_APPLICATION_SETTINGS = 32;
98        /// AVRCP `EVENT_ADDRESSED_PLAYER_CHANGED` Notification
99        const ADDRESSED_PLAYER = 64;
100        /// AVRCP `EVENT_VOLUME_CHANGED` Notification
101        const VOLUME = 128;
102        /// AVRCP `EVENT_AVAILABLE_PLAYERS_CHANGED` Notification
103        const AVAILABLE_PLAYERS = 256;
104        /// Internal connection change event.
105        const CONNECTION = 65536;
106    }
107}
108
109impl Notifications {
110    #[deprecated = "Strict bits should not use `has_unknown_bits`"]
111    #[inline(always)]
112    pub fn has_unknown_bits(&self) -> bool {
113        false
114    }
115
116    #[deprecated = "Strict bits should not use `get_unknown_bits`"]
117    #[inline(always)]
118    pub fn get_unknown_bits(&self) -> u32 {
119        0
120    }
121}
122
123bitflags! {
124    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
125    pub struct PlayerFeatureBits: u64 {
126        const SELECT = 72057594037927936;
127        const UP = 144115188075855872;
128        const DOWN = 288230376151711744;
129        const LEFT = 576460752303423488;
130        const RIGHT = 1152921504606846976;
131        const RIGHT_UP = 2305843009213693952;
132        const RIGHT_DOWN = 4611686018427387904;
133        const LEFT_UP = 9223372036854775808;
134        const LEFT_DOWN = 281474976710656;
135        const ROOT_MENU = 562949953421312;
136        const SETUP_MENU = 1125899906842624;
137        const CONTENTS_MENU = 2251799813685248;
138        const FAVORITE_MENU = 4503599627370496;
139        const EXIT = 9007199254740992;
140        const ZERO = 18014398509481984;
141        const ONE = 36028797018963968;
142        const TWO = 1099511627776;
143        const THREE = 2199023255552;
144        const FOUR = 4398046511104;
145        const FIVE = 8796093022208;
146        const SIX = 17592186044416;
147        const SEVEN = 35184372088832;
148        const EIGHT = 70368744177664;
149        const NINE = 140737488355328;
150        const DOT = 4294967296;
151        const ENTER = 8589934592;
152        const CLEAR = 17179869184;
153        const CHANNEL_UP = 34359738368;
154        const CHANNEL_DOWN = 68719476736;
155        const PREVIOUS_CHANNEL = 137438953472;
156        const SOUND_SELECT = 274877906944;
157        const INPUT_SELECT = 549755813888;
158        const DISPLAY_INFORMATION = 16777216;
159        const HELP = 33554432;
160        const PAGE_UP = 67108864;
161        const PAGE_DOWN = 134217728;
162        const POWER = 268435456;
163        const VOLUME_UP = 536870912;
164        const VOLUME_DOWN = 1073741824;
165        const MUTE = 2147483648;
166        const PLAY = 65536;
167        const STOP = 131072;
168        const PAUSE = 262144;
169        const RECORD = 524288;
170        const REWIND = 1048576;
171        const FAST_FORWARD = 2097152;
172        const EJECT = 4194304;
173        const FORWARD = 8388608;
174        const BACKWARD = 256;
175        const ANGLE = 512;
176        const SUBPICTURE = 1024;
177        const F1 = 2048;
178        const F2 = 4096;
179        const F3 = 8192;
180        const F4 = 16384;
181        const F5 = 32768;
182        const VENDOR_UNIQUE = 1;
183        const BASIC_GROUP_NAVIGATION = 2;
184        const ADVANCED_CONTROL_PLAYER = 4;
185        const BROWSING = 8;
186        const SEARCHING = 16;
187        const ADD_TO_NOW_PLAYING = 32;
188        const UIDS_UNIQUE_IN_PLAYER_BROWSE_TREE = 64;
189        const ONLY_BROWSABLE_WHEN_ADDRESSED = 128;
190    }
191}
192
193impl PlayerFeatureBits {
194    #[deprecated = "Strict bits should not use `has_unknown_bits`"]
195    #[inline(always)]
196    pub fn has_unknown_bits(&self) -> bool {
197        false
198    }
199
200    #[deprecated = "Strict bits should not use `get_unknown_bits`"]
201    #[inline(always)]
202    pub fn get_unknown_bits(&self) -> u64 {
203        0
204    }
205}
206
207bitflags! {
208    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
209    pub struct PlayerFeatureBitsExt: u64 {
210        const ONLY_SEARCHABLE_WHEN_ADDRESSED = 72057594037927936;
211        const NOW_PLAYING = 144115188075855872;
212        const UID_PERSISTENCY = 288230376151711744;
213        const NUMBER_OF_ITEMS = 576460752303423488;
214        const COVER_ART = 1152921504606846976;
215    }
216}
217
218impl PlayerFeatureBitsExt {
219    #[deprecated = "Strict bits should not use `has_unknown_bits`"]
220    #[inline(always)]
221    pub fn has_unknown_bits(&self) -> bool {
222        false
223    }
224
225    #[deprecated = "Strict bits should not use `get_unknown_bits`"]
226    #[inline(always)]
227    pub fn get_unknown_bits(&self) -> u64 {
228        0
229    }
230}
231
232bitflags! {
233    /// The Player Sub Type associated with a media player.
234    /// Defined by AVRCP 1.6.2 section 6.10.2.1.
235    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
236    pub struct PlayerSubType: u32 {
237        const AUDIO_BOOK = 1;
238        const PODCAST = 2;
239    }
240}
241
242impl PlayerSubType {
243    #[deprecated = "Strict bits should not use `has_unknown_bits`"]
244    #[inline(always)]
245    pub fn has_unknown_bits(&self) -> bool {
246        false
247    }
248
249    #[deprecated = "Strict bits should not use `get_unknown_bits`"]
250    #[inline(always)]
251    pub fn get_unknown_bits(&self) -> u32 {
252        0
253    }
254}
255
256/// Defined by AV\C Panel specification.
257#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
258#[repr(u8)]
259pub enum AvcPanelCommand {
260    Select = 0,
261    Up = 1,
262    Down = 2,
263    Left = 3,
264    Right = 4,
265    RootMenu = 9,
266    ContentsMenu = 11,
267    FavoriteMenu = 12,
268    Exit = 13,
269    OnDemandMenu = 14,
270    AppsMenu = 15,
271    Key0 = 32,
272    Key1 = 33,
273    Key2 = 34,
274    Key3 = 35,
275    Key4 = 36,
276    Key5 = 37,
277    Key6 = 38,
278    Key7 = 39,
279    Key8 = 40,
280    Key9 = 41,
281    Dot = 42,
282    Enter = 43,
283    ChannelUp = 48,
284    ChannelDown = 49,
285    ChannelPrevious = 50,
286    InputSelect = 52,
287    Info = 53,
288    Help = 54,
289    PageUp = 55,
290    PageDown = 56,
291    Lock = 58,
292    Power = 64,
293    VolumeUp = 65,
294    VolumeDown = 66,
295    Mute = 67,
296    Play = 68,
297    Stop = 69,
298    Pause = 70,
299    Record = 71,
300    Rewind = 72,
301    FastForward = 73,
302    Eject = 74,
303    Forward = 75,
304    Backward = 76,
305    List = 77,
306    F1 = 113,
307    F2 = 114,
308    F3 = 115,
309    F4 = 116,
310    F5 = 117,
311    F6 = 118,
312    F7 = 119,
313    F8 = 120,
314    F9 = 121,
315    Red = 122,
316    Green = 123,
317    Blue = 124,
318    Yellow = 125,
319}
320
321impl AvcPanelCommand {
322    #[inline]
323    pub fn from_primitive(prim: u8) -> Option<Self> {
324        match prim {
325            0 => Some(Self::Select),
326            1 => Some(Self::Up),
327            2 => Some(Self::Down),
328            3 => Some(Self::Left),
329            4 => Some(Self::Right),
330            9 => Some(Self::RootMenu),
331            11 => Some(Self::ContentsMenu),
332            12 => Some(Self::FavoriteMenu),
333            13 => Some(Self::Exit),
334            14 => Some(Self::OnDemandMenu),
335            15 => Some(Self::AppsMenu),
336            32 => Some(Self::Key0),
337            33 => Some(Self::Key1),
338            34 => Some(Self::Key2),
339            35 => Some(Self::Key3),
340            36 => Some(Self::Key4),
341            37 => Some(Self::Key5),
342            38 => Some(Self::Key6),
343            39 => Some(Self::Key7),
344            40 => Some(Self::Key8),
345            41 => Some(Self::Key9),
346            42 => Some(Self::Dot),
347            43 => Some(Self::Enter),
348            48 => Some(Self::ChannelUp),
349            49 => Some(Self::ChannelDown),
350            50 => Some(Self::ChannelPrevious),
351            52 => Some(Self::InputSelect),
352            53 => Some(Self::Info),
353            54 => Some(Self::Help),
354            55 => Some(Self::PageUp),
355            56 => Some(Self::PageDown),
356            58 => Some(Self::Lock),
357            64 => Some(Self::Power),
358            65 => Some(Self::VolumeUp),
359            66 => Some(Self::VolumeDown),
360            67 => Some(Self::Mute),
361            68 => Some(Self::Play),
362            69 => Some(Self::Stop),
363            70 => Some(Self::Pause),
364            71 => Some(Self::Record),
365            72 => Some(Self::Rewind),
366            73 => Some(Self::FastForward),
367            74 => Some(Self::Eject),
368            75 => Some(Self::Forward),
369            76 => Some(Self::Backward),
370            77 => Some(Self::List),
371            113 => Some(Self::F1),
372            114 => Some(Self::F2),
373            115 => Some(Self::F3),
374            116 => Some(Self::F4),
375            117 => Some(Self::F5),
376            118 => Some(Self::F6),
377            119 => Some(Self::F7),
378            120 => Some(Self::F8),
379            121 => Some(Self::F9),
380            122 => Some(Self::Red),
381            123 => Some(Self::Green),
382            124 => Some(Self::Blue),
383            125 => Some(Self::Yellow),
384            _ => None,
385        }
386    }
387
388    #[inline]
389    pub const fn into_primitive(self) -> u8 {
390        self as u8
391    }
392
393    #[deprecated = "Strict enums should not use `is_unknown`"]
394    #[inline]
395    pub fn is_unknown(&self) -> bool {
396        false
397    }
398}
399
400/// Defined by AVRCP 1.6.2 section 6.7.2 (RegisterNotification).
401/// Format for `EVENT_BATT_STATUS_CHANGED`.
402/// Same encoding also defined by 6.5.8 (InformBatteryStatusOfCT).
403#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
404#[repr(u8)]
405pub enum BatteryStatus {
406    Normal = 0,
407    Warning = 1,
408    Critical = 2,
409    External = 3,
410    FullCharge = 4,
411    Reserved = 5,
412}
413
414impl BatteryStatus {
415    #[inline]
416    pub fn from_primitive(prim: u8) -> Option<Self> {
417        match prim {
418            0 => Some(Self::Normal),
419            1 => Some(Self::Warning),
420            2 => Some(Self::Critical),
421            3 => Some(Self::External),
422            4 => Some(Self::FullCharge),
423            5 => Some(Self::Reserved),
424            _ => None,
425        }
426    }
427
428    #[inline]
429    pub const fn into_primitive(self) -> u8 {
430        self as u8
431    }
432
433    #[deprecated = "Strict enums should not use `is_unknown`"]
434    #[inline]
435    pub fn is_unknown(&self) -> bool {
436        false
437    }
438}
439
440/// Errors from AVRCP 1.6.2 Section 6.15.3.
441#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
442#[repr(u32)]
443pub enum BrowseControllerError {
444    UnknownFailure = 1,
445    TimedOut = 2,
446    RemoteNotConnected = 3,
447    CommandNotImplemented = 4,
448    CommandRejected = 5,
449    CommandUnexpected = 6,
450    PacketEncoding = 7,
451    ProtocolError = 8,
452    ConnectionError = 9,
453    UidChanged = 10,
454    InvalidDirection = 11,
455    InvalidId = 12,
456    InvalidScope = 13,
457    RangeOutOfBounds = 14,
458    ItemNotPlayable = 15,
459    MediaInUse = 16,
460    PlayerNotBrowsable = 17,
461    PlayerNotAddressed = 18,
462    NoValidResults = 19,
463    NoAvailablePlayers = 20,
464}
465
466impl BrowseControllerError {
467    #[inline]
468    pub fn from_primitive(prim: u32) -> Option<Self> {
469        match prim {
470            1 => Some(Self::UnknownFailure),
471            2 => Some(Self::TimedOut),
472            3 => Some(Self::RemoteNotConnected),
473            4 => Some(Self::CommandNotImplemented),
474            5 => Some(Self::CommandRejected),
475            6 => Some(Self::CommandUnexpected),
476            7 => Some(Self::PacketEncoding),
477            8 => Some(Self::ProtocolError),
478            9 => Some(Self::ConnectionError),
479            10 => Some(Self::UidChanged),
480            11 => Some(Self::InvalidDirection),
481            12 => Some(Self::InvalidId),
482            13 => Some(Self::InvalidScope),
483            14 => Some(Self::RangeOutOfBounds),
484            15 => Some(Self::ItemNotPlayable),
485            16 => Some(Self::MediaInUse),
486            17 => Some(Self::PlayerNotBrowsable),
487            18 => Some(Self::PlayerNotAddressed),
488            19 => Some(Self::NoValidResults),
489            20 => Some(Self::NoAvailablePlayers),
490            _ => None,
491        }
492    }
493
494    #[inline]
495    pub const fn into_primitive(self) -> u32 {
496        self as u32
497    }
498
499    #[deprecated = "Strict enums should not use `is_unknown`"]
500    #[inline]
501    pub fn is_unknown(&self) -> bool {
502        false
503    }
504}
505
506/// Status codes for commands sent as the controller.
507#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
508#[repr(u32)]
509pub enum ControllerError {
510    UnknownFailure = 1,
511    TimedOut = 2,
512    RemoteNotConnected = 3,
513    CommandNotImplemented = 4,
514    CommandRejected = 5,
515    CommandUnexpected = 6,
516    InvalidArguments = 7,
517    PacketEncoding = 8,
518    ProtocolError = 9,
519    ConnectionError = 10,
520    UnexpectedResponse = 11,
521}
522
523impl ControllerError {
524    #[inline]
525    pub fn from_primitive(prim: u32) -> Option<Self> {
526        match prim {
527            1 => Some(Self::UnknownFailure),
528            2 => Some(Self::TimedOut),
529            3 => Some(Self::RemoteNotConnected),
530            4 => Some(Self::CommandNotImplemented),
531            5 => Some(Self::CommandRejected),
532            6 => Some(Self::CommandUnexpected),
533            7 => Some(Self::InvalidArguments),
534            8 => Some(Self::PacketEncoding),
535            9 => Some(Self::ProtocolError),
536            10 => Some(Self::ConnectionError),
537            11 => Some(Self::UnexpectedResponse),
538            _ => None,
539        }
540    }
541
542    #[inline]
543    pub const fn into_primitive(self) -> u32 {
544        self as u32
545    }
546
547    #[deprecated = "Strict enums should not use `is_unknown`"]
548    #[inline]
549    pub fn is_unknown(&self) -> bool {
550        false
551    }
552}
553
554/// Defined by AVRCP 1.6.2 Appendix F (player application settings).
555#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
556#[repr(u8)]
557pub enum Equalizer {
558    Off = 1,
559    On = 2,
560}
561
562impl Equalizer {
563    #[inline]
564    pub fn from_primitive(prim: u8) -> Option<Self> {
565        match prim {
566            1 => Some(Self::Off),
567            2 => Some(Self::On),
568            _ => None,
569        }
570    }
571
572    #[inline]
573    pub const fn into_primitive(self) -> u8 {
574        self as u8
575    }
576
577    #[deprecated = "Strict enums should not use `is_unknown`"]
578    #[inline]
579    pub fn is_unknown(&self) -> bool {
580        false
581    }
582}
583
584/// The folder type associated with a folder item.
585/// Defined by AVRCP 1.6.2 section 6.10.2.2.
586#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
587#[repr(u8)]
588pub enum FolderType {
589    Mixed = 0,
590    Titles = 1,
591    Albums = 2,
592    Artists = 3,
593    Genres = 4,
594    Playlists = 5,
595    Years = 6,
596}
597
598impl FolderType {
599    #[inline]
600    pub fn from_primitive(prim: u8) -> Option<Self> {
601        match prim {
602            0 => Some(Self::Mixed),
603            1 => Some(Self::Titles),
604            2 => Some(Self::Albums),
605            3 => Some(Self::Artists),
606            4 => Some(Self::Genres),
607            5 => Some(Self::Playlists),
608            6 => Some(Self::Years),
609            _ => None,
610        }
611    }
612
613    #[inline]
614    pub const fn into_primitive(self) -> u8 {
615        self as u8
616    }
617
618    #[deprecated = "Strict enums should not use `is_unknown`"]
619    #[inline]
620    pub fn is_unknown(&self) -> bool {
621        false
622    }
623}
624
625/// Defined by AVRCP 1.6.2 Appendix E (media attributes).
626/// 0x9-0xFFFFFFFF reserved for future use.
627#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
628#[repr(u32)]
629pub enum MediaAttributeId {
630    Title = 1,
631    ArtistName = 2,
632    AlbumName = 3,
633    TrackNumber = 4,
634    TotalNumberOfTracks = 5,
635    Genre = 6,
636    PlayingTime = 7,
637    DefaultCoverArt = 8,
638}
639
640impl MediaAttributeId {
641    #[inline]
642    pub fn from_primitive(prim: u32) -> Option<Self> {
643        match prim {
644            1 => Some(Self::Title),
645            2 => Some(Self::ArtistName),
646            3 => Some(Self::AlbumName),
647            4 => Some(Self::TrackNumber),
648            5 => Some(Self::TotalNumberOfTracks),
649            6 => Some(Self::Genre),
650            7 => Some(Self::PlayingTime),
651            8 => Some(Self::DefaultCoverArt),
652            _ => None,
653        }
654    }
655
656    #[inline]
657    pub const fn into_primitive(self) -> u32 {
658        self as u32
659    }
660
661    #[deprecated = "Strict enums should not use `is_unknown`"]
662    #[inline]
663    pub fn is_unknown(&self) -> bool {
664        false
665    }
666}
667
668/// Type of a media element item.
669/// Defined by AVRCP 1.6.2 section 6.10.2.3.
670#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
671#[repr(u8)]
672pub enum MediaType {
673    Audio = 0,
674    Video = 1,
675}
676
677impl MediaType {
678    #[inline]
679    pub fn from_primitive(prim: u8) -> Option<Self> {
680        match prim {
681            0 => Some(Self::Audio),
682            1 => Some(Self::Video),
683            _ => None,
684        }
685    }
686
687    #[inline]
688    pub const fn into_primitive(self) -> u8 {
689        self as u8
690    }
691
692    #[deprecated = "Strict enums should not use `is_unknown`"]
693    #[inline]
694    pub fn is_unknown(&self) -> bool {
695        false
696    }
697}
698
699/// Defined by AVRCP 1.6.2 section 6.7.2 (RegisterNotification) and Appendix H.
700/// Style note: named exactly as they are in the specification with the "EVENT_" prefix.
701#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
702#[repr(u8)]
703pub enum NotificationEvent {
704    PlaybackStatusChanged = 1,
705    TrackChanged = 2,
706    TrackReachedEnd = 3,
707    TrackReachedStart = 4,
708    TrackPosChanged = 5,
709    BattStatusChanged = 6,
710    SystemStatusChanged = 7,
711    PlayerApplicationSettingChanged = 8,
712    NowPlayingContentChanged = 9,
713    AvailablePlayersChanged = 10,
714    AddressedPlayerChanged = 11,
715    UidsChanged = 12,
716    VolumeChanged = 13,
717}
718
719impl NotificationEvent {
720    #[inline]
721    pub fn from_primitive(prim: u8) -> Option<Self> {
722        match prim {
723            1 => Some(Self::PlaybackStatusChanged),
724            2 => Some(Self::TrackChanged),
725            3 => Some(Self::TrackReachedEnd),
726            4 => Some(Self::TrackReachedStart),
727            5 => Some(Self::TrackPosChanged),
728            6 => Some(Self::BattStatusChanged),
729            7 => Some(Self::SystemStatusChanged),
730            8 => Some(Self::PlayerApplicationSettingChanged),
731            9 => Some(Self::NowPlayingContentChanged),
732            10 => Some(Self::AvailablePlayersChanged),
733            11 => Some(Self::AddressedPlayerChanged),
734            12 => Some(Self::UidsChanged),
735            13 => Some(Self::VolumeChanged),
736            _ => None,
737        }
738    }
739
740    #[inline]
741    pub const fn into_primitive(self) -> u8 {
742        self as u8
743    }
744
745    #[deprecated = "Strict enums should not use `is_unknown`"]
746    #[inline]
747    pub fn is_unknown(&self) -> bool {
748        false
749    }
750}
751
752/// Defined by AVRCP 1.6.2 section 6.7.2 (RegisterNotification).
753/// Format for `EVENT_PLAYBACK_STATUS_CHANGED`.
754#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
755#[repr(u8)]
756pub enum PlaybackStatus {
757    Stopped = 0,
758    Playing = 1,
759    Paused = 2,
760    FwdSeek = 3,
761    RevSeek = 4,
762    Error = 255,
763}
764
765impl PlaybackStatus {
766    #[inline]
767    pub fn from_primitive(prim: u8) -> Option<Self> {
768        match prim {
769            0 => Some(Self::Stopped),
770            1 => Some(Self::Playing),
771            2 => Some(Self::Paused),
772            3 => Some(Self::FwdSeek),
773            4 => Some(Self::RevSeek),
774            255 => Some(Self::Error),
775            _ => None,
776        }
777    }
778
779    #[inline]
780    pub const fn into_primitive(self) -> u8 {
781        self as u8
782    }
783
784    #[deprecated = "Strict enums should not use `is_unknown`"]
785    #[inline]
786    pub fn is_unknown(&self) -> bool {
787        false
788    }
789}
790
791/// 0x80 - 0xFF is reserved for custom player application settings.
792/// Defined by AVRCP 1.6.2 Appendix F (player application settings).
793#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
794#[repr(u8)]
795pub enum PlayerApplicationSettingAttributeId {
796    Equalizer = 1,
797    RepeatStatusMode = 2,
798    ShuffleMode = 3,
799    ScanMode = 4,
800}
801
802impl PlayerApplicationSettingAttributeId {
803    #[inline]
804    pub fn from_primitive(prim: u8) -> Option<Self> {
805        match prim {
806            1 => Some(Self::Equalizer),
807            2 => Some(Self::RepeatStatusMode),
808            3 => Some(Self::ShuffleMode),
809            4 => Some(Self::ScanMode),
810            _ => None,
811        }
812    }
813
814    #[inline]
815    pub const fn into_primitive(self) -> u8 {
816        self as u8
817    }
818
819    #[deprecated = "Strict enums should not use `is_unknown`"]
820    #[inline]
821    pub fn is_unknown(&self) -> bool {
822        false
823    }
824}
825
826/// Defined by AVRCP 1.6.2 Appendix F (player application settings).
827#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
828#[repr(u8)]
829pub enum RepeatStatusMode {
830    Off = 1,
831    SingleTrackRepeat = 2,
832    AllTrackRepeat = 3,
833    GroupRepeat = 4,
834}
835
836impl RepeatStatusMode {
837    #[inline]
838    pub fn from_primitive(prim: u8) -> Option<Self> {
839        match prim {
840            1 => Some(Self::Off),
841            2 => Some(Self::SingleTrackRepeat),
842            3 => Some(Self::AllTrackRepeat),
843            4 => Some(Self::GroupRepeat),
844            _ => None,
845        }
846    }
847
848    #[inline]
849    pub const fn into_primitive(self) -> u8 {
850        self as u8
851    }
852
853    #[deprecated = "Strict enums should not use `is_unknown`"]
854    #[inline]
855    pub fn is_unknown(&self) -> bool {
856        false
857    }
858}
859
860/// Defined by AVRCP 1.6.2 Appendix F (player application settings).
861#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
862#[repr(u8)]
863pub enum ScanMode {
864    Off = 1,
865    AllTrackScan = 2,
866    GroupScan = 3,
867}
868
869impl ScanMode {
870    #[inline]
871    pub fn from_primitive(prim: u8) -> Option<Self> {
872        match prim {
873            1 => Some(Self::Off),
874            2 => Some(Self::AllTrackScan),
875            3 => Some(Self::GroupScan),
876            _ => None,
877        }
878    }
879
880    #[inline]
881    pub const fn into_primitive(self) -> u8 {
882        self as u8
883    }
884
885    #[deprecated = "Strict enums should not use `is_unknown`"]
886    #[inline]
887    pub fn is_unknown(&self) -> bool {
888        false
889    }
890}
891
892/// Defined by AVRCP 1.6.2 Appendix F (player application settings).
893#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
894#[repr(u8)]
895pub enum ShuffleMode {
896    Off = 1,
897    AllTrackShuffle = 2,
898    GroupShuffle = 3,
899}
900
901impl ShuffleMode {
902    #[inline]
903    pub fn from_primitive(prim: u8) -> Option<Self> {
904        match prim {
905            1 => Some(Self::Off),
906            2 => Some(Self::AllTrackShuffle),
907            3 => Some(Self::GroupShuffle),
908            _ => None,
909        }
910    }
911
912    #[inline]
913    pub const fn into_primitive(self) -> u8 {
914        self as u8
915    }
916
917    #[deprecated = "Strict enums should not use `is_unknown`"]
918    #[inline]
919    pub fn is_unknown(&self) -> bool {
920        false
921    }
922}
923
924/// Defined by AVRCP 1.6.2 section 6.7.2 (RegisterNotification).
925/// Format for `EVENT_SYSTEM_STATUS_CHANGED`.
926#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
927#[repr(u8)]
928pub enum SystemStatus {
929    PowerOn = 0,
930    PowerOff = 1,
931    Unplugged = 2,
932}
933
934impl SystemStatus {
935    #[inline]
936    pub fn from_primitive(prim: u8) -> Option<Self> {
937        match prim {
938            0 => Some(Self::PowerOn),
939            1 => Some(Self::PowerOff),
940            2 => Some(Self::Unplugged),
941            _ => None,
942        }
943    }
944
945    #[inline]
946    pub const fn into_primitive(self) -> u8 {
947        self as u8
948    }
949
950    #[deprecated = "Strict enums should not use `is_unknown`"]
951    #[inline]
952    pub fn is_unknown(&self) -> bool {
953        false
954    }
955}
956
957/// Status codes for AVRCP specific AV/C commands.
958/// Defined in AVRCP 1.6.2 section 6.15.3, Table 6.49.
959/// Style note: named exactly as they are in Table 6.49 with the "REJECTED_" prefix.
960#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
961#[repr(u32)]
962pub enum TargetAvcError {
963    RejectedInvalidCommand = 0,
964    RejectedInvalidParameter = 1,
965    RejectedParameterContentError = 2,
966    RejectedInternalError = 3,
967    RejectedUidChanged = 5,
968    RejectedInvalidPlayerId = 17,
969    RejectedNoAvailablePlayers = 21,
970    RejectedAddressedPlayerChanged = 22,
971}
972
973impl TargetAvcError {
974    #[inline]
975    pub fn from_primitive(prim: u32) -> Option<Self> {
976        match prim {
977            0 => Some(Self::RejectedInvalidCommand),
978            1 => Some(Self::RejectedInvalidParameter),
979            2 => Some(Self::RejectedParameterContentError),
980            3 => Some(Self::RejectedInternalError),
981            5 => Some(Self::RejectedUidChanged),
982            17 => Some(Self::RejectedInvalidPlayerId),
983            21 => Some(Self::RejectedNoAvailablePlayers),
984            22 => Some(Self::RejectedAddressedPlayerChanged),
985            _ => None,
986        }
987    }
988
989    #[inline]
990    pub const fn into_primitive(self) -> u32 {
991        self as u32
992    }
993
994    #[deprecated = "Strict enums should not use `is_unknown`"]
995    #[inline]
996    pub fn is_unknown(&self) -> bool {
997        false
998    }
999}
1000
1001/// Status codes for passthrough responses received from the target.
1002#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
1003#[repr(u32)]
1004pub enum TargetPassthroughError {
1005    CommandNotImplemented = 1,
1006    CommandRejected = 2,
1007}
1008
1009impl TargetPassthroughError {
1010    #[inline]
1011    pub fn from_primitive(prim: u32) -> Option<Self> {
1012        match prim {
1013            1 => Some(Self::CommandNotImplemented),
1014            2 => Some(Self::CommandRejected),
1015            _ => None,
1016        }
1017    }
1018
1019    #[inline]
1020    pub const fn into_primitive(self) -> u32 {
1021        self as u32
1022    }
1023
1024    #[deprecated = "Strict enums should not use `is_unknown`"]
1025    #[inline]
1026    pub fn is_unknown(&self) -> bool {
1027        false
1028    }
1029}
1030
1031#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1032#[repr(C)]
1033pub struct AbsoluteVolumeHandlerGetCurrentVolumeResponse {
1034    pub volume: u8,
1035}
1036
1037impl fidl::Persistable for AbsoluteVolumeHandlerGetCurrentVolumeResponse {}
1038
1039#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1040#[repr(C)]
1041pub struct AbsoluteVolumeHandlerOnVolumeChangedResponse {
1042    pub new_volume: u8,
1043}
1044
1045impl fidl::Persistable for AbsoluteVolumeHandlerOnVolumeChangedResponse {}
1046
1047#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1048#[repr(C)]
1049pub struct AbsoluteVolumeHandlerSetVolumeRequest {
1050    pub requested_volume: u8,
1051}
1052
1053impl fidl::Persistable for AbsoluteVolumeHandlerSetVolumeRequest {}
1054
1055#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1056#[repr(C)]
1057pub struct AbsoluteVolumeHandlerSetVolumeResponse {
1058    pub set_volume: u8,
1059}
1060
1061impl fidl::Persistable for AbsoluteVolumeHandlerSetVolumeResponse {}
1062
1063/// The `AddressedPlayerId` is a unique identifier, assigned by AVRCP, for a media player.
1064/// This ID is only used for AVRCP purposes, and should not be interpreted as an
1065/// identification created, assigned, or used by MediaSession or any other API surfaces.
1066///
1067/// Defined in AVRCP 1.6, Section 6.10.2.1.
1068#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1069#[repr(C)]
1070pub struct AddressedPlayerId {
1071    pub id: u16,
1072}
1073
1074impl fidl::Persistable for AddressedPlayerId {}
1075
1076#[derive(Clone, Debug, PartialEq)]
1077pub struct BrowseControllerChangePathRequest {
1078    pub path: Path,
1079}
1080
1081impl fidl::Persistable for BrowseControllerChangePathRequest {}
1082
1083#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1084pub struct BrowseControllerGetFileSystemItemsRequest {
1085    pub start_index: u32,
1086    pub end_index: u32,
1087    pub attribute_option: AttributeRequestOption,
1088}
1089
1090impl fidl::Persistable for BrowseControllerGetFileSystemItemsRequest {}
1091
1092#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1093#[repr(C)]
1094pub struct BrowseControllerGetMediaPlayerItemsRequest {
1095    pub start_index: u32,
1096    pub end_index: u32,
1097}
1098
1099impl fidl::Persistable for BrowseControllerGetMediaPlayerItemsRequest {}
1100
1101#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1102pub struct BrowseControllerGetNowPlayingItemsRequest {
1103    pub start_index: u32,
1104    pub end_index: u32,
1105    pub attribute_option: AttributeRequestOption,
1106}
1107
1108impl fidl::Persistable for BrowseControllerGetNowPlayingItemsRequest {}
1109
1110#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1111#[repr(C)]
1112pub struct BrowseControllerPlayFileSystemItemRequest {
1113    /// UID of folder or media element.
1114    pub uid: u64,
1115}
1116
1117impl fidl::Persistable for BrowseControllerPlayFileSystemItemRequest {}
1118
1119#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1120#[repr(C)]
1121pub struct BrowseControllerPlayNowPlayingItemRequest {
1122    pub uid: u64,
1123}
1124
1125impl fidl::Persistable for BrowseControllerPlayNowPlayingItemRequest {}
1126
1127#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1128#[repr(C)]
1129pub struct BrowseControllerSetBrowsedPlayerRequest {
1130    pub player_id: u16,
1131}
1132
1133impl fidl::Persistable for BrowseControllerSetBrowsedPlayerRequest {}
1134
1135#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1136#[repr(C)]
1137pub struct BrowseControllerChangePathResponse {
1138    pub num_items: u32,
1139}
1140
1141impl fidl::Persistable for BrowseControllerChangePathResponse {}
1142
1143#[derive(Clone, Debug, PartialEq)]
1144pub struct BrowseControllerGetFileSystemItemsResponse {
1145    pub items: Vec<FileSystemItem>,
1146}
1147
1148impl fidl::Persistable for BrowseControllerGetFileSystemItemsResponse {}
1149
1150#[derive(Clone, Debug, PartialEq)]
1151pub struct BrowseControllerGetMediaPlayerItemsResponse {
1152    pub items: Vec<MediaPlayerItem>,
1153}
1154
1155impl fidl::Persistable for BrowseControllerGetMediaPlayerItemsResponse {}
1156
1157#[derive(Clone, Debug, PartialEq)]
1158pub struct BrowseControllerGetNowPlayingItemsResponse {
1159    pub items: Vec<MediaElementItem>,
1160}
1161
1162impl fidl::Persistable for BrowseControllerGetNowPlayingItemsResponse {}
1163
1164#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1165pub struct ControllerGetPlayerApplicationSettingsRequest {
1166    pub attribute_ids: Vec<PlayerApplicationSettingAttributeId>,
1167}
1168
1169impl fidl::Persistable for ControllerGetPlayerApplicationSettingsRequest {}
1170
1171#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1172pub struct ControllerInformBatteryStatusRequest {
1173    pub battery_status: BatteryStatus,
1174}
1175
1176impl fidl::Persistable for ControllerInformBatteryStatusRequest {}
1177
1178#[derive(Clone, Debug, PartialEq)]
1179pub struct ControllerOnNotificationRequest {
1180    pub timestamp: i64,
1181    pub notification: Notification,
1182}
1183
1184impl fidl::Persistable for ControllerOnNotificationRequest {}
1185
1186#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1187pub struct ControllerSendCommandRequest {
1188    pub command: AvcPanelCommand,
1189}
1190
1191impl fidl::Persistable for ControllerSendCommandRequest {}
1192
1193#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1194#[repr(C)]
1195pub struct ControllerSetAbsoluteVolumeRequest {
1196    pub requested_volume: u8,
1197}
1198
1199impl fidl::Persistable for ControllerSetAbsoluteVolumeRequest {}
1200
1201#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1202#[repr(C)]
1203pub struct ControllerSetAddressedPlayerRequest {
1204    pub player_id: u16,
1205}
1206
1207impl fidl::Persistable for ControllerSetAddressedPlayerRequest {}
1208
1209#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1210pub struct ControllerSetNotificationFilterRequest {
1211    pub notifications: Notifications,
1212    pub position_change_interval: u32,
1213}
1214
1215impl fidl::Persistable for ControllerSetNotificationFilterRequest {}
1216
1217#[derive(Clone, Debug, PartialEq)]
1218pub struct ControllerSetPlayerApplicationSettingsRequest {
1219    pub requested_settings: PlayerApplicationSettings,
1220}
1221
1222impl fidl::Persistable for ControllerSetPlayerApplicationSettingsRequest {}
1223
1224#[derive(Clone, Debug, PartialEq)]
1225pub struct ControllerGetMediaAttributesResponse {
1226    pub attributes: MediaAttributes,
1227}
1228
1229impl fidl::Persistable for ControllerGetMediaAttributesResponse {}
1230
1231#[derive(Clone, Debug, PartialEq)]
1232pub struct ControllerGetPlayStatusResponse {
1233    pub play_status: PlayStatus,
1234}
1235
1236impl fidl::Persistable for ControllerGetPlayStatusResponse {}
1237
1238#[derive(Clone, Debug, PartialEq)]
1239pub struct ControllerGetPlayerApplicationSettingsResponse {
1240    pub current_settings: PlayerApplicationSettings,
1241}
1242
1243impl fidl::Persistable for ControllerGetPlayerApplicationSettingsResponse {}
1244
1245#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1246#[repr(C)]
1247pub struct ControllerSetAbsoluteVolumeResponse {
1248    pub set_volume: u8,
1249}
1250
1251impl fidl::Persistable for ControllerSetAbsoluteVolumeResponse {}
1252
1253#[derive(Clone, Debug, PartialEq)]
1254pub struct ControllerSetPlayerApplicationSettingsResponse {
1255    pub set_settings: PlayerApplicationSettings,
1256}
1257
1258impl fidl::Persistable for ControllerSetPlayerApplicationSettingsResponse {}
1259
1260/// The custom attribute value and its description.
1261#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1262pub struct CustomAttributeValue {
1263    pub description: String,
1264    pub value: u8,
1265}
1266
1267impl fidl::Persistable for CustomAttributeValue {}
1268
1269#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1270pub struct Parent;
1271
1272impl fidl::Persistable for Parent {}
1273
1274#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1275pub struct TargetHandlerGetNotificationRequest {
1276    pub event_id: NotificationEvent,
1277}
1278
1279impl fidl::Persistable for TargetHandlerGetNotificationRequest {}
1280
1281#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1282pub struct TargetHandlerGetPlayerApplicationSettingsRequest {
1283    pub attribute_ids: Vec<PlayerApplicationSettingAttributeId>,
1284}
1285
1286impl fidl::Persistable for TargetHandlerGetPlayerApplicationSettingsRequest {}
1287
1288#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1289pub struct TargetHandlerSendCommandRequest {
1290    pub command: AvcPanelCommand,
1291    pub pressed: bool,
1292}
1293
1294impl fidl::Persistable for TargetHandlerSendCommandRequest {}
1295
1296#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1297#[repr(C)]
1298pub struct TargetHandlerSetAddressedPlayerRequest {
1299    pub player_id: AddressedPlayerId,
1300}
1301
1302impl fidl::Persistable for TargetHandlerSetAddressedPlayerRequest {}
1303
1304#[derive(Clone, Debug, PartialEq)]
1305pub struct TargetHandlerSetPlayerApplicationSettingsRequest {
1306    pub requested_settings: PlayerApplicationSettings,
1307}
1308
1309impl fidl::Persistable for TargetHandlerSetPlayerApplicationSettingsRequest {}
1310
1311#[derive(Clone, Debug, PartialEq)]
1312pub struct TargetHandlerWatchNotificationRequest {
1313    pub event_id: NotificationEvent,
1314    pub current: Notification,
1315    pub pos_change_interval: u32,
1316}
1317
1318impl fidl::Persistable for TargetHandlerWatchNotificationRequest {}
1319
1320#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1321pub struct TargetHandlerGetEventsSupportedResponse {
1322    pub notification_ids: Vec<NotificationEvent>,
1323}
1324
1325impl fidl::Persistable for TargetHandlerGetEventsSupportedResponse {}
1326
1327#[derive(Clone, Debug, PartialEq)]
1328pub struct TargetHandlerGetMediaAttributesResponse {
1329    pub attributes: MediaAttributes,
1330}
1331
1332impl fidl::Persistable for TargetHandlerGetMediaAttributesResponse {}
1333
1334#[derive(Clone, Debug, PartialEq)]
1335pub struct TargetHandlerGetMediaPlayerItemsResponse {
1336    pub items: Vec<MediaPlayerItem>,
1337}
1338
1339impl fidl::Persistable for TargetHandlerGetMediaPlayerItemsResponse {}
1340
1341#[derive(Clone, Debug, PartialEq)]
1342pub struct TargetHandlerGetNotificationResponse {
1343    pub current_value: Notification,
1344}
1345
1346impl fidl::Persistable for TargetHandlerGetNotificationResponse {}
1347
1348#[derive(Clone, Debug, PartialEq)]
1349pub struct TargetHandlerGetPlayStatusResponse {
1350    pub play_status: PlayStatus,
1351}
1352
1353impl fidl::Persistable for TargetHandlerGetPlayStatusResponse {}
1354
1355#[derive(Clone, Debug, PartialEq)]
1356pub struct TargetHandlerGetPlayerApplicationSettingsResponse {
1357    pub current_settings: PlayerApplicationSettings,
1358}
1359
1360impl fidl::Persistable for TargetHandlerGetPlayerApplicationSettingsResponse {}
1361
1362#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1363pub struct TargetHandlerListPlayerApplicationSettingAttributesResponse {
1364    pub attributes: Vec<PlayerApplicationSettingAttributeId>,
1365}
1366
1367impl fidl::Persistable for TargetHandlerListPlayerApplicationSettingAttributesResponse {}
1368
1369#[derive(Clone, Debug, PartialEq)]
1370pub struct TargetHandlerSetPlayerApplicationSettingsResponse {
1371    pub set_settings: PlayerApplicationSettings,
1372}
1373
1374impl fidl::Persistable for TargetHandlerSetPlayerApplicationSettingsResponse {}
1375
1376#[derive(Clone, Debug, PartialEq)]
1377pub struct TargetHandlerWatchNotificationResponse {
1378    pub new_value: Notification,
1379}
1380
1381impl fidl::Persistable for TargetHandlerWatchNotificationResponse {}
1382
1383/// Specification allowed player application settings.
1384/// Defined by AVRCP 1.6.2 Appendix F (player application settings).
1385#[derive(Clone, Debug, Default, PartialEq)]
1386pub struct CustomPlayerApplicationSetting {
1387    /// The attribute id for the custom setting. Must be between 0x80-0xFF, as
1388    /// defined in AVRCP 1.6.2 Appendix F.
1389    pub attribute_id: Option<u8>,
1390    /// The string descriptor of the custom attribute.
1391    pub attribute_name: Option<String>,
1392    /// The possible values the custom attribute can take.
1393    pub possible_values: Option<Vec<CustomAttributeValue>>,
1394    /// The current value that the custom setting is set to.
1395    pub current_value: Option<u8>,
1396    #[doc(hidden)]
1397    pub __source_breaking: fidl::marker::SourceBreaking,
1398}
1399
1400impl fidl::Persistable for CustomPlayerApplicationSetting {}
1401
1402/// Response data for a browseable folder item.
1403/// Defined by AVRCP 1.6.2 section 6.10.2.2.
1404#[derive(Clone, Debug, Default, PartialEq)]
1405pub struct FolderItem {
1406    pub folder_uid: Option<u64>,
1407    pub folder_type: Option<FolderType>,
1408    pub is_playable: Option<bool>,
1409    pub displayable_name: Option<String>,
1410    #[doc(hidden)]
1411    pub __source_breaking: fidl::marker::SourceBreaking,
1412}
1413
1414impl fidl::Persistable for FolderItem {}
1415
1416/// Defined by AVRCP 1.6.2 Appendix E (media attributes).
1417#[derive(Clone, Debug, Default, PartialEq)]
1418pub struct MediaAttributes {
1419    /// The title, song name, or content description.
1420    pub title: Option<String>,
1421    /// The artist, performer, or group.
1422    pub artist_name: Option<String>,
1423    /// The title of the source of media.
1424    pub album_name: Option<String>,
1425    /// The order number of the media on its original recording.
1426    pub track_number: Option<String>,
1427    /// The total number of tracks in the media.
1428    pub total_number_of_tracks: Option<String>,
1429    /// The category of composition of the media,
1430    pub genre: Option<String>,
1431    /// The length of the media in milliseconds (ms).
1432    pub playing_time: Option<String>,
1433    #[doc(hidden)]
1434    pub __source_breaking: fidl::marker::SourceBreaking,
1435}
1436
1437impl fidl::Persistable for MediaAttributes {}
1438
1439/// Response data for a browseable media element item.
1440/// Defined by AVRCP 1.6.2 section 6.10.2.3.
1441#[derive(Clone, Debug, Default, PartialEq)]
1442pub struct MediaElementItem {
1443    pub media_element_uid: Option<u64>,
1444    pub media_type: Option<MediaType>,
1445    pub displayable_name: Option<String>,
1446    pub attributes: Option<MediaAttributes>,
1447    #[doc(hidden)]
1448    pub __source_breaking: fidl::marker::SourceBreaking,
1449}
1450
1451impl fidl::Persistable for MediaElementItem {}
1452
1453/// Response data for the browseable items associated with a media player.
1454/// Defined by AVRCP 1.6.2 section 6.10.2.1.
1455#[derive(Clone, Debug, Default, PartialEq)]
1456pub struct MediaPlayerItem {
1457    pub player_id: Option<u16>,
1458    pub major_type: Option<MajorPlayerType>,
1459    pub sub_type: Option<PlayerSubType>,
1460    pub playback_status: Option<PlaybackStatus>,
1461    pub displayable_name: Option<String>,
1462    pub feature_bits: Option<PlayerFeatureBits>,
1463    pub feature_bits_ext: Option<PlayerFeatureBitsExt>,
1464    #[doc(hidden)]
1465    pub __source_breaking: fidl::marker::SourceBreaking,
1466}
1467
1468impl fidl::Persistable for MediaPlayerItem {}
1469
1470/// Event data from incoming target notifications.
1471/// Defined by AVRCP 1.6.2 Sec 6.7.2.
1472#[derive(Clone, Debug, Default, PartialEq)]
1473pub struct Notification {
1474    /// `EVENT_PLAYBACK_STATUS_CHANGED` event data
1475    pub status: Option<PlaybackStatus>,
1476    /// `EVENT_TRACK_CHANGED` event data
1477    pub track_id: Option<u64>,
1478    /// `EVENT_TRACK_POS_CHANGED` event data
1479    pub pos: Option<u32>,
1480    /// `EVENT_BATT_STATUS_CHANGED` event data
1481    pub battery_status: Option<BatteryStatus>,
1482    /// `EVENT_SYSTEM_STATUS_CHANGED` event data
1483    pub system_status: Option<SystemStatus>,
1484    /// `EVENT_PLAYER_APPLICATION_SETTINGS_CHANGED` event data
1485    pub application_settings: Option<PlayerApplicationSettings>,
1486    /// `EVENT_ADDRESSED_PLAYER_CHANGED` event data
1487    pub player_id: Option<u16>,
1488    /// `EVENT_VOLUME_CHANGED` event data
1489    pub volume: Option<u8>,
1490    /// `CONNECTION_CHANGE` event data
1491    pub device_connected: Option<bool>,
1492    /// `AVAILABLE_PLAYERS_CHANGED` event data
1493    pub available_players_changed: Option<bool>,
1494    /// `ADDRESSED_PLAYER_CHANGED` event data
1495    pub addressed_player: Option<u16>,
1496    #[doc(hidden)]
1497    pub __source_breaking: fidl::marker::SourceBreaking,
1498}
1499
1500impl fidl::Persistable for Notification {}
1501
1502/// Status of currently playing media on the TG.
1503/// Defined by AVRCP 1.6.2 section 6.7.1, Table 6.29.
1504#[derive(Clone, Debug, Default, PartialEq)]
1505pub struct PlayStatus {
1506    /// The total length of the currently playing media, in milliseconds.
1507    /// Optional, if the TG does not support song length.
1508    pub song_length: Option<u32>,
1509    /// The current position of the playing media, in milliseconds elapsed.
1510    /// Optional, if the TG does not support song position.
1511    pub song_position: Option<u32>,
1512    /// The playback status of the currently playing media.
1513    /// Mandatory, the TG must respond with a PlaybackStatus.
1514    pub playback_status: Option<PlaybackStatus>,
1515    #[doc(hidden)]
1516    pub __source_breaking: fidl::marker::SourceBreaking,
1517}
1518
1519impl fidl::Persistable for PlayStatus {}
1520
1521/// Defined by AVRCP 1.6.2 Appendix F (player application settings).
1522#[derive(Clone, Debug, Default, PartialEq)]
1523pub struct PlayerApplicationSettings {
1524    /// The equalizer status of the remote target.
1525    pub equalizer: Option<Equalizer>,
1526    /// The repeat mode status of the remote target.
1527    pub repeat_status_mode: Option<RepeatStatusMode>,
1528    /// The shuffle mode status of the remote target.
1529    pub shuffle_mode: Option<ShuffleMode>,
1530    /// The scan mode status of the remote target.
1531    pub scan_mode: Option<ScanMode>,
1532    /// Custom settings that are specification allowed.
1533    pub custom_settings: Option<Vec<CustomPlayerApplicationSetting>>,
1534    #[doc(hidden)]
1535    pub __source_breaking: fidl::marker::SourceBreaking,
1536}
1537
1538impl fidl::Persistable for PlayerApplicationSettings {}
1539
1540/// Set `get_all` if we want all attributes of a media element item.
1541/// Set `attribute_list` if we want to get only the specified attributes.
1542/// If `get_all` is set to false, it will be treated as attribute request
1543/// with emtpy list of attribute IDs.
1544#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1545pub enum AttributeRequestOption {
1546    GetAll(bool),
1547    AttributeList(Vec<MediaAttributeId>),
1548}
1549
1550impl AttributeRequestOption {
1551    #[inline]
1552    pub fn ordinal(&self) -> u64 {
1553        match *self {
1554            Self::GetAll(_) => 1,
1555            Self::AttributeList(_) => 2,
1556        }
1557    }
1558
1559    #[deprecated = "Strict unions should not use `is_unknown`"]
1560    #[inline]
1561    pub fn is_unknown(&self) -> bool {
1562        false
1563    }
1564}
1565
1566impl fidl::Persistable for AttributeRequestOption {}
1567
1568/// Items returned from GetFolderItems(Filesystem) may be either a folder or media element.
1569/// Defined by AVRCP 1.6.2 section 6.10.1.2.
1570/// Only one of `folder` or `media_element` should be set.
1571#[derive(Clone, Debug, PartialEq)]
1572pub enum FileSystemItem {
1573    Folder(FolderItem),
1574    MediaElement(MediaElementItem),
1575}
1576
1577impl FileSystemItem {
1578    #[inline]
1579    pub fn ordinal(&self) -> u64 {
1580        match *self {
1581            Self::Folder(_) => 1,
1582            Self::MediaElement(_) => 2,
1583        }
1584    }
1585
1586    #[deprecated = "Strict unions should not use `is_unknown`"]
1587    #[inline]
1588    pub fn is_unknown(&self) -> bool {
1589        false
1590    }
1591}
1592
1593impl fidl::Persistable for FileSystemItem {}
1594
1595/// Relative path from the current directory.
1596/// As per AVRCP 1.6.2 Section 6.10.4.1.1, it either specifies a parent folder
1597/// for Folder Up direction or a child folder by its unique ID for Folder
1598/// Down direction.
1599#[derive(Clone, Debug)]
1600pub enum Path {
1601    Parent(Parent),
1602    ChildFolderUid(u64),
1603    #[doc(hidden)]
1604    __SourceBreaking {
1605        unknown_ordinal: u64,
1606    },
1607}
1608
1609/// Pattern that matches an unknown `Path` member.
1610#[macro_export]
1611macro_rules! PathUnknown {
1612    () => {
1613        _
1614    };
1615}
1616
1617// Custom PartialEq so that unknown variants are not equal to themselves.
1618impl PartialEq for Path {
1619    fn eq(&self, other: &Self) -> bool {
1620        match (self, other) {
1621            (Self::Parent(x), Self::Parent(y)) => *x == *y,
1622            (Self::ChildFolderUid(x), Self::ChildFolderUid(y)) => *x == *y,
1623            _ => false,
1624        }
1625    }
1626}
1627
1628impl Path {
1629    #[inline]
1630    pub fn ordinal(&self) -> u64 {
1631        match *self {
1632            Self::Parent(_) => 1,
1633            Self::ChildFolderUid(_) => 2,
1634            Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
1635        }
1636    }
1637
1638    #[inline]
1639    pub fn unknown_variant_for_testing() -> Self {
1640        Self::__SourceBreaking { unknown_ordinal: 0 }
1641    }
1642
1643    #[inline]
1644    pub fn is_unknown(&self) -> bool {
1645        match self {
1646            Self::__SourceBreaking { .. } => true,
1647            _ => false,
1648        }
1649    }
1650}
1651
1652impl fidl::Persistable for Path {}
1653
1654mod internal {
1655    use super::*;
1656    unsafe impl fidl::encoding::TypeMarker for MajorPlayerType {
1657        type Owned = Self;
1658
1659        #[inline(always)]
1660        fn inline_align(_context: fidl::encoding::Context) -> usize {
1661            1
1662        }
1663
1664        #[inline(always)]
1665        fn inline_size(_context: fidl::encoding::Context) -> usize {
1666            1
1667        }
1668    }
1669
1670    impl fidl::encoding::ValueTypeMarker for MajorPlayerType {
1671        type Borrowed<'a> = Self;
1672        #[inline(always)]
1673        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1674            *value
1675        }
1676    }
1677
1678    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1679        for MajorPlayerType
1680    {
1681        #[inline]
1682        unsafe fn encode(
1683            self,
1684            encoder: &mut fidl::encoding::Encoder<'_, D>,
1685            offset: usize,
1686            _depth: fidl::encoding::Depth,
1687        ) -> fidl::Result<()> {
1688            encoder.debug_check_bounds::<Self>(offset);
1689            if self.bits() & Self::all().bits() != self.bits() {
1690                return Err(fidl::Error::InvalidBitsValue);
1691            }
1692            encoder.write_num(self.bits(), offset);
1693            Ok(())
1694        }
1695    }
1696
1697    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MajorPlayerType {
1698        #[inline(always)]
1699        fn new_empty() -> Self {
1700            Self::empty()
1701        }
1702
1703        #[inline]
1704        unsafe fn decode(
1705            &mut self,
1706            decoder: &mut fidl::encoding::Decoder<'_, D>,
1707            offset: usize,
1708            _depth: fidl::encoding::Depth,
1709        ) -> fidl::Result<()> {
1710            decoder.debug_check_bounds::<Self>(offset);
1711            let prim = decoder.read_num::<u8>(offset);
1712            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1713            Ok(())
1714        }
1715    }
1716    unsafe impl fidl::encoding::TypeMarker for Notifications {
1717        type Owned = Self;
1718
1719        #[inline(always)]
1720        fn inline_align(_context: fidl::encoding::Context) -> usize {
1721            4
1722        }
1723
1724        #[inline(always)]
1725        fn inline_size(_context: fidl::encoding::Context) -> usize {
1726            4
1727        }
1728    }
1729
1730    impl fidl::encoding::ValueTypeMarker for Notifications {
1731        type Borrowed<'a> = Self;
1732        #[inline(always)]
1733        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1734            *value
1735        }
1736    }
1737
1738    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Notifications {
1739        #[inline]
1740        unsafe fn encode(
1741            self,
1742            encoder: &mut fidl::encoding::Encoder<'_, D>,
1743            offset: usize,
1744            _depth: fidl::encoding::Depth,
1745        ) -> fidl::Result<()> {
1746            encoder.debug_check_bounds::<Self>(offset);
1747            if self.bits() & Self::all().bits() != self.bits() {
1748                return Err(fidl::Error::InvalidBitsValue);
1749            }
1750            encoder.write_num(self.bits(), offset);
1751            Ok(())
1752        }
1753    }
1754
1755    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Notifications {
1756        #[inline(always)]
1757        fn new_empty() -> Self {
1758            Self::empty()
1759        }
1760
1761        #[inline]
1762        unsafe fn decode(
1763            &mut self,
1764            decoder: &mut fidl::encoding::Decoder<'_, D>,
1765            offset: usize,
1766            _depth: fidl::encoding::Depth,
1767        ) -> fidl::Result<()> {
1768            decoder.debug_check_bounds::<Self>(offset);
1769            let prim = decoder.read_num::<u32>(offset);
1770            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1771            Ok(())
1772        }
1773    }
1774    unsafe impl fidl::encoding::TypeMarker for PlayerFeatureBits {
1775        type Owned = Self;
1776
1777        #[inline(always)]
1778        fn inline_align(_context: fidl::encoding::Context) -> usize {
1779            8
1780        }
1781
1782        #[inline(always)]
1783        fn inline_size(_context: fidl::encoding::Context) -> usize {
1784            8
1785        }
1786    }
1787
1788    impl fidl::encoding::ValueTypeMarker for PlayerFeatureBits {
1789        type Borrowed<'a> = Self;
1790        #[inline(always)]
1791        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1792            *value
1793        }
1794    }
1795
1796    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1797        for PlayerFeatureBits
1798    {
1799        #[inline]
1800        unsafe fn encode(
1801            self,
1802            encoder: &mut fidl::encoding::Encoder<'_, D>,
1803            offset: usize,
1804            _depth: fidl::encoding::Depth,
1805        ) -> fidl::Result<()> {
1806            encoder.debug_check_bounds::<Self>(offset);
1807            if self.bits() & Self::all().bits() != self.bits() {
1808                return Err(fidl::Error::InvalidBitsValue);
1809            }
1810            encoder.write_num(self.bits(), offset);
1811            Ok(())
1812        }
1813    }
1814
1815    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PlayerFeatureBits {
1816        #[inline(always)]
1817        fn new_empty() -> Self {
1818            Self::empty()
1819        }
1820
1821        #[inline]
1822        unsafe fn decode(
1823            &mut self,
1824            decoder: &mut fidl::encoding::Decoder<'_, D>,
1825            offset: usize,
1826            _depth: fidl::encoding::Depth,
1827        ) -> fidl::Result<()> {
1828            decoder.debug_check_bounds::<Self>(offset);
1829            let prim = decoder.read_num::<u64>(offset);
1830            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1831            Ok(())
1832        }
1833    }
1834    unsafe impl fidl::encoding::TypeMarker for PlayerFeatureBitsExt {
1835        type Owned = Self;
1836
1837        #[inline(always)]
1838        fn inline_align(_context: fidl::encoding::Context) -> usize {
1839            8
1840        }
1841
1842        #[inline(always)]
1843        fn inline_size(_context: fidl::encoding::Context) -> usize {
1844            8
1845        }
1846    }
1847
1848    impl fidl::encoding::ValueTypeMarker for PlayerFeatureBitsExt {
1849        type Borrowed<'a> = Self;
1850        #[inline(always)]
1851        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1852            *value
1853        }
1854    }
1855
1856    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1857        for PlayerFeatureBitsExt
1858    {
1859        #[inline]
1860        unsafe fn encode(
1861            self,
1862            encoder: &mut fidl::encoding::Encoder<'_, D>,
1863            offset: usize,
1864            _depth: fidl::encoding::Depth,
1865        ) -> fidl::Result<()> {
1866            encoder.debug_check_bounds::<Self>(offset);
1867            if self.bits() & Self::all().bits() != self.bits() {
1868                return Err(fidl::Error::InvalidBitsValue);
1869            }
1870            encoder.write_num(self.bits(), offset);
1871            Ok(())
1872        }
1873    }
1874
1875    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PlayerFeatureBitsExt {
1876        #[inline(always)]
1877        fn new_empty() -> Self {
1878            Self::empty()
1879        }
1880
1881        #[inline]
1882        unsafe fn decode(
1883            &mut self,
1884            decoder: &mut fidl::encoding::Decoder<'_, D>,
1885            offset: usize,
1886            _depth: fidl::encoding::Depth,
1887        ) -> fidl::Result<()> {
1888            decoder.debug_check_bounds::<Self>(offset);
1889            let prim = decoder.read_num::<u64>(offset);
1890            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1891            Ok(())
1892        }
1893    }
1894    unsafe impl fidl::encoding::TypeMarker for PlayerSubType {
1895        type Owned = Self;
1896
1897        #[inline(always)]
1898        fn inline_align(_context: fidl::encoding::Context) -> usize {
1899            4
1900        }
1901
1902        #[inline(always)]
1903        fn inline_size(_context: fidl::encoding::Context) -> usize {
1904            4
1905        }
1906    }
1907
1908    impl fidl::encoding::ValueTypeMarker for PlayerSubType {
1909        type Borrowed<'a> = Self;
1910        #[inline(always)]
1911        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1912            *value
1913        }
1914    }
1915
1916    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for PlayerSubType {
1917        #[inline]
1918        unsafe fn encode(
1919            self,
1920            encoder: &mut fidl::encoding::Encoder<'_, D>,
1921            offset: usize,
1922            _depth: fidl::encoding::Depth,
1923        ) -> fidl::Result<()> {
1924            encoder.debug_check_bounds::<Self>(offset);
1925            if self.bits() & Self::all().bits() != self.bits() {
1926                return Err(fidl::Error::InvalidBitsValue);
1927            }
1928            encoder.write_num(self.bits(), offset);
1929            Ok(())
1930        }
1931    }
1932
1933    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PlayerSubType {
1934        #[inline(always)]
1935        fn new_empty() -> Self {
1936            Self::empty()
1937        }
1938
1939        #[inline]
1940        unsafe fn decode(
1941            &mut self,
1942            decoder: &mut fidl::encoding::Decoder<'_, D>,
1943            offset: usize,
1944            _depth: fidl::encoding::Depth,
1945        ) -> fidl::Result<()> {
1946            decoder.debug_check_bounds::<Self>(offset);
1947            let prim = decoder.read_num::<u32>(offset);
1948            *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
1949            Ok(())
1950        }
1951    }
1952    unsafe impl fidl::encoding::TypeMarker for AvcPanelCommand {
1953        type Owned = Self;
1954
1955        #[inline(always)]
1956        fn inline_align(_context: fidl::encoding::Context) -> usize {
1957            std::mem::align_of::<u8>()
1958        }
1959
1960        #[inline(always)]
1961        fn inline_size(_context: fidl::encoding::Context) -> usize {
1962            std::mem::size_of::<u8>()
1963        }
1964
1965        #[inline(always)]
1966        fn encode_is_copy() -> bool {
1967            true
1968        }
1969
1970        #[inline(always)]
1971        fn decode_is_copy() -> bool {
1972            false
1973        }
1974    }
1975
1976    impl fidl::encoding::ValueTypeMarker for AvcPanelCommand {
1977        type Borrowed<'a> = Self;
1978        #[inline(always)]
1979        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1980            *value
1981        }
1982    }
1983
1984    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1985        for AvcPanelCommand
1986    {
1987        #[inline]
1988        unsafe fn encode(
1989            self,
1990            encoder: &mut fidl::encoding::Encoder<'_, D>,
1991            offset: usize,
1992            _depth: fidl::encoding::Depth,
1993        ) -> fidl::Result<()> {
1994            encoder.debug_check_bounds::<Self>(offset);
1995            encoder.write_num(self.into_primitive(), offset);
1996            Ok(())
1997        }
1998    }
1999
2000    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AvcPanelCommand {
2001        #[inline(always)]
2002        fn new_empty() -> Self {
2003            Self::Select
2004        }
2005
2006        #[inline]
2007        unsafe fn decode(
2008            &mut self,
2009            decoder: &mut fidl::encoding::Decoder<'_, D>,
2010            offset: usize,
2011            _depth: fidl::encoding::Depth,
2012        ) -> fidl::Result<()> {
2013            decoder.debug_check_bounds::<Self>(offset);
2014            let prim = decoder.read_num::<u8>(offset);
2015
2016            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2017            Ok(())
2018        }
2019    }
2020    unsafe impl fidl::encoding::TypeMarker for BatteryStatus {
2021        type Owned = Self;
2022
2023        #[inline(always)]
2024        fn inline_align(_context: fidl::encoding::Context) -> usize {
2025            std::mem::align_of::<u8>()
2026        }
2027
2028        #[inline(always)]
2029        fn inline_size(_context: fidl::encoding::Context) -> usize {
2030            std::mem::size_of::<u8>()
2031        }
2032
2033        #[inline(always)]
2034        fn encode_is_copy() -> bool {
2035            true
2036        }
2037
2038        #[inline(always)]
2039        fn decode_is_copy() -> bool {
2040            false
2041        }
2042    }
2043
2044    impl fidl::encoding::ValueTypeMarker for BatteryStatus {
2045        type Borrowed<'a> = Self;
2046        #[inline(always)]
2047        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2048            *value
2049        }
2050    }
2051
2052    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for BatteryStatus {
2053        #[inline]
2054        unsafe fn encode(
2055            self,
2056            encoder: &mut fidl::encoding::Encoder<'_, D>,
2057            offset: usize,
2058            _depth: fidl::encoding::Depth,
2059        ) -> fidl::Result<()> {
2060            encoder.debug_check_bounds::<Self>(offset);
2061            encoder.write_num(self.into_primitive(), offset);
2062            Ok(())
2063        }
2064    }
2065
2066    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BatteryStatus {
2067        #[inline(always)]
2068        fn new_empty() -> Self {
2069            Self::Normal
2070        }
2071
2072        #[inline]
2073        unsafe fn decode(
2074            &mut self,
2075            decoder: &mut fidl::encoding::Decoder<'_, D>,
2076            offset: usize,
2077            _depth: fidl::encoding::Depth,
2078        ) -> fidl::Result<()> {
2079            decoder.debug_check_bounds::<Self>(offset);
2080            let prim = decoder.read_num::<u8>(offset);
2081
2082            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2083            Ok(())
2084        }
2085    }
2086    unsafe impl fidl::encoding::TypeMarker for BrowseControllerError {
2087        type Owned = Self;
2088
2089        #[inline(always)]
2090        fn inline_align(_context: fidl::encoding::Context) -> usize {
2091            std::mem::align_of::<u32>()
2092        }
2093
2094        #[inline(always)]
2095        fn inline_size(_context: fidl::encoding::Context) -> usize {
2096            std::mem::size_of::<u32>()
2097        }
2098
2099        #[inline(always)]
2100        fn encode_is_copy() -> bool {
2101            true
2102        }
2103
2104        #[inline(always)]
2105        fn decode_is_copy() -> bool {
2106            false
2107        }
2108    }
2109
2110    impl fidl::encoding::ValueTypeMarker for BrowseControllerError {
2111        type Borrowed<'a> = Self;
2112        #[inline(always)]
2113        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2114            *value
2115        }
2116    }
2117
2118    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2119        for BrowseControllerError
2120    {
2121        #[inline]
2122        unsafe fn encode(
2123            self,
2124            encoder: &mut fidl::encoding::Encoder<'_, D>,
2125            offset: usize,
2126            _depth: fidl::encoding::Depth,
2127        ) -> fidl::Result<()> {
2128            encoder.debug_check_bounds::<Self>(offset);
2129            encoder.write_num(self.into_primitive(), offset);
2130            Ok(())
2131        }
2132    }
2133
2134    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BrowseControllerError {
2135        #[inline(always)]
2136        fn new_empty() -> Self {
2137            Self::UnknownFailure
2138        }
2139
2140        #[inline]
2141        unsafe fn decode(
2142            &mut self,
2143            decoder: &mut fidl::encoding::Decoder<'_, D>,
2144            offset: usize,
2145            _depth: fidl::encoding::Depth,
2146        ) -> fidl::Result<()> {
2147            decoder.debug_check_bounds::<Self>(offset);
2148            let prim = decoder.read_num::<u32>(offset);
2149
2150            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2151            Ok(())
2152        }
2153    }
2154    unsafe impl fidl::encoding::TypeMarker for ControllerError {
2155        type Owned = Self;
2156
2157        #[inline(always)]
2158        fn inline_align(_context: fidl::encoding::Context) -> usize {
2159            std::mem::align_of::<u32>()
2160        }
2161
2162        #[inline(always)]
2163        fn inline_size(_context: fidl::encoding::Context) -> usize {
2164            std::mem::size_of::<u32>()
2165        }
2166
2167        #[inline(always)]
2168        fn encode_is_copy() -> bool {
2169            true
2170        }
2171
2172        #[inline(always)]
2173        fn decode_is_copy() -> bool {
2174            false
2175        }
2176    }
2177
2178    impl fidl::encoding::ValueTypeMarker for ControllerError {
2179        type Borrowed<'a> = Self;
2180        #[inline(always)]
2181        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2182            *value
2183        }
2184    }
2185
2186    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2187        for ControllerError
2188    {
2189        #[inline]
2190        unsafe fn encode(
2191            self,
2192            encoder: &mut fidl::encoding::Encoder<'_, D>,
2193            offset: usize,
2194            _depth: fidl::encoding::Depth,
2195        ) -> fidl::Result<()> {
2196            encoder.debug_check_bounds::<Self>(offset);
2197            encoder.write_num(self.into_primitive(), offset);
2198            Ok(())
2199        }
2200    }
2201
2202    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ControllerError {
2203        #[inline(always)]
2204        fn new_empty() -> Self {
2205            Self::UnknownFailure
2206        }
2207
2208        #[inline]
2209        unsafe fn decode(
2210            &mut self,
2211            decoder: &mut fidl::encoding::Decoder<'_, D>,
2212            offset: usize,
2213            _depth: fidl::encoding::Depth,
2214        ) -> fidl::Result<()> {
2215            decoder.debug_check_bounds::<Self>(offset);
2216            let prim = decoder.read_num::<u32>(offset);
2217
2218            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2219            Ok(())
2220        }
2221    }
2222    unsafe impl fidl::encoding::TypeMarker for Equalizer {
2223        type Owned = Self;
2224
2225        #[inline(always)]
2226        fn inline_align(_context: fidl::encoding::Context) -> usize {
2227            std::mem::align_of::<u8>()
2228        }
2229
2230        #[inline(always)]
2231        fn inline_size(_context: fidl::encoding::Context) -> usize {
2232            std::mem::size_of::<u8>()
2233        }
2234
2235        #[inline(always)]
2236        fn encode_is_copy() -> bool {
2237            true
2238        }
2239
2240        #[inline(always)]
2241        fn decode_is_copy() -> bool {
2242            false
2243        }
2244    }
2245
2246    impl fidl::encoding::ValueTypeMarker for Equalizer {
2247        type Borrowed<'a> = Self;
2248        #[inline(always)]
2249        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2250            *value
2251        }
2252    }
2253
2254    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Equalizer {
2255        #[inline]
2256        unsafe fn encode(
2257            self,
2258            encoder: &mut fidl::encoding::Encoder<'_, D>,
2259            offset: usize,
2260            _depth: fidl::encoding::Depth,
2261        ) -> fidl::Result<()> {
2262            encoder.debug_check_bounds::<Self>(offset);
2263            encoder.write_num(self.into_primitive(), offset);
2264            Ok(())
2265        }
2266    }
2267
2268    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Equalizer {
2269        #[inline(always)]
2270        fn new_empty() -> Self {
2271            Self::Off
2272        }
2273
2274        #[inline]
2275        unsafe fn decode(
2276            &mut self,
2277            decoder: &mut fidl::encoding::Decoder<'_, D>,
2278            offset: usize,
2279            _depth: fidl::encoding::Depth,
2280        ) -> fidl::Result<()> {
2281            decoder.debug_check_bounds::<Self>(offset);
2282            let prim = decoder.read_num::<u8>(offset);
2283
2284            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2285            Ok(())
2286        }
2287    }
2288    unsafe impl fidl::encoding::TypeMarker for FolderType {
2289        type Owned = Self;
2290
2291        #[inline(always)]
2292        fn inline_align(_context: fidl::encoding::Context) -> usize {
2293            std::mem::align_of::<u8>()
2294        }
2295
2296        #[inline(always)]
2297        fn inline_size(_context: fidl::encoding::Context) -> usize {
2298            std::mem::size_of::<u8>()
2299        }
2300
2301        #[inline(always)]
2302        fn encode_is_copy() -> bool {
2303            true
2304        }
2305
2306        #[inline(always)]
2307        fn decode_is_copy() -> bool {
2308            false
2309        }
2310    }
2311
2312    impl fidl::encoding::ValueTypeMarker for FolderType {
2313        type Borrowed<'a> = Self;
2314        #[inline(always)]
2315        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2316            *value
2317        }
2318    }
2319
2320    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FolderType {
2321        #[inline]
2322        unsafe fn encode(
2323            self,
2324            encoder: &mut fidl::encoding::Encoder<'_, D>,
2325            offset: usize,
2326            _depth: fidl::encoding::Depth,
2327        ) -> fidl::Result<()> {
2328            encoder.debug_check_bounds::<Self>(offset);
2329            encoder.write_num(self.into_primitive(), offset);
2330            Ok(())
2331        }
2332    }
2333
2334    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FolderType {
2335        #[inline(always)]
2336        fn new_empty() -> Self {
2337            Self::Mixed
2338        }
2339
2340        #[inline]
2341        unsafe fn decode(
2342            &mut self,
2343            decoder: &mut fidl::encoding::Decoder<'_, D>,
2344            offset: usize,
2345            _depth: fidl::encoding::Depth,
2346        ) -> fidl::Result<()> {
2347            decoder.debug_check_bounds::<Self>(offset);
2348            let prim = decoder.read_num::<u8>(offset);
2349
2350            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2351            Ok(())
2352        }
2353    }
2354    unsafe impl fidl::encoding::TypeMarker for MediaAttributeId {
2355        type Owned = Self;
2356
2357        #[inline(always)]
2358        fn inline_align(_context: fidl::encoding::Context) -> usize {
2359            std::mem::align_of::<u32>()
2360        }
2361
2362        #[inline(always)]
2363        fn inline_size(_context: fidl::encoding::Context) -> usize {
2364            std::mem::size_of::<u32>()
2365        }
2366
2367        #[inline(always)]
2368        fn encode_is_copy() -> bool {
2369            true
2370        }
2371
2372        #[inline(always)]
2373        fn decode_is_copy() -> bool {
2374            false
2375        }
2376    }
2377
2378    impl fidl::encoding::ValueTypeMarker for MediaAttributeId {
2379        type Borrowed<'a> = Self;
2380        #[inline(always)]
2381        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2382            *value
2383        }
2384    }
2385
2386    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2387        for MediaAttributeId
2388    {
2389        #[inline]
2390        unsafe fn encode(
2391            self,
2392            encoder: &mut fidl::encoding::Encoder<'_, D>,
2393            offset: usize,
2394            _depth: fidl::encoding::Depth,
2395        ) -> fidl::Result<()> {
2396            encoder.debug_check_bounds::<Self>(offset);
2397            encoder.write_num(self.into_primitive(), offset);
2398            Ok(())
2399        }
2400    }
2401
2402    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MediaAttributeId {
2403        #[inline(always)]
2404        fn new_empty() -> Self {
2405            Self::Title
2406        }
2407
2408        #[inline]
2409        unsafe fn decode(
2410            &mut self,
2411            decoder: &mut fidl::encoding::Decoder<'_, D>,
2412            offset: usize,
2413            _depth: fidl::encoding::Depth,
2414        ) -> fidl::Result<()> {
2415            decoder.debug_check_bounds::<Self>(offset);
2416            let prim = decoder.read_num::<u32>(offset);
2417
2418            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2419            Ok(())
2420        }
2421    }
2422    unsafe impl fidl::encoding::TypeMarker for MediaType {
2423        type Owned = Self;
2424
2425        #[inline(always)]
2426        fn inline_align(_context: fidl::encoding::Context) -> usize {
2427            std::mem::align_of::<u8>()
2428        }
2429
2430        #[inline(always)]
2431        fn inline_size(_context: fidl::encoding::Context) -> usize {
2432            std::mem::size_of::<u8>()
2433        }
2434
2435        #[inline(always)]
2436        fn encode_is_copy() -> bool {
2437            true
2438        }
2439
2440        #[inline(always)]
2441        fn decode_is_copy() -> bool {
2442            false
2443        }
2444    }
2445
2446    impl fidl::encoding::ValueTypeMarker for MediaType {
2447        type Borrowed<'a> = Self;
2448        #[inline(always)]
2449        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2450            *value
2451        }
2452    }
2453
2454    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for MediaType {
2455        #[inline]
2456        unsafe fn encode(
2457            self,
2458            encoder: &mut fidl::encoding::Encoder<'_, D>,
2459            offset: usize,
2460            _depth: fidl::encoding::Depth,
2461        ) -> fidl::Result<()> {
2462            encoder.debug_check_bounds::<Self>(offset);
2463            encoder.write_num(self.into_primitive(), offset);
2464            Ok(())
2465        }
2466    }
2467
2468    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MediaType {
2469        #[inline(always)]
2470        fn new_empty() -> Self {
2471            Self::Audio
2472        }
2473
2474        #[inline]
2475        unsafe fn decode(
2476            &mut self,
2477            decoder: &mut fidl::encoding::Decoder<'_, D>,
2478            offset: usize,
2479            _depth: fidl::encoding::Depth,
2480        ) -> fidl::Result<()> {
2481            decoder.debug_check_bounds::<Self>(offset);
2482            let prim = decoder.read_num::<u8>(offset);
2483
2484            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2485            Ok(())
2486        }
2487    }
2488    unsafe impl fidl::encoding::TypeMarker for NotificationEvent {
2489        type Owned = Self;
2490
2491        #[inline(always)]
2492        fn inline_align(_context: fidl::encoding::Context) -> usize {
2493            std::mem::align_of::<u8>()
2494        }
2495
2496        #[inline(always)]
2497        fn inline_size(_context: fidl::encoding::Context) -> usize {
2498            std::mem::size_of::<u8>()
2499        }
2500
2501        #[inline(always)]
2502        fn encode_is_copy() -> bool {
2503            true
2504        }
2505
2506        #[inline(always)]
2507        fn decode_is_copy() -> bool {
2508            false
2509        }
2510    }
2511
2512    impl fidl::encoding::ValueTypeMarker for NotificationEvent {
2513        type Borrowed<'a> = Self;
2514        #[inline(always)]
2515        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2516            *value
2517        }
2518    }
2519
2520    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2521        for NotificationEvent
2522    {
2523        #[inline]
2524        unsafe fn encode(
2525            self,
2526            encoder: &mut fidl::encoding::Encoder<'_, D>,
2527            offset: usize,
2528            _depth: fidl::encoding::Depth,
2529        ) -> fidl::Result<()> {
2530            encoder.debug_check_bounds::<Self>(offset);
2531            encoder.write_num(self.into_primitive(), offset);
2532            Ok(())
2533        }
2534    }
2535
2536    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NotificationEvent {
2537        #[inline(always)]
2538        fn new_empty() -> Self {
2539            Self::PlaybackStatusChanged
2540        }
2541
2542        #[inline]
2543        unsafe fn decode(
2544            &mut self,
2545            decoder: &mut fidl::encoding::Decoder<'_, D>,
2546            offset: usize,
2547            _depth: fidl::encoding::Depth,
2548        ) -> fidl::Result<()> {
2549            decoder.debug_check_bounds::<Self>(offset);
2550            let prim = decoder.read_num::<u8>(offset);
2551
2552            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2553            Ok(())
2554        }
2555    }
2556    unsafe impl fidl::encoding::TypeMarker for PlaybackStatus {
2557        type Owned = Self;
2558
2559        #[inline(always)]
2560        fn inline_align(_context: fidl::encoding::Context) -> usize {
2561            std::mem::align_of::<u8>()
2562        }
2563
2564        #[inline(always)]
2565        fn inline_size(_context: fidl::encoding::Context) -> usize {
2566            std::mem::size_of::<u8>()
2567        }
2568
2569        #[inline(always)]
2570        fn encode_is_copy() -> bool {
2571            true
2572        }
2573
2574        #[inline(always)]
2575        fn decode_is_copy() -> bool {
2576            false
2577        }
2578    }
2579
2580    impl fidl::encoding::ValueTypeMarker for PlaybackStatus {
2581        type Borrowed<'a> = Self;
2582        #[inline(always)]
2583        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2584            *value
2585        }
2586    }
2587
2588    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for PlaybackStatus {
2589        #[inline]
2590        unsafe fn encode(
2591            self,
2592            encoder: &mut fidl::encoding::Encoder<'_, D>,
2593            offset: usize,
2594            _depth: fidl::encoding::Depth,
2595        ) -> fidl::Result<()> {
2596            encoder.debug_check_bounds::<Self>(offset);
2597            encoder.write_num(self.into_primitive(), offset);
2598            Ok(())
2599        }
2600    }
2601
2602    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PlaybackStatus {
2603        #[inline(always)]
2604        fn new_empty() -> Self {
2605            Self::Stopped
2606        }
2607
2608        #[inline]
2609        unsafe fn decode(
2610            &mut self,
2611            decoder: &mut fidl::encoding::Decoder<'_, D>,
2612            offset: usize,
2613            _depth: fidl::encoding::Depth,
2614        ) -> fidl::Result<()> {
2615            decoder.debug_check_bounds::<Self>(offset);
2616            let prim = decoder.read_num::<u8>(offset);
2617
2618            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2619            Ok(())
2620        }
2621    }
2622    unsafe impl fidl::encoding::TypeMarker for PlayerApplicationSettingAttributeId {
2623        type Owned = Self;
2624
2625        #[inline(always)]
2626        fn inline_align(_context: fidl::encoding::Context) -> usize {
2627            std::mem::align_of::<u8>()
2628        }
2629
2630        #[inline(always)]
2631        fn inline_size(_context: fidl::encoding::Context) -> usize {
2632            std::mem::size_of::<u8>()
2633        }
2634
2635        #[inline(always)]
2636        fn encode_is_copy() -> bool {
2637            true
2638        }
2639
2640        #[inline(always)]
2641        fn decode_is_copy() -> bool {
2642            false
2643        }
2644    }
2645
2646    impl fidl::encoding::ValueTypeMarker for PlayerApplicationSettingAttributeId {
2647        type Borrowed<'a> = Self;
2648        #[inline(always)]
2649        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2650            *value
2651        }
2652    }
2653
2654    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2655        for PlayerApplicationSettingAttributeId
2656    {
2657        #[inline]
2658        unsafe fn encode(
2659            self,
2660            encoder: &mut fidl::encoding::Encoder<'_, D>,
2661            offset: usize,
2662            _depth: fidl::encoding::Depth,
2663        ) -> fidl::Result<()> {
2664            encoder.debug_check_bounds::<Self>(offset);
2665            encoder.write_num(self.into_primitive(), offset);
2666            Ok(())
2667        }
2668    }
2669
2670    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2671        for PlayerApplicationSettingAttributeId
2672    {
2673        #[inline(always)]
2674        fn new_empty() -> Self {
2675            Self::Equalizer
2676        }
2677
2678        #[inline]
2679        unsafe fn decode(
2680            &mut self,
2681            decoder: &mut fidl::encoding::Decoder<'_, D>,
2682            offset: usize,
2683            _depth: fidl::encoding::Depth,
2684        ) -> fidl::Result<()> {
2685            decoder.debug_check_bounds::<Self>(offset);
2686            let prim = decoder.read_num::<u8>(offset);
2687
2688            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2689            Ok(())
2690        }
2691    }
2692    unsafe impl fidl::encoding::TypeMarker for RepeatStatusMode {
2693        type Owned = Self;
2694
2695        #[inline(always)]
2696        fn inline_align(_context: fidl::encoding::Context) -> usize {
2697            std::mem::align_of::<u8>()
2698        }
2699
2700        #[inline(always)]
2701        fn inline_size(_context: fidl::encoding::Context) -> usize {
2702            std::mem::size_of::<u8>()
2703        }
2704
2705        #[inline(always)]
2706        fn encode_is_copy() -> bool {
2707            true
2708        }
2709
2710        #[inline(always)]
2711        fn decode_is_copy() -> bool {
2712            false
2713        }
2714    }
2715
2716    impl fidl::encoding::ValueTypeMarker for RepeatStatusMode {
2717        type Borrowed<'a> = Self;
2718        #[inline(always)]
2719        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2720            *value
2721        }
2722    }
2723
2724    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
2725        for RepeatStatusMode
2726    {
2727        #[inline]
2728        unsafe fn encode(
2729            self,
2730            encoder: &mut fidl::encoding::Encoder<'_, D>,
2731            offset: usize,
2732            _depth: fidl::encoding::Depth,
2733        ) -> fidl::Result<()> {
2734            encoder.debug_check_bounds::<Self>(offset);
2735            encoder.write_num(self.into_primitive(), offset);
2736            Ok(())
2737        }
2738    }
2739
2740    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RepeatStatusMode {
2741        #[inline(always)]
2742        fn new_empty() -> Self {
2743            Self::Off
2744        }
2745
2746        #[inline]
2747        unsafe fn decode(
2748            &mut self,
2749            decoder: &mut fidl::encoding::Decoder<'_, D>,
2750            offset: usize,
2751            _depth: fidl::encoding::Depth,
2752        ) -> fidl::Result<()> {
2753            decoder.debug_check_bounds::<Self>(offset);
2754            let prim = decoder.read_num::<u8>(offset);
2755
2756            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2757            Ok(())
2758        }
2759    }
2760    unsafe impl fidl::encoding::TypeMarker for ScanMode {
2761        type Owned = Self;
2762
2763        #[inline(always)]
2764        fn inline_align(_context: fidl::encoding::Context) -> usize {
2765            std::mem::align_of::<u8>()
2766        }
2767
2768        #[inline(always)]
2769        fn inline_size(_context: fidl::encoding::Context) -> usize {
2770            std::mem::size_of::<u8>()
2771        }
2772
2773        #[inline(always)]
2774        fn encode_is_copy() -> bool {
2775            true
2776        }
2777
2778        #[inline(always)]
2779        fn decode_is_copy() -> bool {
2780            false
2781        }
2782    }
2783
2784    impl fidl::encoding::ValueTypeMarker for ScanMode {
2785        type Borrowed<'a> = Self;
2786        #[inline(always)]
2787        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2788            *value
2789        }
2790    }
2791
2792    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ScanMode {
2793        #[inline]
2794        unsafe fn encode(
2795            self,
2796            encoder: &mut fidl::encoding::Encoder<'_, D>,
2797            offset: usize,
2798            _depth: fidl::encoding::Depth,
2799        ) -> fidl::Result<()> {
2800            encoder.debug_check_bounds::<Self>(offset);
2801            encoder.write_num(self.into_primitive(), offset);
2802            Ok(())
2803        }
2804    }
2805
2806    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ScanMode {
2807        #[inline(always)]
2808        fn new_empty() -> Self {
2809            Self::Off
2810        }
2811
2812        #[inline]
2813        unsafe fn decode(
2814            &mut self,
2815            decoder: &mut fidl::encoding::Decoder<'_, D>,
2816            offset: usize,
2817            _depth: fidl::encoding::Depth,
2818        ) -> fidl::Result<()> {
2819            decoder.debug_check_bounds::<Self>(offset);
2820            let prim = decoder.read_num::<u8>(offset);
2821
2822            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2823            Ok(())
2824        }
2825    }
2826    unsafe impl fidl::encoding::TypeMarker for ShuffleMode {
2827        type Owned = Self;
2828
2829        #[inline(always)]
2830        fn inline_align(_context: fidl::encoding::Context) -> usize {
2831            std::mem::align_of::<u8>()
2832        }
2833
2834        #[inline(always)]
2835        fn inline_size(_context: fidl::encoding::Context) -> usize {
2836            std::mem::size_of::<u8>()
2837        }
2838
2839        #[inline(always)]
2840        fn encode_is_copy() -> bool {
2841            true
2842        }
2843
2844        #[inline(always)]
2845        fn decode_is_copy() -> bool {
2846            false
2847        }
2848    }
2849
2850    impl fidl::encoding::ValueTypeMarker for ShuffleMode {
2851        type Borrowed<'a> = Self;
2852        #[inline(always)]
2853        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2854            *value
2855        }
2856    }
2857
2858    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ShuffleMode {
2859        #[inline]
2860        unsafe fn encode(
2861            self,
2862            encoder: &mut fidl::encoding::Encoder<'_, D>,
2863            offset: usize,
2864            _depth: fidl::encoding::Depth,
2865        ) -> fidl::Result<()> {
2866            encoder.debug_check_bounds::<Self>(offset);
2867            encoder.write_num(self.into_primitive(), offset);
2868            Ok(())
2869        }
2870    }
2871
2872    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ShuffleMode {
2873        #[inline(always)]
2874        fn new_empty() -> Self {
2875            Self::Off
2876        }
2877
2878        #[inline]
2879        unsafe fn decode(
2880            &mut self,
2881            decoder: &mut fidl::encoding::Decoder<'_, D>,
2882            offset: usize,
2883            _depth: fidl::encoding::Depth,
2884        ) -> fidl::Result<()> {
2885            decoder.debug_check_bounds::<Self>(offset);
2886            let prim = decoder.read_num::<u8>(offset);
2887
2888            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2889            Ok(())
2890        }
2891    }
2892    unsafe impl fidl::encoding::TypeMarker for SystemStatus {
2893        type Owned = Self;
2894
2895        #[inline(always)]
2896        fn inline_align(_context: fidl::encoding::Context) -> usize {
2897            std::mem::align_of::<u8>()
2898        }
2899
2900        #[inline(always)]
2901        fn inline_size(_context: fidl::encoding::Context) -> usize {
2902            std::mem::size_of::<u8>()
2903        }
2904
2905        #[inline(always)]
2906        fn encode_is_copy() -> bool {
2907            true
2908        }
2909
2910        #[inline(always)]
2911        fn decode_is_copy() -> bool {
2912            false
2913        }
2914    }
2915
2916    impl fidl::encoding::ValueTypeMarker for SystemStatus {
2917        type Borrowed<'a> = Self;
2918        #[inline(always)]
2919        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2920            *value
2921        }
2922    }
2923
2924    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SystemStatus {
2925        #[inline]
2926        unsafe fn encode(
2927            self,
2928            encoder: &mut fidl::encoding::Encoder<'_, D>,
2929            offset: usize,
2930            _depth: fidl::encoding::Depth,
2931        ) -> fidl::Result<()> {
2932            encoder.debug_check_bounds::<Self>(offset);
2933            encoder.write_num(self.into_primitive(), offset);
2934            Ok(())
2935        }
2936    }
2937
2938    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SystemStatus {
2939        #[inline(always)]
2940        fn new_empty() -> Self {
2941            Self::PowerOn
2942        }
2943
2944        #[inline]
2945        unsafe fn decode(
2946            &mut self,
2947            decoder: &mut fidl::encoding::Decoder<'_, D>,
2948            offset: usize,
2949            _depth: fidl::encoding::Depth,
2950        ) -> fidl::Result<()> {
2951            decoder.debug_check_bounds::<Self>(offset);
2952            let prim = decoder.read_num::<u8>(offset);
2953
2954            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
2955            Ok(())
2956        }
2957    }
2958    unsafe impl fidl::encoding::TypeMarker for TargetAvcError {
2959        type Owned = Self;
2960
2961        #[inline(always)]
2962        fn inline_align(_context: fidl::encoding::Context) -> usize {
2963            std::mem::align_of::<u32>()
2964        }
2965
2966        #[inline(always)]
2967        fn inline_size(_context: fidl::encoding::Context) -> usize {
2968            std::mem::size_of::<u32>()
2969        }
2970
2971        #[inline(always)]
2972        fn encode_is_copy() -> bool {
2973            true
2974        }
2975
2976        #[inline(always)]
2977        fn decode_is_copy() -> bool {
2978            false
2979        }
2980    }
2981
2982    impl fidl::encoding::ValueTypeMarker for TargetAvcError {
2983        type Borrowed<'a> = Self;
2984        #[inline(always)]
2985        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2986            *value
2987        }
2988    }
2989
2990    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for TargetAvcError {
2991        #[inline]
2992        unsafe fn encode(
2993            self,
2994            encoder: &mut fidl::encoding::Encoder<'_, D>,
2995            offset: usize,
2996            _depth: fidl::encoding::Depth,
2997        ) -> fidl::Result<()> {
2998            encoder.debug_check_bounds::<Self>(offset);
2999            encoder.write_num(self.into_primitive(), offset);
3000            Ok(())
3001        }
3002    }
3003
3004    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TargetAvcError {
3005        #[inline(always)]
3006        fn new_empty() -> Self {
3007            Self::RejectedInvalidCommand
3008        }
3009
3010        #[inline]
3011        unsafe fn decode(
3012            &mut self,
3013            decoder: &mut fidl::encoding::Decoder<'_, D>,
3014            offset: usize,
3015            _depth: fidl::encoding::Depth,
3016        ) -> fidl::Result<()> {
3017            decoder.debug_check_bounds::<Self>(offset);
3018            let prim = decoder.read_num::<u32>(offset);
3019
3020            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3021            Ok(())
3022        }
3023    }
3024    unsafe impl fidl::encoding::TypeMarker for TargetPassthroughError {
3025        type Owned = Self;
3026
3027        #[inline(always)]
3028        fn inline_align(_context: fidl::encoding::Context) -> usize {
3029            std::mem::align_of::<u32>()
3030        }
3031
3032        #[inline(always)]
3033        fn inline_size(_context: fidl::encoding::Context) -> usize {
3034            std::mem::size_of::<u32>()
3035        }
3036
3037        #[inline(always)]
3038        fn encode_is_copy() -> bool {
3039            true
3040        }
3041
3042        #[inline(always)]
3043        fn decode_is_copy() -> bool {
3044            false
3045        }
3046    }
3047
3048    impl fidl::encoding::ValueTypeMarker for TargetPassthroughError {
3049        type Borrowed<'a> = Self;
3050        #[inline(always)]
3051        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3052            *value
3053        }
3054    }
3055
3056    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
3057        for TargetPassthroughError
3058    {
3059        #[inline]
3060        unsafe fn encode(
3061            self,
3062            encoder: &mut fidl::encoding::Encoder<'_, D>,
3063            offset: usize,
3064            _depth: fidl::encoding::Depth,
3065        ) -> fidl::Result<()> {
3066            encoder.debug_check_bounds::<Self>(offset);
3067            encoder.write_num(self.into_primitive(), offset);
3068            Ok(())
3069        }
3070    }
3071
3072    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3073        for TargetPassthroughError
3074    {
3075        #[inline(always)]
3076        fn new_empty() -> Self {
3077            Self::CommandNotImplemented
3078        }
3079
3080        #[inline]
3081        unsafe fn decode(
3082            &mut self,
3083            decoder: &mut fidl::encoding::Decoder<'_, D>,
3084            offset: usize,
3085            _depth: fidl::encoding::Depth,
3086        ) -> fidl::Result<()> {
3087            decoder.debug_check_bounds::<Self>(offset);
3088            let prim = decoder.read_num::<u32>(offset);
3089
3090            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
3091            Ok(())
3092        }
3093    }
3094
3095    impl fidl::encoding::ValueTypeMarker for AbsoluteVolumeHandlerGetCurrentVolumeResponse {
3096        type Borrowed<'a> = &'a Self;
3097        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3098            value
3099        }
3100    }
3101
3102    unsafe impl fidl::encoding::TypeMarker for AbsoluteVolumeHandlerGetCurrentVolumeResponse {
3103        type Owned = Self;
3104
3105        #[inline(always)]
3106        fn inline_align(_context: fidl::encoding::Context) -> usize {
3107            1
3108        }
3109
3110        #[inline(always)]
3111        fn inline_size(_context: fidl::encoding::Context) -> usize {
3112            1
3113        }
3114        #[inline(always)]
3115        fn encode_is_copy() -> bool {
3116            true
3117        }
3118
3119        #[inline(always)]
3120        fn decode_is_copy() -> bool {
3121            true
3122        }
3123    }
3124
3125    unsafe impl<D: fidl::encoding::ResourceDialect>
3126        fidl::encoding::Encode<AbsoluteVolumeHandlerGetCurrentVolumeResponse, D>
3127        for &AbsoluteVolumeHandlerGetCurrentVolumeResponse
3128    {
3129        #[inline]
3130        unsafe fn encode(
3131            self,
3132            encoder: &mut fidl::encoding::Encoder<'_, D>,
3133            offset: usize,
3134            _depth: fidl::encoding::Depth,
3135        ) -> fidl::Result<()> {
3136            encoder.debug_check_bounds::<AbsoluteVolumeHandlerGetCurrentVolumeResponse>(offset);
3137            unsafe {
3138                // Copy the object into the buffer.
3139                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3140                (buf_ptr as *mut AbsoluteVolumeHandlerGetCurrentVolumeResponse).write_unaligned(
3141                    (self as *const AbsoluteVolumeHandlerGetCurrentVolumeResponse).read(),
3142                );
3143                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3144                // done second because the memcpy will write garbage to these bytes.
3145            }
3146            Ok(())
3147        }
3148    }
3149    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
3150        fidl::encoding::Encode<AbsoluteVolumeHandlerGetCurrentVolumeResponse, D> for (T0,)
3151    {
3152        #[inline]
3153        unsafe fn encode(
3154            self,
3155            encoder: &mut fidl::encoding::Encoder<'_, D>,
3156            offset: usize,
3157            depth: fidl::encoding::Depth,
3158        ) -> fidl::Result<()> {
3159            encoder.debug_check_bounds::<AbsoluteVolumeHandlerGetCurrentVolumeResponse>(offset);
3160            // Zero out padding regions. There's no need to apply masks
3161            // because the unmasked parts will be overwritten by fields.
3162            // Write the fields.
3163            self.0.encode(encoder, offset + 0, depth)?;
3164            Ok(())
3165        }
3166    }
3167
3168    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3169        for AbsoluteVolumeHandlerGetCurrentVolumeResponse
3170    {
3171        #[inline(always)]
3172        fn new_empty() -> Self {
3173            Self { volume: fidl::new_empty!(u8, D) }
3174        }
3175
3176        #[inline]
3177        unsafe fn decode(
3178            &mut self,
3179            decoder: &mut fidl::encoding::Decoder<'_, D>,
3180            offset: usize,
3181            _depth: fidl::encoding::Depth,
3182        ) -> fidl::Result<()> {
3183            decoder.debug_check_bounds::<Self>(offset);
3184            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3185            // Verify that padding bytes are zero.
3186            // Copy from the buffer into the object.
3187            unsafe {
3188                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
3189            }
3190            Ok(())
3191        }
3192    }
3193
3194    impl fidl::encoding::ValueTypeMarker for AbsoluteVolumeHandlerOnVolumeChangedResponse {
3195        type Borrowed<'a> = &'a Self;
3196        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3197            value
3198        }
3199    }
3200
3201    unsafe impl fidl::encoding::TypeMarker for AbsoluteVolumeHandlerOnVolumeChangedResponse {
3202        type Owned = Self;
3203
3204        #[inline(always)]
3205        fn inline_align(_context: fidl::encoding::Context) -> usize {
3206            1
3207        }
3208
3209        #[inline(always)]
3210        fn inline_size(_context: fidl::encoding::Context) -> usize {
3211            1
3212        }
3213        #[inline(always)]
3214        fn encode_is_copy() -> bool {
3215            true
3216        }
3217
3218        #[inline(always)]
3219        fn decode_is_copy() -> bool {
3220            true
3221        }
3222    }
3223
3224    unsafe impl<D: fidl::encoding::ResourceDialect>
3225        fidl::encoding::Encode<AbsoluteVolumeHandlerOnVolumeChangedResponse, D>
3226        for &AbsoluteVolumeHandlerOnVolumeChangedResponse
3227    {
3228        #[inline]
3229        unsafe fn encode(
3230            self,
3231            encoder: &mut fidl::encoding::Encoder<'_, D>,
3232            offset: usize,
3233            _depth: fidl::encoding::Depth,
3234        ) -> fidl::Result<()> {
3235            encoder.debug_check_bounds::<AbsoluteVolumeHandlerOnVolumeChangedResponse>(offset);
3236            unsafe {
3237                // Copy the object into the buffer.
3238                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3239                (buf_ptr as *mut AbsoluteVolumeHandlerOnVolumeChangedResponse).write_unaligned(
3240                    (self as *const AbsoluteVolumeHandlerOnVolumeChangedResponse).read(),
3241                );
3242                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3243                // done second because the memcpy will write garbage to these bytes.
3244            }
3245            Ok(())
3246        }
3247    }
3248    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
3249        fidl::encoding::Encode<AbsoluteVolumeHandlerOnVolumeChangedResponse, D> for (T0,)
3250    {
3251        #[inline]
3252        unsafe fn encode(
3253            self,
3254            encoder: &mut fidl::encoding::Encoder<'_, D>,
3255            offset: usize,
3256            depth: fidl::encoding::Depth,
3257        ) -> fidl::Result<()> {
3258            encoder.debug_check_bounds::<AbsoluteVolumeHandlerOnVolumeChangedResponse>(offset);
3259            // Zero out padding regions. There's no need to apply masks
3260            // because the unmasked parts will be overwritten by fields.
3261            // Write the fields.
3262            self.0.encode(encoder, offset + 0, depth)?;
3263            Ok(())
3264        }
3265    }
3266
3267    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3268        for AbsoluteVolumeHandlerOnVolumeChangedResponse
3269    {
3270        #[inline(always)]
3271        fn new_empty() -> Self {
3272            Self { new_volume: fidl::new_empty!(u8, D) }
3273        }
3274
3275        #[inline]
3276        unsafe fn decode(
3277            &mut self,
3278            decoder: &mut fidl::encoding::Decoder<'_, D>,
3279            offset: usize,
3280            _depth: fidl::encoding::Depth,
3281        ) -> fidl::Result<()> {
3282            decoder.debug_check_bounds::<Self>(offset);
3283            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3284            // Verify that padding bytes are zero.
3285            // Copy from the buffer into the object.
3286            unsafe {
3287                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
3288            }
3289            Ok(())
3290        }
3291    }
3292
3293    impl fidl::encoding::ValueTypeMarker for AbsoluteVolumeHandlerSetVolumeRequest {
3294        type Borrowed<'a> = &'a Self;
3295        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3296            value
3297        }
3298    }
3299
3300    unsafe impl fidl::encoding::TypeMarker for AbsoluteVolumeHandlerSetVolumeRequest {
3301        type Owned = Self;
3302
3303        #[inline(always)]
3304        fn inline_align(_context: fidl::encoding::Context) -> usize {
3305            1
3306        }
3307
3308        #[inline(always)]
3309        fn inline_size(_context: fidl::encoding::Context) -> usize {
3310            1
3311        }
3312        #[inline(always)]
3313        fn encode_is_copy() -> bool {
3314            true
3315        }
3316
3317        #[inline(always)]
3318        fn decode_is_copy() -> bool {
3319            true
3320        }
3321    }
3322
3323    unsafe impl<D: fidl::encoding::ResourceDialect>
3324        fidl::encoding::Encode<AbsoluteVolumeHandlerSetVolumeRequest, D>
3325        for &AbsoluteVolumeHandlerSetVolumeRequest
3326    {
3327        #[inline]
3328        unsafe fn encode(
3329            self,
3330            encoder: &mut fidl::encoding::Encoder<'_, D>,
3331            offset: usize,
3332            _depth: fidl::encoding::Depth,
3333        ) -> fidl::Result<()> {
3334            encoder.debug_check_bounds::<AbsoluteVolumeHandlerSetVolumeRequest>(offset);
3335            unsafe {
3336                // Copy the object into the buffer.
3337                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3338                (buf_ptr as *mut AbsoluteVolumeHandlerSetVolumeRequest)
3339                    .write_unaligned((self as *const AbsoluteVolumeHandlerSetVolumeRequest).read());
3340                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3341                // done second because the memcpy will write garbage to these bytes.
3342            }
3343            Ok(())
3344        }
3345    }
3346    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
3347        fidl::encoding::Encode<AbsoluteVolumeHandlerSetVolumeRequest, D> for (T0,)
3348    {
3349        #[inline]
3350        unsafe fn encode(
3351            self,
3352            encoder: &mut fidl::encoding::Encoder<'_, D>,
3353            offset: usize,
3354            depth: fidl::encoding::Depth,
3355        ) -> fidl::Result<()> {
3356            encoder.debug_check_bounds::<AbsoluteVolumeHandlerSetVolumeRequest>(offset);
3357            // Zero out padding regions. There's no need to apply masks
3358            // because the unmasked parts will be overwritten by fields.
3359            // Write the fields.
3360            self.0.encode(encoder, offset + 0, depth)?;
3361            Ok(())
3362        }
3363    }
3364
3365    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3366        for AbsoluteVolumeHandlerSetVolumeRequest
3367    {
3368        #[inline(always)]
3369        fn new_empty() -> Self {
3370            Self { requested_volume: fidl::new_empty!(u8, D) }
3371        }
3372
3373        #[inline]
3374        unsafe fn decode(
3375            &mut self,
3376            decoder: &mut fidl::encoding::Decoder<'_, D>,
3377            offset: usize,
3378            _depth: fidl::encoding::Depth,
3379        ) -> fidl::Result<()> {
3380            decoder.debug_check_bounds::<Self>(offset);
3381            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3382            // Verify that padding bytes are zero.
3383            // Copy from the buffer into the object.
3384            unsafe {
3385                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
3386            }
3387            Ok(())
3388        }
3389    }
3390
3391    impl fidl::encoding::ValueTypeMarker for AbsoluteVolumeHandlerSetVolumeResponse {
3392        type Borrowed<'a> = &'a Self;
3393        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3394            value
3395        }
3396    }
3397
3398    unsafe impl fidl::encoding::TypeMarker for AbsoluteVolumeHandlerSetVolumeResponse {
3399        type Owned = Self;
3400
3401        #[inline(always)]
3402        fn inline_align(_context: fidl::encoding::Context) -> usize {
3403            1
3404        }
3405
3406        #[inline(always)]
3407        fn inline_size(_context: fidl::encoding::Context) -> usize {
3408            1
3409        }
3410        #[inline(always)]
3411        fn encode_is_copy() -> bool {
3412            true
3413        }
3414
3415        #[inline(always)]
3416        fn decode_is_copy() -> bool {
3417            true
3418        }
3419    }
3420
3421    unsafe impl<D: fidl::encoding::ResourceDialect>
3422        fidl::encoding::Encode<AbsoluteVolumeHandlerSetVolumeResponse, D>
3423        for &AbsoluteVolumeHandlerSetVolumeResponse
3424    {
3425        #[inline]
3426        unsafe fn encode(
3427            self,
3428            encoder: &mut fidl::encoding::Encoder<'_, D>,
3429            offset: usize,
3430            _depth: fidl::encoding::Depth,
3431        ) -> fidl::Result<()> {
3432            encoder.debug_check_bounds::<AbsoluteVolumeHandlerSetVolumeResponse>(offset);
3433            unsafe {
3434                // Copy the object into the buffer.
3435                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3436                (buf_ptr as *mut AbsoluteVolumeHandlerSetVolumeResponse).write_unaligned(
3437                    (self as *const AbsoluteVolumeHandlerSetVolumeResponse).read(),
3438                );
3439                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3440                // done second because the memcpy will write garbage to these bytes.
3441            }
3442            Ok(())
3443        }
3444    }
3445    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
3446        fidl::encoding::Encode<AbsoluteVolumeHandlerSetVolumeResponse, D> for (T0,)
3447    {
3448        #[inline]
3449        unsafe fn encode(
3450            self,
3451            encoder: &mut fidl::encoding::Encoder<'_, D>,
3452            offset: usize,
3453            depth: fidl::encoding::Depth,
3454        ) -> fidl::Result<()> {
3455            encoder.debug_check_bounds::<AbsoluteVolumeHandlerSetVolumeResponse>(offset);
3456            // Zero out padding regions. There's no need to apply masks
3457            // because the unmasked parts will be overwritten by fields.
3458            // Write the fields.
3459            self.0.encode(encoder, offset + 0, depth)?;
3460            Ok(())
3461        }
3462    }
3463
3464    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3465        for AbsoluteVolumeHandlerSetVolumeResponse
3466    {
3467        #[inline(always)]
3468        fn new_empty() -> Self {
3469            Self { set_volume: fidl::new_empty!(u8, D) }
3470        }
3471
3472        #[inline]
3473        unsafe fn decode(
3474            &mut self,
3475            decoder: &mut fidl::encoding::Decoder<'_, D>,
3476            offset: usize,
3477            _depth: fidl::encoding::Depth,
3478        ) -> fidl::Result<()> {
3479            decoder.debug_check_bounds::<Self>(offset);
3480            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3481            // Verify that padding bytes are zero.
3482            // Copy from the buffer into the object.
3483            unsafe {
3484                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
3485            }
3486            Ok(())
3487        }
3488    }
3489
3490    impl fidl::encoding::ValueTypeMarker for AddressedPlayerId {
3491        type Borrowed<'a> = &'a Self;
3492        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3493            value
3494        }
3495    }
3496
3497    unsafe impl fidl::encoding::TypeMarker for AddressedPlayerId {
3498        type Owned = Self;
3499
3500        #[inline(always)]
3501        fn inline_align(_context: fidl::encoding::Context) -> usize {
3502            2
3503        }
3504
3505        #[inline(always)]
3506        fn inline_size(_context: fidl::encoding::Context) -> usize {
3507            2
3508        }
3509        #[inline(always)]
3510        fn encode_is_copy() -> bool {
3511            true
3512        }
3513
3514        #[inline(always)]
3515        fn decode_is_copy() -> bool {
3516            true
3517        }
3518    }
3519
3520    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddressedPlayerId, D>
3521        for &AddressedPlayerId
3522    {
3523        #[inline]
3524        unsafe fn encode(
3525            self,
3526            encoder: &mut fidl::encoding::Encoder<'_, D>,
3527            offset: usize,
3528            _depth: fidl::encoding::Depth,
3529        ) -> fidl::Result<()> {
3530            encoder.debug_check_bounds::<AddressedPlayerId>(offset);
3531            unsafe {
3532                // Copy the object into the buffer.
3533                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3534                (buf_ptr as *mut AddressedPlayerId)
3535                    .write_unaligned((self as *const AddressedPlayerId).read());
3536                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3537                // done second because the memcpy will write garbage to these bytes.
3538            }
3539            Ok(())
3540        }
3541    }
3542    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
3543        fidl::encoding::Encode<AddressedPlayerId, D> for (T0,)
3544    {
3545        #[inline]
3546        unsafe fn encode(
3547            self,
3548            encoder: &mut fidl::encoding::Encoder<'_, D>,
3549            offset: usize,
3550            depth: fidl::encoding::Depth,
3551        ) -> fidl::Result<()> {
3552            encoder.debug_check_bounds::<AddressedPlayerId>(offset);
3553            // Zero out padding regions. There's no need to apply masks
3554            // because the unmasked parts will be overwritten by fields.
3555            // Write the fields.
3556            self.0.encode(encoder, offset + 0, depth)?;
3557            Ok(())
3558        }
3559    }
3560
3561    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddressedPlayerId {
3562        #[inline(always)]
3563        fn new_empty() -> Self {
3564            Self { id: fidl::new_empty!(u16, D) }
3565        }
3566
3567        #[inline]
3568        unsafe fn decode(
3569            &mut self,
3570            decoder: &mut fidl::encoding::Decoder<'_, D>,
3571            offset: usize,
3572            _depth: fidl::encoding::Depth,
3573        ) -> fidl::Result<()> {
3574            decoder.debug_check_bounds::<Self>(offset);
3575            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3576            // Verify that padding bytes are zero.
3577            // Copy from the buffer into the object.
3578            unsafe {
3579                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
3580            }
3581            Ok(())
3582        }
3583    }
3584
3585    impl fidl::encoding::ValueTypeMarker for BrowseControllerChangePathRequest {
3586        type Borrowed<'a> = &'a Self;
3587        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3588            value
3589        }
3590    }
3591
3592    unsafe impl fidl::encoding::TypeMarker for BrowseControllerChangePathRequest {
3593        type Owned = Self;
3594
3595        #[inline(always)]
3596        fn inline_align(_context: fidl::encoding::Context) -> usize {
3597            8
3598        }
3599
3600        #[inline(always)]
3601        fn inline_size(_context: fidl::encoding::Context) -> usize {
3602            16
3603        }
3604    }
3605
3606    unsafe impl<D: fidl::encoding::ResourceDialect>
3607        fidl::encoding::Encode<BrowseControllerChangePathRequest, D>
3608        for &BrowseControllerChangePathRequest
3609    {
3610        #[inline]
3611        unsafe fn encode(
3612            self,
3613            encoder: &mut fidl::encoding::Encoder<'_, D>,
3614            offset: usize,
3615            _depth: fidl::encoding::Depth,
3616        ) -> fidl::Result<()> {
3617            encoder.debug_check_bounds::<BrowseControllerChangePathRequest>(offset);
3618            // Delegate to tuple encoding.
3619            fidl::encoding::Encode::<BrowseControllerChangePathRequest, D>::encode(
3620                (<Path as fidl::encoding::ValueTypeMarker>::borrow(&self.path),),
3621                encoder,
3622                offset,
3623                _depth,
3624            )
3625        }
3626    }
3627    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Path, D>>
3628        fidl::encoding::Encode<BrowseControllerChangePathRequest, D> for (T0,)
3629    {
3630        #[inline]
3631        unsafe fn encode(
3632            self,
3633            encoder: &mut fidl::encoding::Encoder<'_, D>,
3634            offset: usize,
3635            depth: fidl::encoding::Depth,
3636        ) -> fidl::Result<()> {
3637            encoder.debug_check_bounds::<BrowseControllerChangePathRequest>(offset);
3638            // Zero out padding regions. There's no need to apply masks
3639            // because the unmasked parts will be overwritten by fields.
3640            // Write the fields.
3641            self.0.encode(encoder, offset + 0, depth)?;
3642            Ok(())
3643        }
3644    }
3645
3646    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3647        for BrowseControllerChangePathRequest
3648    {
3649        #[inline(always)]
3650        fn new_empty() -> Self {
3651            Self { path: fidl::new_empty!(Path, D) }
3652        }
3653
3654        #[inline]
3655        unsafe fn decode(
3656            &mut self,
3657            decoder: &mut fidl::encoding::Decoder<'_, D>,
3658            offset: usize,
3659            _depth: fidl::encoding::Depth,
3660        ) -> fidl::Result<()> {
3661            decoder.debug_check_bounds::<Self>(offset);
3662            // Verify that padding bytes are zero.
3663            fidl::decode!(Path, D, &mut self.path, decoder, offset + 0, _depth)?;
3664            Ok(())
3665        }
3666    }
3667
3668    impl fidl::encoding::ValueTypeMarker for BrowseControllerGetFileSystemItemsRequest {
3669        type Borrowed<'a> = &'a Self;
3670        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3671            value
3672        }
3673    }
3674
3675    unsafe impl fidl::encoding::TypeMarker for BrowseControllerGetFileSystemItemsRequest {
3676        type Owned = Self;
3677
3678        #[inline(always)]
3679        fn inline_align(_context: fidl::encoding::Context) -> usize {
3680            8
3681        }
3682
3683        #[inline(always)]
3684        fn inline_size(_context: fidl::encoding::Context) -> usize {
3685            24
3686        }
3687    }
3688
3689    unsafe impl<D: fidl::encoding::ResourceDialect>
3690        fidl::encoding::Encode<BrowseControllerGetFileSystemItemsRequest, D>
3691        for &BrowseControllerGetFileSystemItemsRequest
3692    {
3693        #[inline]
3694        unsafe fn encode(
3695            self,
3696            encoder: &mut fidl::encoding::Encoder<'_, D>,
3697            offset: usize,
3698            _depth: fidl::encoding::Depth,
3699        ) -> fidl::Result<()> {
3700            encoder.debug_check_bounds::<BrowseControllerGetFileSystemItemsRequest>(offset);
3701            // Delegate to tuple encoding.
3702            fidl::encoding::Encode::<BrowseControllerGetFileSystemItemsRequest, D>::encode(
3703                (
3704                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.start_index),
3705                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_index),
3706                    <AttributeRequestOption as fidl::encoding::ValueTypeMarker>::borrow(
3707                        &self.attribute_option,
3708                    ),
3709                ),
3710                encoder,
3711                offset,
3712                _depth,
3713            )
3714        }
3715    }
3716    unsafe impl<
3717            D: fidl::encoding::ResourceDialect,
3718            T0: fidl::encoding::Encode<u32, D>,
3719            T1: fidl::encoding::Encode<u32, D>,
3720            T2: fidl::encoding::Encode<AttributeRequestOption, D>,
3721        > fidl::encoding::Encode<BrowseControllerGetFileSystemItemsRequest, D> for (T0, T1, T2)
3722    {
3723        #[inline]
3724        unsafe fn encode(
3725            self,
3726            encoder: &mut fidl::encoding::Encoder<'_, D>,
3727            offset: usize,
3728            depth: fidl::encoding::Depth,
3729        ) -> fidl::Result<()> {
3730            encoder.debug_check_bounds::<BrowseControllerGetFileSystemItemsRequest>(offset);
3731            // Zero out padding regions. There's no need to apply masks
3732            // because the unmasked parts will be overwritten by fields.
3733            // Write the fields.
3734            self.0.encode(encoder, offset + 0, depth)?;
3735            self.1.encode(encoder, offset + 4, depth)?;
3736            self.2.encode(encoder, offset + 8, depth)?;
3737            Ok(())
3738        }
3739    }
3740
3741    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3742        for BrowseControllerGetFileSystemItemsRequest
3743    {
3744        #[inline(always)]
3745        fn new_empty() -> Self {
3746            Self {
3747                start_index: fidl::new_empty!(u32, D),
3748                end_index: fidl::new_empty!(u32, D),
3749                attribute_option: fidl::new_empty!(AttributeRequestOption, D),
3750            }
3751        }
3752
3753        #[inline]
3754        unsafe fn decode(
3755            &mut self,
3756            decoder: &mut fidl::encoding::Decoder<'_, D>,
3757            offset: usize,
3758            _depth: fidl::encoding::Depth,
3759        ) -> fidl::Result<()> {
3760            decoder.debug_check_bounds::<Self>(offset);
3761            // Verify that padding bytes are zero.
3762            fidl::decode!(u32, D, &mut self.start_index, decoder, offset + 0, _depth)?;
3763            fidl::decode!(u32, D, &mut self.end_index, decoder, offset + 4, _depth)?;
3764            fidl::decode!(
3765                AttributeRequestOption,
3766                D,
3767                &mut self.attribute_option,
3768                decoder,
3769                offset + 8,
3770                _depth
3771            )?;
3772            Ok(())
3773        }
3774    }
3775
3776    impl fidl::encoding::ValueTypeMarker for BrowseControllerGetMediaPlayerItemsRequest {
3777        type Borrowed<'a> = &'a Self;
3778        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3779            value
3780        }
3781    }
3782
3783    unsafe impl fidl::encoding::TypeMarker for BrowseControllerGetMediaPlayerItemsRequest {
3784        type Owned = Self;
3785
3786        #[inline(always)]
3787        fn inline_align(_context: fidl::encoding::Context) -> usize {
3788            4
3789        }
3790
3791        #[inline(always)]
3792        fn inline_size(_context: fidl::encoding::Context) -> usize {
3793            8
3794        }
3795        #[inline(always)]
3796        fn encode_is_copy() -> bool {
3797            true
3798        }
3799
3800        #[inline(always)]
3801        fn decode_is_copy() -> bool {
3802            true
3803        }
3804    }
3805
3806    unsafe impl<D: fidl::encoding::ResourceDialect>
3807        fidl::encoding::Encode<BrowseControllerGetMediaPlayerItemsRequest, D>
3808        for &BrowseControllerGetMediaPlayerItemsRequest
3809    {
3810        #[inline]
3811        unsafe fn encode(
3812            self,
3813            encoder: &mut fidl::encoding::Encoder<'_, D>,
3814            offset: usize,
3815            _depth: fidl::encoding::Depth,
3816        ) -> fidl::Result<()> {
3817            encoder.debug_check_bounds::<BrowseControllerGetMediaPlayerItemsRequest>(offset);
3818            unsafe {
3819                // Copy the object into the buffer.
3820                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3821                (buf_ptr as *mut BrowseControllerGetMediaPlayerItemsRequest).write_unaligned(
3822                    (self as *const BrowseControllerGetMediaPlayerItemsRequest).read(),
3823                );
3824                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
3825                // done second because the memcpy will write garbage to these bytes.
3826            }
3827            Ok(())
3828        }
3829    }
3830    unsafe impl<
3831            D: fidl::encoding::ResourceDialect,
3832            T0: fidl::encoding::Encode<u32, D>,
3833            T1: fidl::encoding::Encode<u32, D>,
3834        > fidl::encoding::Encode<BrowseControllerGetMediaPlayerItemsRequest, D> for (T0, T1)
3835    {
3836        #[inline]
3837        unsafe fn encode(
3838            self,
3839            encoder: &mut fidl::encoding::Encoder<'_, D>,
3840            offset: usize,
3841            depth: fidl::encoding::Depth,
3842        ) -> fidl::Result<()> {
3843            encoder.debug_check_bounds::<BrowseControllerGetMediaPlayerItemsRequest>(offset);
3844            // Zero out padding regions. There's no need to apply masks
3845            // because the unmasked parts will be overwritten by fields.
3846            // Write the fields.
3847            self.0.encode(encoder, offset + 0, depth)?;
3848            self.1.encode(encoder, offset + 4, depth)?;
3849            Ok(())
3850        }
3851    }
3852
3853    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3854        for BrowseControllerGetMediaPlayerItemsRequest
3855    {
3856        #[inline(always)]
3857        fn new_empty() -> Self {
3858            Self { start_index: fidl::new_empty!(u32, D), end_index: fidl::new_empty!(u32, D) }
3859        }
3860
3861        #[inline]
3862        unsafe fn decode(
3863            &mut self,
3864            decoder: &mut fidl::encoding::Decoder<'_, D>,
3865            offset: usize,
3866            _depth: fidl::encoding::Depth,
3867        ) -> fidl::Result<()> {
3868            decoder.debug_check_bounds::<Self>(offset);
3869            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3870            // Verify that padding bytes are zero.
3871            // Copy from the buffer into the object.
3872            unsafe {
3873                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
3874            }
3875            Ok(())
3876        }
3877    }
3878
3879    impl fidl::encoding::ValueTypeMarker for BrowseControllerGetNowPlayingItemsRequest {
3880        type Borrowed<'a> = &'a Self;
3881        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3882            value
3883        }
3884    }
3885
3886    unsafe impl fidl::encoding::TypeMarker for BrowseControllerGetNowPlayingItemsRequest {
3887        type Owned = Self;
3888
3889        #[inline(always)]
3890        fn inline_align(_context: fidl::encoding::Context) -> usize {
3891            8
3892        }
3893
3894        #[inline(always)]
3895        fn inline_size(_context: fidl::encoding::Context) -> usize {
3896            24
3897        }
3898    }
3899
3900    unsafe impl<D: fidl::encoding::ResourceDialect>
3901        fidl::encoding::Encode<BrowseControllerGetNowPlayingItemsRequest, D>
3902        for &BrowseControllerGetNowPlayingItemsRequest
3903    {
3904        #[inline]
3905        unsafe fn encode(
3906            self,
3907            encoder: &mut fidl::encoding::Encoder<'_, D>,
3908            offset: usize,
3909            _depth: fidl::encoding::Depth,
3910        ) -> fidl::Result<()> {
3911            encoder.debug_check_bounds::<BrowseControllerGetNowPlayingItemsRequest>(offset);
3912            // Delegate to tuple encoding.
3913            fidl::encoding::Encode::<BrowseControllerGetNowPlayingItemsRequest, D>::encode(
3914                (
3915                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.start_index),
3916                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_index),
3917                    <AttributeRequestOption as fidl::encoding::ValueTypeMarker>::borrow(
3918                        &self.attribute_option,
3919                    ),
3920                ),
3921                encoder,
3922                offset,
3923                _depth,
3924            )
3925        }
3926    }
3927    unsafe impl<
3928            D: fidl::encoding::ResourceDialect,
3929            T0: fidl::encoding::Encode<u32, D>,
3930            T1: fidl::encoding::Encode<u32, D>,
3931            T2: fidl::encoding::Encode<AttributeRequestOption, D>,
3932        > fidl::encoding::Encode<BrowseControllerGetNowPlayingItemsRequest, D> for (T0, T1, T2)
3933    {
3934        #[inline]
3935        unsafe fn encode(
3936            self,
3937            encoder: &mut fidl::encoding::Encoder<'_, D>,
3938            offset: usize,
3939            depth: fidl::encoding::Depth,
3940        ) -> fidl::Result<()> {
3941            encoder.debug_check_bounds::<BrowseControllerGetNowPlayingItemsRequest>(offset);
3942            // Zero out padding regions. There's no need to apply masks
3943            // because the unmasked parts will be overwritten by fields.
3944            // Write the fields.
3945            self.0.encode(encoder, offset + 0, depth)?;
3946            self.1.encode(encoder, offset + 4, depth)?;
3947            self.2.encode(encoder, offset + 8, depth)?;
3948            Ok(())
3949        }
3950    }
3951
3952    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3953        for BrowseControllerGetNowPlayingItemsRequest
3954    {
3955        #[inline(always)]
3956        fn new_empty() -> Self {
3957            Self {
3958                start_index: fidl::new_empty!(u32, D),
3959                end_index: fidl::new_empty!(u32, D),
3960                attribute_option: fidl::new_empty!(AttributeRequestOption, D),
3961            }
3962        }
3963
3964        #[inline]
3965        unsafe fn decode(
3966            &mut self,
3967            decoder: &mut fidl::encoding::Decoder<'_, D>,
3968            offset: usize,
3969            _depth: fidl::encoding::Depth,
3970        ) -> fidl::Result<()> {
3971            decoder.debug_check_bounds::<Self>(offset);
3972            // Verify that padding bytes are zero.
3973            fidl::decode!(u32, D, &mut self.start_index, decoder, offset + 0, _depth)?;
3974            fidl::decode!(u32, D, &mut self.end_index, decoder, offset + 4, _depth)?;
3975            fidl::decode!(
3976                AttributeRequestOption,
3977                D,
3978                &mut self.attribute_option,
3979                decoder,
3980                offset + 8,
3981                _depth
3982            )?;
3983            Ok(())
3984        }
3985    }
3986
3987    impl fidl::encoding::ValueTypeMarker for BrowseControllerPlayFileSystemItemRequest {
3988        type Borrowed<'a> = &'a Self;
3989        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3990            value
3991        }
3992    }
3993
3994    unsafe impl fidl::encoding::TypeMarker for BrowseControllerPlayFileSystemItemRequest {
3995        type Owned = Self;
3996
3997        #[inline(always)]
3998        fn inline_align(_context: fidl::encoding::Context) -> usize {
3999            8
4000        }
4001
4002        #[inline(always)]
4003        fn inline_size(_context: fidl::encoding::Context) -> usize {
4004            8
4005        }
4006        #[inline(always)]
4007        fn encode_is_copy() -> bool {
4008            true
4009        }
4010
4011        #[inline(always)]
4012        fn decode_is_copy() -> bool {
4013            true
4014        }
4015    }
4016
4017    unsafe impl<D: fidl::encoding::ResourceDialect>
4018        fidl::encoding::Encode<BrowseControllerPlayFileSystemItemRequest, D>
4019        for &BrowseControllerPlayFileSystemItemRequest
4020    {
4021        #[inline]
4022        unsafe fn encode(
4023            self,
4024            encoder: &mut fidl::encoding::Encoder<'_, D>,
4025            offset: usize,
4026            _depth: fidl::encoding::Depth,
4027        ) -> fidl::Result<()> {
4028            encoder.debug_check_bounds::<BrowseControllerPlayFileSystemItemRequest>(offset);
4029            unsafe {
4030                // Copy the object into the buffer.
4031                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4032                (buf_ptr as *mut BrowseControllerPlayFileSystemItemRequest).write_unaligned(
4033                    (self as *const BrowseControllerPlayFileSystemItemRequest).read(),
4034                );
4035                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4036                // done second because the memcpy will write garbage to these bytes.
4037            }
4038            Ok(())
4039        }
4040    }
4041    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4042        fidl::encoding::Encode<BrowseControllerPlayFileSystemItemRequest, D> for (T0,)
4043    {
4044        #[inline]
4045        unsafe fn encode(
4046            self,
4047            encoder: &mut fidl::encoding::Encoder<'_, D>,
4048            offset: usize,
4049            depth: fidl::encoding::Depth,
4050        ) -> fidl::Result<()> {
4051            encoder.debug_check_bounds::<BrowseControllerPlayFileSystemItemRequest>(offset);
4052            // Zero out padding regions. There's no need to apply masks
4053            // because the unmasked parts will be overwritten by fields.
4054            // Write the fields.
4055            self.0.encode(encoder, offset + 0, depth)?;
4056            Ok(())
4057        }
4058    }
4059
4060    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4061        for BrowseControllerPlayFileSystemItemRequest
4062    {
4063        #[inline(always)]
4064        fn new_empty() -> Self {
4065            Self { uid: fidl::new_empty!(u64, D) }
4066        }
4067
4068        #[inline]
4069        unsafe fn decode(
4070            &mut self,
4071            decoder: &mut fidl::encoding::Decoder<'_, D>,
4072            offset: usize,
4073            _depth: fidl::encoding::Depth,
4074        ) -> fidl::Result<()> {
4075            decoder.debug_check_bounds::<Self>(offset);
4076            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4077            // Verify that padding bytes are zero.
4078            // Copy from the buffer into the object.
4079            unsafe {
4080                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4081            }
4082            Ok(())
4083        }
4084    }
4085
4086    impl fidl::encoding::ValueTypeMarker for BrowseControllerPlayNowPlayingItemRequest {
4087        type Borrowed<'a> = &'a Self;
4088        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4089            value
4090        }
4091    }
4092
4093    unsafe impl fidl::encoding::TypeMarker for BrowseControllerPlayNowPlayingItemRequest {
4094        type Owned = Self;
4095
4096        #[inline(always)]
4097        fn inline_align(_context: fidl::encoding::Context) -> usize {
4098            8
4099        }
4100
4101        #[inline(always)]
4102        fn inline_size(_context: fidl::encoding::Context) -> usize {
4103            8
4104        }
4105        #[inline(always)]
4106        fn encode_is_copy() -> bool {
4107            true
4108        }
4109
4110        #[inline(always)]
4111        fn decode_is_copy() -> bool {
4112            true
4113        }
4114    }
4115
4116    unsafe impl<D: fidl::encoding::ResourceDialect>
4117        fidl::encoding::Encode<BrowseControllerPlayNowPlayingItemRequest, D>
4118        for &BrowseControllerPlayNowPlayingItemRequest
4119    {
4120        #[inline]
4121        unsafe fn encode(
4122            self,
4123            encoder: &mut fidl::encoding::Encoder<'_, D>,
4124            offset: usize,
4125            _depth: fidl::encoding::Depth,
4126        ) -> fidl::Result<()> {
4127            encoder.debug_check_bounds::<BrowseControllerPlayNowPlayingItemRequest>(offset);
4128            unsafe {
4129                // Copy the object into the buffer.
4130                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4131                (buf_ptr as *mut BrowseControllerPlayNowPlayingItemRequest).write_unaligned(
4132                    (self as *const BrowseControllerPlayNowPlayingItemRequest).read(),
4133                );
4134                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4135                // done second because the memcpy will write garbage to these bytes.
4136            }
4137            Ok(())
4138        }
4139    }
4140    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
4141        fidl::encoding::Encode<BrowseControllerPlayNowPlayingItemRequest, D> for (T0,)
4142    {
4143        #[inline]
4144        unsafe fn encode(
4145            self,
4146            encoder: &mut fidl::encoding::Encoder<'_, D>,
4147            offset: usize,
4148            depth: fidl::encoding::Depth,
4149        ) -> fidl::Result<()> {
4150            encoder.debug_check_bounds::<BrowseControllerPlayNowPlayingItemRequest>(offset);
4151            // Zero out padding regions. There's no need to apply masks
4152            // because the unmasked parts will be overwritten by fields.
4153            // Write the fields.
4154            self.0.encode(encoder, offset + 0, depth)?;
4155            Ok(())
4156        }
4157    }
4158
4159    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4160        for BrowseControllerPlayNowPlayingItemRequest
4161    {
4162        #[inline(always)]
4163        fn new_empty() -> Self {
4164            Self { uid: fidl::new_empty!(u64, D) }
4165        }
4166
4167        #[inline]
4168        unsafe fn decode(
4169            &mut self,
4170            decoder: &mut fidl::encoding::Decoder<'_, D>,
4171            offset: usize,
4172            _depth: fidl::encoding::Depth,
4173        ) -> fidl::Result<()> {
4174            decoder.debug_check_bounds::<Self>(offset);
4175            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4176            // Verify that padding bytes are zero.
4177            // Copy from the buffer into the object.
4178            unsafe {
4179                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
4180            }
4181            Ok(())
4182        }
4183    }
4184
4185    impl fidl::encoding::ValueTypeMarker for BrowseControllerSetBrowsedPlayerRequest {
4186        type Borrowed<'a> = &'a Self;
4187        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4188            value
4189        }
4190    }
4191
4192    unsafe impl fidl::encoding::TypeMarker for BrowseControllerSetBrowsedPlayerRequest {
4193        type Owned = Self;
4194
4195        #[inline(always)]
4196        fn inline_align(_context: fidl::encoding::Context) -> usize {
4197            2
4198        }
4199
4200        #[inline(always)]
4201        fn inline_size(_context: fidl::encoding::Context) -> usize {
4202            2
4203        }
4204        #[inline(always)]
4205        fn encode_is_copy() -> bool {
4206            true
4207        }
4208
4209        #[inline(always)]
4210        fn decode_is_copy() -> bool {
4211            true
4212        }
4213    }
4214
4215    unsafe impl<D: fidl::encoding::ResourceDialect>
4216        fidl::encoding::Encode<BrowseControllerSetBrowsedPlayerRequest, D>
4217        for &BrowseControllerSetBrowsedPlayerRequest
4218    {
4219        #[inline]
4220        unsafe fn encode(
4221            self,
4222            encoder: &mut fidl::encoding::Encoder<'_, D>,
4223            offset: usize,
4224            _depth: fidl::encoding::Depth,
4225        ) -> fidl::Result<()> {
4226            encoder.debug_check_bounds::<BrowseControllerSetBrowsedPlayerRequest>(offset);
4227            unsafe {
4228                // Copy the object into the buffer.
4229                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4230                (buf_ptr as *mut BrowseControllerSetBrowsedPlayerRequest).write_unaligned(
4231                    (self as *const BrowseControllerSetBrowsedPlayerRequest).read(),
4232                );
4233                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4234                // done second because the memcpy will write garbage to these bytes.
4235            }
4236            Ok(())
4237        }
4238    }
4239    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
4240        fidl::encoding::Encode<BrowseControllerSetBrowsedPlayerRequest, D> for (T0,)
4241    {
4242        #[inline]
4243        unsafe fn encode(
4244            self,
4245            encoder: &mut fidl::encoding::Encoder<'_, D>,
4246            offset: usize,
4247            depth: fidl::encoding::Depth,
4248        ) -> fidl::Result<()> {
4249            encoder.debug_check_bounds::<BrowseControllerSetBrowsedPlayerRequest>(offset);
4250            // Zero out padding regions. There's no need to apply masks
4251            // because the unmasked parts will be overwritten by fields.
4252            // Write the fields.
4253            self.0.encode(encoder, offset + 0, depth)?;
4254            Ok(())
4255        }
4256    }
4257
4258    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4259        for BrowseControllerSetBrowsedPlayerRequest
4260    {
4261        #[inline(always)]
4262        fn new_empty() -> Self {
4263            Self { player_id: fidl::new_empty!(u16, D) }
4264        }
4265
4266        #[inline]
4267        unsafe fn decode(
4268            &mut self,
4269            decoder: &mut fidl::encoding::Decoder<'_, D>,
4270            offset: usize,
4271            _depth: fidl::encoding::Depth,
4272        ) -> fidl::Result<()> {
4273            decoder.debug_check_bounds::<Self>(offset);
4274            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4275            // Verify that padding bytes are zero.
4276            // Copy from the buffer into the object.
4277            unsafe {
4278                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
4279            }
4280            Ok(())
4281        }
4282    }
4283
4284    impl fidl::encoding::ValueTypeMarker for BrowseControllerChangePathResponse {
4285        type Borrowed<'a> = &'a Self;
4286        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4287            value
4288        }
4289    }
4290
4291    unsafe impl fidl::encoding::TypeMarker for BrowseControllerChangePathResponse {
4292        type Owned = Self;
4293
4294        #[inline(always)]
4295        fn inline_align(_context: fidl::encoding::Context) -> usize {
4296            4
4297        }
4298
4299        #[inline(always)]
4300        fn inline_size(_context: fidl::encoding::Context) -> usize {
4301            4
4302        }
4303        #[inline(always)]
4304        fn encode_is_copy() -> bool {
4305            true
4306        }
4307
4308        #[inline(always)]
4309        fn decode_is_copy() -> bool {
4310            true
4311        }
4312    }
4313
4314    unsafe impl<D: fidl::encoding::ResourceDialect>
4315        fidl::encoding::Encode<BrowseControllerChangePathResponse, D>
4316        for &BrowseControllerChangePathResponse
4317    {
4318        #[inline]
4319        unsafe fn encode(
4320            self,
4321            encoder: &mut fidl::encoding::Encoder<'_, D>,
4322            offset: usize,
4323            _depth: fidl::encoding::Depth,
4324        ) -> fidl::Result<()> {
4325            encoder.debug_check_bounds::<BrowseControllerChangePathResponse>(offset);
4326            unsafe {
4327                // Copy the object into the buffer.
4328                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4329                (buf_ptr as *mut BrowseControllerChangePathResponse)
4330                    .write_unaligned((self as *const BrowseControllerChangePathResponse).read());
4331                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4332                // done second because the memcpy will write garbage to these bytes.
4333            }
4334            Ok(())
4335        }
4336    }
4337    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
4338        fidl::encoding::Encode<BrowseControllerChangePathResponse, D> for (T0,)
4339    {
4340        #[inline]
4341        unsafe fn encode(
4342            self,
4343            encoder: &mut fidl::encoding::Encoder<'_, D>,
4344            offset: usize,
4345            depth: fidl::encoding::Depth,
4346        ) -> fidl::Result<()> {
4347            encoder.debug_check_bounds::<BrowseControllerChangePathResponse>(offset);
4348            // Zero out padding regions. There's no need to apply masks
4349            // because the unmasked parts will be overwritten by fields.
4350            // Write the fields.
4351            self.0.encode(encoder, offset + 0, depth)?;
4352            Ok(())
4353        }
4354    }
4355
4356    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4357        for BrowseControllerChangePathResponse
4358    {
4359        #[inline(always)]
4360        fn new_empty() -> Self {
4361            Self { num_items: fidl::new_empty!(u32, D) }
4362        }
4363
4364        #[inline]
4365        unsafe fn decode(
4366            &mut self,
4367            decoder: &mut fidl::encoding::Decoder<'_, D>,
4368            offset: usize,
4369            _depth: fidl::encoding::Depth,
4370        ) -> fidl::Result<()> {
4371            decoder.debug_check_bounds::<Self>(offset);
4372            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4373            // Verify that padding bytes are zero.
4374            // Copy from the buffer into the object.
4375            unsafe {
4376                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
4377            }
4378            Ok(())
4379        }
4380    }
4381
4382    impl fidl::encoding::ValueTypeMarker for BrowseControllerGetFileSystemItemsResponse {
4383        type Borrowed<'a> = &'a Self;
4384        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4385            value
4386        }
4387    }
4388
4389    unsafe impl fidl::encoding::TypeMarker for BrowseControllerGetFileSystemItemsResponse {
4390        type Owned = Self;
4391
4392        #[inline(always)]
4393        fn inline_align(_context: fidl::encoding::Context) -> usize {
4394            8
4395        }
4396
4397        #[inline(always)]
4398        fn inline_size(_context: fidl::encoding::Context) -> usize {
4399            16
4400        }
4401    }
4402
4403    unsafe impl<D: fidl::encoding::ResourceDialect>
4404        fidl::encoding::Encode<BrowseControllerGetFileSystemItemsResponse, D>
4405        for &BrowseControllerGetFileSystemItemsResponse
4406    {
4407        #[inline]
4408        unsafe fn encode(
4409            self,
4410            encoder: &mut fidl::encoding::Encoder<'_, D>,
4411            offset: usize,
4412            _depth: fidl::encoding::Depth,
4413        ) -> fidl::Result<()> {
4414            encoder.debug_check_bounds::<BrowseControllerGetFileSystemItemsResponse>(offset);
4415            // Delegate to tuple encoding.
4416            fidl::encoding::Encode::<BrowseControllerGetFileSystemItemsResponse, D>::encode(
4417                (
4418                    <fidl::encoding::Vector<FileSystemItem, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
4419                ),
4420                encoder, offset, _depth
4421            )
4422        }
4423    }
4424    unsafe impl<
4425            D: fidl::encoding::ResourceDialect,
4426            T0: fidl::encoding::Encode<fidl::encoding::Vector<FileSystemItem, 16>, D>,
4427        > fidl::encoding::Encode<BrowseControllerGetFileSystemItemsResponse, D> for (T0,)
4428    {
4429        #[inline]
4430        unsafe fn encode(
4431            self,
4432            encoder: &mut fidl::encoding::Encoder<'_, D>,
4433            offset: usize,
4434            depth: fidl::encoding::Depth,
4435        ) -> fidl::Result<()> {
4436            encoder.debug_check_bounds::<BrowseControllerGetFileSystemItemsResponse>(offset);
4437            // Zero out padding regions. There's no need to apply masks
4438            // because the unmasked parts will be overwritten by fields.
4439            // Write the fields.
4440            self.0.encode(encoder, offset + 0, depth)?;
4441            Ok(())
4442        }
4443    }
4444
4445    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4446        for BrowseControllerGetFileSystemItemsResponse
4447    {
4448        #[inline(always)]
4449        fn new_empty() -> Self {
4450            Self { items: fidl::new_empty!(fidl::encoding::Vector<FileSystemItem, 16>, D) }
4451        }
4452
4453        #[inline]
4454        unsafe fn decode(
4455            &mut self,
4456            decoder: &mut fidl::encoding::Decoder<'_, D>,
4457            offset: usize,
4458            _depth: fidl::encoding::Depth,
4459        ) -> fidl::Result<()> {
4460            decoder.debug_check_bounds::<Self>(offset);
4461            // Verify that padding bytes are zero.
4462            fidl::decode!(fidl::encoding::Vector<FileSystemItem, 16>, D, &mut self.items, decoder, offset + 0, _depth)?;
4463            Ok(())
4464        }
4465    }
4466
4467    impl fidl::encoding::ValueTypeMarker for BrowseControllerGetMediaPlayerItemsResponse {
4468        type Borrowed<'a> = &'a Self;
4469        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4470            value
4471        }
4472    }
4473
4474    unsafe impl fidl::encoding::TypeMarker for BrowseControllerGetMediaPlayerItemsResponse {
4475        type Owned = Self;
4476
4477        #[inline(always)]
4478        fn inline_align(_context: fidl::encoding::Context) -> usize {
4479            8
4480        }
4481
4482        #[inline(always)]
4483        fn inline_size(_context: fidl::encoding::Context) -> usize {
4484            16
4485        }
4486    }
4487
4488    unsafe impl<D: fidl::encoding::ResourceDialect>
4489        fidl::encoding::Encode<BrowseControllerGetMediaPlayerItemsResponse, D>
4490        for &BrowseControllerGetMediaPlayerItemsResponse
4491    {
4492        #[inline]
4493        unsafe fn encode(
4494            self,
4495            encoder: &mut fidl::encoding::Encoder<'_, D>,
4496            offset: usize,
4497            _depth: fidl::encoding::Depth,
4498        ) -> fidl::Result<()> {
4499            encoder.debug_check_bounds::<BrowseControllerGetMediaPlayerItemsResponse>(offset);
4500            // Delegate to tuple encoding.
4501            fidl::encoding::Encode::<BrowseControllerGetMediaPlayerItemsResponse, D>::encode(
4502                (
4503                    <fidl::encoding::Vector<MediaPlayerItem, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
4504                ),
4505                encoder, offset, _depth
4506            )
4507        }
4508    }
4509    unsafe impl<
4510            D: fidl::encoding::ResourceDialect,
4511            T0: fidl::encoding::Encode<fidl::encoding::Vector<MediaPlayerItem, 16>, D>,
4512        > fidl::encoding::Encode<BrowseControllerGetMediaPlayerItemsResponse, D> for (T0,)
4513    {
4514        #[inline]
4515        unsafe fn encode(
4516            self,
4517            encoder: &mut fidl::encoding::Encoder<'_, D>,
4518            offset: usize,
4519            depth: fidl::encoding::Depth,
4520        ) -> fidl::Result<()> {
4521            encoder.debug_check_bounds::<BrowseControllerGetMediaPlayerItemsResponse>(offset);
4522            // Zero out padding regions. There's no need to apply masks
4523            // because the unmasked parts will be overwritten by fields.
4524            // Write the fields.
4525            self.0.encode(encoder, offset + 0, depth)?;
4526            Ok(())
4527        }
4528    }
4529
4530    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4531        for BrowseControllerGetMediaPlayerItemsResponse
4532    {
4533        #[inline(always)]
4534        fn new_empty() -> Self {
4535            Self { items: fidl::new_empty!(fidl::encoding::Vector<MediaPlayerItem, 16>, D) }
4536        }
4537
4538        #[inline]
4539        unsafe fn decode(
4540            &mut self,
4541            decoder: &mut fidl::encoding::Decoder<'_, D>,
4542            offset: usize,
4543            _depth: fidl::encoding::Depth,
4544        ) -> fidl::Result<()> {
4545            decoder.debug_check_bounds::<Self>(offset);
4546            // Verify that padding bytes are zero.
4547            fidl::decode!(fidl::encoding::Vector<MediaPlayerItem, 16>, D, &mut self.items, decoder, offset + 0, _depth)?;
4548            Ok(())
4549        }
4550    }
4551
4552    impl fidl::encoding::ValueTypeMarker for BrowseControllerGetNowPlayingItemsResponse {
4553        type Borrowed<'a> = &'a Self;
4554        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4555            value
4556        }
4557    }
4558
4559    unsafe impl fidl::encoding::TypeMarker for BrowseControllerGetNowPlayingItemsResponse {
4560        type Owned = Self;
4561
4562        #[inline(always)]
4563        fn inline_align(_context: fidl::encoding::Context) -> usize {
4564            8
4565        }
4566
4567        #[inline(always)]
4568        fn inline_size(_context: fidl::encoding::Context) -> usize {
4569            16
4570        }
4571    }
4572
4573    unsafe impl<D: fidl::encoding::ResourceDialect>
4574        fidl::encoding::Encode<BrowseControllerGetNowPlayingItemsResponse, D>
4575        for &BrowseControllerGetNowPlayingItemsResponse
4576    {
4577        #[inline]
4578        unsafe fn encode(
4579            self,
4580            encoder: &mut fidl::encoding::Encoder<'_, D>,
4581            offset: usize,
4582            _depth: fidl::encoding::Depth,
4583        ) -> fidl::Result<()> {
4584            encoder.debug_check_bounds::<BrowseControllerGetNowPlayingItemsResponse>(offset);
4585            // Delegate to tuple encoding.
4586            fidl::encoding::Encode::<BrowseControllerGetNowPlayingItemsResponse, D>::encode(
4587                (
4588                    <fidl::encoding::Vector<MediaElementItem, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
4589                ),
4590                encoder, offset, _depth
4591            )
4592        }
4593    }
4594    unsafe impl<
4595            D: fidl::encoding::ResourceDialect,
4596            T0: fidl::encoding::Encode<fidl::encoding::Vector<MediaElementItem, 16>, D>,
4597        > fidl::encoding::Encode<BrowseControllerGetNowPlayingItemsResponse, D> for (T0,)
4598    {
4599        #[inline]
4600        unsafe fn encode(
4601            self,
4602            encoder: &mut fidl::encoding::Encoder<'_, D>,
4603            offset: usize,
4604            depth: fidl::encoding::Depth,
4605        ) -> fidl::Result<()> {
4606            encoder.debug_check_bounds::<BrowseControllerGetNowPlayingItemsResponse>(offset);
4607            // Zero out padding regions. There's no need to apply masks
4608            // because the unmasked parts will be overwritten by fields.
4609            // Write the fields.
4610            self.0.encode(encoder, offset + 0, depth)?;
4611            Ok(())
4612        }
4613    }
4614
4615    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4616        for BrowseControllerGetNowPlayingItemsResponse
4617    {
4618        #[inline(always)]
4619        fn new_empty() -> Self {
4620            Self { items: fidl::new_empty!(fidl::encoding::Vector<MediaElementItem, 16>, D) }
4621        }
4622
4623        #[inline]
4624        unsafe fn decode(
4625            &mut self,
4626            decoder: &mut fidl::encoding::Decoder<'_, D>,
4627            offset: usize,
4628            _depth: fidl::encoding::Depth,
4629        ) -> fidl::Result<()> {
4630            decoder.debug_check_bounds::<Self>(offset);
4631            // Verify that padding bytes are zero.
4632            fidl::decode!(fidl::encoding::Vector<MediaElementItem, 16>, D, &mut self.items, decoder, offset + 0, _depth)?;
4633            Ok(())
4634        }
4635    }
4636
4637    impl fidl::encoding::ValueTypeMarker for ControllerGetPlayerApplicationSettingsRequest {
4638        type Borrowed<'a> = &'a Self;
4639        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4640            value
4641        }
4642    }
4643
4644    unsafe impl fidl::encoding::TypeMarker for ControllerGetPlayerApplicationSettingsRequest {
4645        type Owned = Self;
4646
4647        #[inline(always)]
4648        fn inline_align(_context: fidl::encoding::Context) -> usize {
4649            8
4650        }
4651
4652        #[inline(always)]
4653        fn inline_size(_context: fidl::encoding::Context) -> usize {
4654            16
4655        }
4656    }
4657
4658    unsafe impl<D: fidl::encoding::ResourceDialect>
4659        fidl::encoding::Encode<ControllerGetPlayerApplicationSettingsRequest, D>
4660        for &ControllerGetPlayerApplicationSettingsRequest
4661    {
4662        #[inline]
4663        unsafe fn encode(
4664            self,
4665            encoder: &mut fidl::encoding::Encoder<'_, D>,
4666            offset: usize,
4667            _depth: fidl::encoding::Depth,
4668        ) -> fidl::Result<()> {
4669            encoder.debug_check_bounds::<ControllerGetPlayerApplicationSettingsRequest>(offset);
4670            // Delegate to tuple encoding.
4671            fidl::encoding::Encode::<ControllerGetPlayerApplicationSettingsRequest, D>::encode(
4672                (
4673                    <fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131> as fidl::encoding::ValueTypeMarker>::borrow(&self.attribute_ids),
4674                ),
4675                encoder, offset, _depth
4676            )
4677        }
4678    }
4679    unsafe impl<
4680            D: fidl::encoding::ResourceDialect,
4681            T0: fidl::encoding::Encode<
4682                fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>,
4683                D,
4684            >,
4685        > fidl::encoding::Encode<ControllerGetPlayerApplicationSettingsRequest, D> for (T0,)
4686    {
4687        #[inline]
4688        unsafe fn encode(
4689            self,
4690            encoder: &mut fidl::encoding::Encoder<'_, D>,
4691            offset: usize,
4692            depth: fidl::encoding::Depth,
4693        ) -> fidl::Result<()> {
4694            encoder.debug_check_bounds::<ControllerGetPlayerApplicationSettingsRequest>(offset);
4695            // Zero out padding regions. There's no need to apply masks
4696            // because the unmasked parts will be overwritten by fields.
4697            // Write the fields.
4698            self.0.encode(encoder, offset + 0, depth)?;
4699            Ok(())
4700        }
4701    }
4702
4703    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4704        for ControllerGetPlayerApplicationSettingsRequest
4705    {
4706        #[inline(always)]
4707        fn new_empty() -> Self {
4708            Self {
4709                attribute_ids: fidl::new_empty!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D),
4710            }
4711        }
4712
4713        #[inline]
4714        unsafe fn decode(
4715            &mut self,
4716            decoder: &mut fidl::encoding::Decoder<'_, D>,
4717            offset: usize,
4718            _depth: fidl::encoding::Depth,
4719        ) -> fidl::Result<()> {
4720            decoder.debug_check_bounds::<Self>(offset);
4721            // Verify that padding bytes are zero.
4722            fidl::decode!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D, &mut self.attribute_ids, decoder, offset + 0, _depth)?;
4723            Ok(())
4724        }
4725    }
4726
4727    impl fidl::encoding::ValueTypeMarker for ControllerInformBatteryStatusRequest {
4728        type Borrowed<'a> = &'a Self;
4729        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4730            value
4731        }
4732    }
4733
4734    unsafe impl fidl::encoding::TypeMarker for ControllerInformBatteryStatusRequest {
4735        type Owned = Self;
4736
4737        #[inline(always)]
4738        fn inline_align(_context: fidl::encoding::Context) -> usize {
4739            1
4740        }
4741
4742        #[inline(always)]
4743        fn inline_size(_context: fidl::encoding::Context) -> usize {
4744            1
4745        }
4746    }
4747
4748    unsafe impl<D: fidl::encoding::ResourceDialect>
4749        fidl::encoding::Encode<ControllerInformBatteryStatusRequest, D>
4750        for &ControllerInformBatteryStatusRequest
4751    {
4752        #[inline]
4753        unsafe fn encode(
4754            self,
4755            encoder: &mut fidl::encoding::Encoder<'_, D>,
4756            offset: usize,
4757            _depth: fidl::encoding::Depth,
4758        ) -> fidl::Result<()> {
4759            encoder.debug_check_bounds::<ControllerInformBatteryStatusRequest>(offset);
4760            // Delegate to tuple encoding.
4761            fidl::encoding::Encode::<ControllerInformBatteryStatusRequest, D>::encode(
4762                (<BatteryStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.battery_status),),
4763                encoder,
4764                offset,
4765                _depth,
4766            )
4767        }
4768    }
4769    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<BatteryStatus, D>>
4770        fidl::encoding::Encode<ControllerInformBatteryStatusRequest, D> for (T0,)
4771    {
4772        #[inline]
4773        unsafe fn encode(
4774            self,
4775            encoder: &mut fidl::encoding::Encoder<'_, D>,
4776            offset: usize,
4777            depth: fidl::encoding::Depth,
4778        ) -> fidl::Result<()> {
4779            encoder.debug_check_bounds::<ControllerInformBatteryStatusRequest>(offset);
4780            // Zero out padding regions. There's no need to apply masks
4781            // because the unmasked parts will be overwritten by fields.
4782            // Write the fields.
4783            self.0.encode(encoder, offset + 0, depth)?;
4784            Ok(())
4785        }
4786    }
4787
4788    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4789        for ControllerInformBatteryStatusRequest
4790    {
4791        #[inline(always)]
4792        fn new_empty() -> Self {
4793            Self { battery_status: fidl::new_empty!(BatteryStatus, D) }
4794        }
4795
4796        #[inline]
4797        unsafe fn decode(
4798            &mut self,
4799            decoder: &mut fidl::encoding::Decoder<'_, D>,
4800            offset: usize,
4801            _depth: fidl::encoding::Depth,
4802        ) -> fidl::Result<()> {
4803            decoder.debug_check_bounds::<Self>(offset);
4804            // Verify that padding bytes are zero.
4805            fidl::decode!(BatteryStatus, D, &mut self.battery_status, decoder, offset + 0, _depth)?;
4806            Ok(())
4807        }
4808    }
4809
4810    impl fidl::encoding::ValueTypeMarker for ControllerOnNotificationRequest {
4811        type Borrowed<'a> = &'a Self;
4812        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4813            value
4814        }
4815    }
4816
4817    unsafe impl fidl::encoding::TypeMarker for ControllerOnNotificationRequest {
4818        type Owned = Self;
4819
4820        #[inline(always)]
4821        fn inline_align(_context: fidl::encoding::Context) -> usize {
4822            8
4823        }
4824
4825        #[inline(always)]
4826        fn inline_size(_context: fidl::encoding::Context) -> usize {
4827            24
4828        }
4829    }
4830
4831    unsafe impl<D: fidl::encoding::ResourceDialect>
4832        fidl::encoding::Encode<ControllerOnNotificationRequest, D>
4833        for &ControllerOnNotificationRequest
4834    {
4835        #[inline]
4836        unsafe fn encode(
4837            self,
4838            encoder: &mut fidl::encoding::Encoder<'_, D>,
4839            offset: usize,
4840            _depth: fidl::encoding::Depth,
4841        ) -> fidl::Result<()> {
4842            encoder.debug_check_bounds::<ControllerOnNotificationRequest>(offset);
4843            // Delegate to tuple encoding.
4844            fidl::encoding::Encode::<ControllerOnNotificationRequest, D>::encode(
4845                (
4846                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp),
4847                    <Notification as fidl::encoding::ValueTypeMarker>::borrow(&self.notification),
4848                ),
4849                encoder,
4850                offset,
4851                _depth,
4852            )
4853        }
4854    }
4855    unsafe impl<
4856            D: fidl::encoding::ResourceDialect,
4857            T0: fidl::encoding::Encode<i64, D>,
4858            T1: fidl::encoding::Encode<Notification, D>,
4859        > fidl::encoding::Encode<ControllerOnNotificationRequest, D> for (T0, T1)
4860    {
4861        #[inline]
4862        unsafe fn encode(
4863            self,
4864            encoder: &mut fidl::encoding::Encoder<'_, D>,
4865            offset: usize,
4866            depth: fidl::encoding::Depth,
4867        ) -> fidl::Result<()> {
4868            encoder.debug_check_bounds::<ControllerOnNotificationRequest>(offset);
4869            // Zero out padding regions. There's no need to apply masks
4870            // because the unmasked parts will be overwritten by fields.
4871            // Write the fields.
4872            self.0.encode(encoder, offset + 0, depth)?;
4873            self.1.encode(encoder, offset + 8, depth)?;
4874            Ok(())
4875        }
4876    }
4877
4878    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4879        for ControllerOnNotificationRequest
4880    {
4881        #[inline(always)]
4882        fn new_empty() -> Self {
4883            Self {
4884                timestamp: fidl::new_empty!(i64, D),
4885                notification: fidl::new_empty!(Notification, D),
4886            }
4887        }
4888
4889        #[inline]
4890        unsafe fn decode(
4891            &mut self,
4892            decoder: &mut fidl::encoding::Decoder<'_, D>,
4893            offset: usize,
4894            _depth: fidl::encoding::Depth,
4895        ) -> fidl::Result<()> {
4896            decoder.debug_check_bounds::<Self>(offset);
4897            // Verify that padding bytes are zero.
4898            fidl::decode!(i64, D, &mut self.timestamp, decoder, offset + 0, _depth)?;
4899            fidl::decode!(Notification, D, &mut self.notification, decoder, offset + 8, _depth)?;
4900            Ok(())
4901        }
4902    }
4903
4904    impl fidl::encoding::ValueTypeMarker for ControllerSendCommandRequest {
4905        type Borrowed<'a> = &'a Self;
4906        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4907            value
4908        }
4909    }
4910
4911    unsafe impl fidl::encoding::TypeMarker for ControllerSendCommandRequest {
4912        type Owned = Self;
4913
4914        #[inline(always)]
4915        fn inline_align(_context: fidl::encoding::Context) -> usize {
4916            1
4917        }
4918
4919        #[inline(always)]
4920        fn inline_size(_context: fidl::encoding::Context) -> usize {
4921            1
4922        }
4923    }
4924
4925    unsafe impl<D: fidl::encoding::ResourceDialect>
4926        fidl::encoding::Encode<ControllerSendCommandRequest, D> for &ControllerSendCommandRequest
4927    {
4928        #[inline]
4929        unsafe fn encode(
4930            self,
4931            encoder: &mut fidl::encoding::Encoder<'_, D>,
4932            offset: usize,
4933            _depth: fidl::encoding::Depth,
4934        ) -> fidl::Result<()> {
4935            encoder.debug_check_bounds::<ControllerSendCommandRequest>(offset);
4936            // Delegate to tuple encoding.
4937            fidl::encoding::Encode::<ControllerSendCommandRequest, D>::encode(
4938                (<AvcPanelCommand as fidl::encoding::ValueTypeMarker>::borrow(&self.command),),
4939                encoder,
4940                offset,
4941                _depth,
4942            )
4943        }
4944    }
4945    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AvcPanelCommand, D>>
4946        fidl::encoding::Encode<ControllerSendCommandRequest, D> for (T0,)
4947    {
4948        #[inline]
4949        unsafe fn encode(
4950            self,
4951            encoder: &mut fidl::encoding::Encoder<'_, D>,
4952            offset: usize,
4953            depth: fidl::encoding::Depth,
4954        ) -> fidl::Result<()> {
4955            encoder.debug_check_bounds::<ControllerSendCommandRequest>(offset);
4956            // Zero out padding regions. There's no need to apply masks
4957            // because the unmasked parts will be overwritten by fields.
4958            // Write the fields.
4959            self.0.encode(encoder, offset + 0, depth)?;
4960            Ok(())
4961        }
4962    }
4963
4964    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4965        for ControllerSendCommandRequest
4966    {
4967        #[inline(always)]
4968        fn new_empty() -> Self {
4969            Self { command: fidl::new_empty!(AvcPanelCommand, D) }
4970        }
4971
4972        #[inline]
4973        unsafe fn decode(
4974            &mut self,
4975            decoder: &mut fidl::encoding::Decoder<'_, D>,
4976            offset: usize,
4977            _depth: fidl::encoding::Depth,
4978        ) -> fidl::Result<()> {
4979            decoder.debug_check_bounds::<Self>(offset);
4980            // Verify that padding bytes are zero.
4981            fidl::decode!(AvcPanelCommand, D, &mut self.command, decoder, offset + 0, _depth)?;
4982            Ok(())
4983        }
4984    }
4985
4986    impl fidl::encoding::ValueTypeMarker for ControllerSetAbsoluteVolumeRequest {
4987        type Borrowed<'a> = &'a Self;
4988        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4989            value
4990        }
4991    }
4992
4993    unsafe impl fidl::encoding::TypeMarker for ControllerSetAbsoluteVolumeRequest {
4994        type Owned = Self;
4995
4996        #[inline(always)]
4997        fn inline_align(_context: fidl::encoding::Context) -> usize {
4998            1
4999        }
5000
5001        #[inline(always)]
5002        fn inline_size(_context: fidl::encoding::Context) -> usize {
5003            1
5004        }
5005        #[inline(always)]
5006        fn encode_is_copy() -> bool {
5007            true
5008        }
5009
5010        #[inline(always)]
5011        fn decode_is_copy() -> bool {
5012            true
5013        }
5014    }
5015
5016    unsafe impl<D: fidl::encoding::ResourceDialect>
5017        fidl::encoding::Encode<ControllerSetAbsoluteVolumeRequest, D>
5018        for &ControllerSetAbsoluteVolumeRequest
5019    {
5020        #[inline]
5021        unsafe fn encode(
5022            self,
5023            encoder: &mut fidl::encoding::Encoder<'_, D>,
5024            offset: usize,
5025            _depth: fidl::encoding::Depth,
5026        ) -> fidl::Result<()> {
5027            encoder.debug_check_bounds::<ControllerSetAbsoluteVolumeRequest>(offset);
5028            unsafe {
5029                // Copy the object into the buffer.
5030                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5031                (buf_ptr as *mut ControllerSetAbsoluteVolumeRequest)
5032                    .write_unaligned((self as *const ControllerSetAbsoluteVolumeRequest).read());
5033                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5034                // done second because the memcpy will write garbage to these bytes.
5035            }
5036            Ok(())
5037        }
5038    }
5039    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
5040        fidl::encoding::Encode<ControllerSetAbsoluteVolumeRequest, D> for (T0,)
5041    {
5042        #[inline]
5043        unsafe fn encode(
5044            self,
5045            encoder: &mut fidl::encoding::Encoder<'_, D>,
5046            offset: usize,
5047            depth: fidl::encoding::Depth,
5048        ) -> fidl::Result<()> {
5049            encoder.debug_check_bounds::<ControllerSetAbsoluteVolumeRequest>(offset);
5050            // Zero out padding regions. There's no need to apply masks
5051            // because the unmasked parts will be overwritten by fields.
5052            // Write the fields.
5053            self.0.encode(encoder, offset + 0, depth)?;
5054            Ok(())
5055        }
5056    }
5057
5058    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5059        for ControllerSetAbsoluteVolumeRequest
5060    {
5061        #[inline(always)]
5062        fn new_empty() -> Self {
5063            Self { requested_volume: fidl::new_empty!(u8, D) }
5064        }
5065
5066        #[inline]
5067        unsafe fn decode(
5068            &mut self,
5069            decoder: &mut fidl::encoding::Decoder<'_, D>,
5070            offset: usize,
5071            _depth: fidl::encoding::Depth,
5072        ) -> fidl::Result<()> {
5073            decoder.debug_check_bounds::<Self>(offset);
5074            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5075            // Verify that padding bytes are zero.
5076            // Copy from the buffer into the object.
5077            unsafe {
5078                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
5079            }
5080            Ok(())
5081        }
5082    }
5083
5084    impl fidl::encoding::ValueTypeMarker for ControllerSetAddressedPlayerRequest {
5085        type Borrowed<'a> = &'a Self;
5086        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5087            value
5088        }
5089    }
5090
5091    unsafe impl fidl::encoding::TypeMarker for ControllerSetAddressedPlayerRequest {
5092        type Owned = Self;
5093
5094        #[inline(always)]
5095        fn inline_align(_context: fidl::encoding::Context) -> usize {
5096            2
5097        }
5098
5099        #[inline(always)]
5100        fn inline_size(_context: fidl::encoding::Context) -> usize {
5101            2
5102        }
5103        #[inline(always)]
5104        fn encode_is_copy() -> bool {
5105            true
5106        }
5107
5108        #[inline(always)]
5109        fn decode_is_copy() -> bool {
5110            true
5111        }
5112    }
5113
5114    unsafe impl<D: fidl::encoding::ResourceDialect>
5115        fidl::encoding::Encode<ControllerSetAddressedPlayerRequest, D>
5116        for &ControllerSetAddressedPlayerRequest
5117    {
5118        #[inline]
5119        unsafe fn encode(
5120            self,
5121            encoder: &mut fidl::encoding::Encoder<'_, D>,
5122            offset: usize,
5123            _depth: fidl::encoding::Depth,
5124        ) -> fidl::Result<()> {
5125            encoder.debug_check_bounds::<ControllerSetAddressedPlayerRequest>(offset);
5126            unsafe {
5127                // Copy the object into the buffer.
5128                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5129                (buf_ptr as *mut ControllerSetAddressedPlayerRequest)
5130                    .write_unaligned((self as *const ControllerSetAddressedPlayerRequest).read());
5131                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5132                // done second because the memcpy will write garbage to these bytes.
5133            }
5134            Ok(())
5135        }
5136    }
5137    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
5138        fidl::encoding::Encode<ControllerSetAddressedPlayerRequest, D> for (T0,)
5139    {
5140        #[inline]
5141        unsafe fn encode(
5142            self,
5143            encoder: &mut fidl::encoding::Encoder<'_, D>,
5144            offset: usize,
5145            depth: fidl::encoding::Depth,
5146        ) -> fidl::Result<()> {
5147            encoder.debug_check_bounds::<ControllerSetAddressedPlayerRequest>(offset);
5148            // Zero out padding regions. There's no need to apply masks
5149            // because the unmasked parts will be overwritten by fields.
5150            // Write the fields.
5151            self.0.encode(encoder, offset + 0, depth)?;
5152            Ok(())
5153        }
5154    }
5155
5156    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5157        for ControllerSetAddressedPlayerRequest
5158    {
5159        #[inline(always)]
5160        fn new_empty() -> Self {
5161            Self { player_id: fidl::new_empty!(u16, D) }
5162        }
5163
5164        #[inline]
5165        unsafe fn decode(
5166            &mut self,
5167            decoder: &mut fidl::encoding::Decoder<'_, D>,
5168            offset: usize,
5169            _depth: fidl::encoding::Depth,
5170        ) -> fidl::Result<()> {
5171            decoder.debug_check_bounds::<Self>(offset);
5172            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5173            // Verify that padding bytes are zero.
5174            // Copy from the buffer into the object.
5175            unsafe {
5176                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
5177            }
5178            Ok(())
5179        }
5180    }
5181
5182    impl fidl::encoding::ValueTypeMarker for ControllerSetNotificationFilterRequest {
5183        type Borrowed<'a> = &'a Self;
5184        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5185            value
5186        }
5187    }
5188
5189    unsafe impl fidl::encoding::TypeMarker for ControllerSetNotificationFilterRequest {
5190        type Owned = Self;
5191
5192        #[inline(always)]
5193        fn inline_align(_context: fidl::encoding::Context) -> usize {
5194            4
5195        }
5196
5197        #[inline(always)]
5198        fn inline_size(_context: fidl::encoding::Context) -> usize {
5199            8
5200        }
5201    }
5202
5203    unsafe impl<D: fidl::encoding::ResourceDialect>
5204        fidl::encoding::Encode<ControllerSetNotificationFilterRequest, D>
5205        for &ControllerSetNotificationFilterRequest
5206    {
5207        #[inline]
5208        unsafe fn encode(
5209            self,
5210            encoder: &mut fidl::encoding::Encoder<'_, D>,
5211            offset: usize,
5212            _depth: fidl::encoding::Depth,
5213        ) -> fidl::Result<()> {
5214            encoder.debug_check_bounds::<ControllerSetNotificationFilterRequest>(offset);
5215            // Delegate to tuple encoding.
5216            fidl::encoding::Encode::<ControllerSetNotificationFilterRequest, D>::encode(
5217                (
5218                    <Notifications as fidl::encoding::ValueTypeMarker>::borrow(&self.notifications),
5219                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(
5220                        &self.position_change_interval,
5221                    ),
5222                ),
5223                encoder,
5224                offset,
5225                _depth,
5226            )
5227        }
5228    }
5229    unsafe impl<
5230            D: fidl::encoding::ResourceDialect,
5231            T0: fidl::encoding::Encode<Notifications, D>,
5232            T1: fidl::encoding::Encode<u32, D>,
5233        > fidl::encoding::Encode<ControllerSetNotificationFilterRequest, D> for (T0, T1)
5234    {
5235        #[inline]
5236        unsafe fn encode(
5237            self,
5238            encoder: &mut fidl::encoding::Encoder<'_, D>,
5239            offset: usize,
5240            depth: fidl::encoding::Depth,
5241        ) -> fidl::Result<()> {
5242            encoder.debug_check_bounds::<ControllerSetNotificationFilterRequest>(offset);
5243            // Zero out padding regions. There's no need to apply masks
5244            // because the unmasked parts will be overwritten by fields.
5245            // Write the fields.
5246            self.0.encode(encoder, offset + 0, depth)?;
5247            self.1.encode(encoder, offset + 4, depth)?;
5248            Ok(())
5249        }
5250    }
5251
5252    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5253        for ControllerSetNotificationFilterRequest
5254    {
5255        #[inline(always)]
5256        fn new_empty() -> Self {
5257            Self {
5258                notifications: fidl::new_empty!(Notifications, D),
5259                position_change_interval: fidl::new_empty!(u32, D),
5260            }
5261        }
5262
5263        #[inline]
5264        unsafe fn decode(
5265            &mut self,
5266            decoder: &mut fidl::encoding::Decoder<'_, D>,
5267            offset: usize,
5268            _depth: fidl::encoding::Depth,
5269        ) -> fidl::Result<()> {
5270            decoder.debug_check_bounds::<Self>(offset);
5271            // Verify that padding bytes are zero.
5272            fidl::decode!(Notifications, D, &mut self.notifications, decoder, offset + 0, _depth)?;
5273            fidl::decode!(u32, D, &mut self.position_change_interval, decoder, offset + 4, _depth)?;
5274            Ok(())
5275        }
5276    }
5277
5278    impl fidl::encoding::ValueTypeMarker for ControllerSetPlayerApplicationSettingsRequest {
5279        type Borrowed<'a> = &'a Self;
5280        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5281            value
5282        }
5283    }
5284
5285    unsafe impl fidl::encoding::TypeMarker for ControllerSetPlayerApplicationSettingsRequest {
5286        type Owned = Self;
5287
5288        #[inline(always)]
5289        fn inline_align(_context: fidl::encoding::Context) -> usize {
5290            8
5291        }
5292
5293        #[inline(always)]
5294        fn inline_size(_context: fidl::encoding::Context) -> usize {
5295            16
5296        }
5297    }
5298
5299    unsafe impl<D: fidl::encoding::ResourceDialect>
5300        fidl::encoding::Encode<ControllerSetPlayerApplicationSettingsRequest, D>
5301        for &ControllerSetPlayerApplicationSettingsRequest
5302    {
5303        #[inline]
5304        unsafe fn encode(
5305            self,
5306            encoder: &mut fidl::encoding::Encoder<'_, D>,
5307            offset: usize,
5308            _depth: fidl::encoding::Depth,
5309        ) -> fidl::Result<()> {
5310            encoder.debug_check_bounds::<ControllerSetPlayerApplicationSettingsRequest>(offset);
5311            // Delegate to tuple encoding.
5312            fidl::encoding::Encode::<ControllerSetPlayerApplicationSettingsRequest, D>::encode(
5313                (<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
5314                    &self.requested_settings,
5315                ),),
5316                encoder,
5317                offset,
5318                _depth,
5319            )
5320        }
5321    }
5322    unsafe impl<
5323            D: fidl::encoding::ResourceDialect,
5324            T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
5325        > fidl::encoding::Encode<ControllerSetPlayerApplicationSettingsRequest, D> for (T0,)
5326    {
5327        #[inline]
5328        unsafe fn encode(
5329            self,
5330            encoder: &mut fidl::encoding::Encoder<'_, D>,
5331            offset: usize,
5332            depth: fidl::encoding::Depth,
5333        ) -> fidl::Result<()> {
5334            encoder.debug_check_bounds::<ControllerSetPlayerApplicationSettingsRequest>(offset);
5335            // Zero out padding regions. There's no need to apply masks
5336            // because the unmasked parts will be overwritten by fields.
5337            // Write the fields.
5338            self.0.encode(encoder, offset + 0, depth)?;
5339            Ok(())
5340        }
5341    }
5342
5343    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5344        for ControllerSetPlayerApplicationSettingsRequest
5345    {
5346        #[inline(always)]
5347        fn new_empty() -> Self {
5348            Self { requested_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
5349        }
5350
5351        #[inline]
5352        unsafe fn decode(
5353            &mut self,
5354            decoder: &mut fidl::encoding::Decoder<'_, D>,
5355            offset: usize,
5356            _depth: fidl::encoding::Depth,
5357        ) -> fidl::Result<()> {
5358            decoder.debug_check_bounds::<Self>(offset);
5359            // Verify that padding bytes are zero.
5360            fidl::decode!(
5361                PlayerApplicationSettings,
5362                D,
5363                &mut self.requested_settings,
5364                decoder,
5365                offset + 0,
5366                _depth
5367            )?;
5368            Ok(())
5369        }
5370    }
5371
5372    impl fidl::encoding::ValueTypeMarker for ControllerGetMediaAttributesResponse {
5373        type Borrowed<'a> = &'a Self;
5374        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5375            value
5376        }
5377    }
5378
5379    unsafe impl fidl::encoding::TypeMarker for ControllerGetMediaAttributesResponse {
5380        type Owned = Self;
5381
5382        #[inline(always)]
5383        fn inline_align(_context: fidl::encoding::Context) -> usize {
5384            8
5385        }
5386
5387        #[inline(always)]
5388        fn inline_size(_context: fidl::encoding::Context) -> usize {
5389            16
5390        }
5391    }
5392
5393    unsafe impl<D: fidl::encoding::ResourceDialect>
5394        fidl::encoding::Encode<ControllerGetMediaAttributesResponse, D>
5395        for &ControllerGetMediaAttributesResponse
5396    {
5397        #[inline]
5398        unsafe fn encode(
5399            self,
5400            encoder: &mut fidl::encoding::Encoder<'_, D>,
5401            offset: usize,
5402            _depth: fidl::encoding::Depth,
5403        ) -> fidl::Result<()> {
5404            encoder.debug_check_bounds::<ControllerGetMediaAttributesResponse>(offset);
5405            // Delegate to tuple encoding.
5406            fidl::encoding::Encode::<ControllerGetMediaAttributesResponse, D>::encode(
5407                (<MediaAttributes as fidl::encoding::ValueTypeMarker>::borrow(&self.attributes),),
5408                encoder,
5409                offset,
5410                _depth,
5411            )
5412        }
5413    }
5414    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<MediaAttributes, D>>
5415        fidl::encoding::Encode<ControllerGetMediaAttributesResponse, D> for (T0,)
5416    {
5417        #[inline]
5418        unsafe fn encode(
5419            self,
5420            encoder: &mut fidl::encoding::Encoder<'_, D>,
5421            offset: usize,
5422            depth: fidl::encoding::Depth,
5423        ) -> fidl::Result<()> {
5424            encoder.debug_check_bounds::<ControllerGetMediaAttributesResponse>(offset);
5425            // Zero out padding regions. There's no need to apply masks
5426            // because the unmasked parts will be overwritten by fields.
5427            // Write the fields.
5428            self.0.encode(encoder, offset + 0, depth)?;
5429            Ok(())
5430        }
5431    }
5432
5433    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5434        for ControllerGetMediaAttributesResponse
5435    {
5436        #[inline(always)]
5437        fn new_empty() -> Self {
5438            Self { attributes: fidl::new_empty!(MediaAttributes, D) }
5439        }
5440
5441        #[inline]
5442        unsafe fn decode(
5443            &mut self,
5444            decoder: &mut fidl::encoding::Decoder<'_, D>,
5445            offset: usize,
5446            _depth: fidl::encoding::Depth,
5447        ) -> fidl::Result<()> {
5448            decoder.debug_check_bounds::<Self>(offset);
5449            // Verify that padding bytes are zero.
5450            fidl::decode!(MediaAttributes, D, &mut self.attributes, decoder, offset + 0, _depth)?;
5451            Ok(())
5452        }
5453    }
5454
5455    impl fidl::encoding::ValueTypeMarker for ControllerGetPlayStatusResponse {
5456        type Borrowed<'a> = &'a Self;
5457        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5458            value
5459        }
5460    }
5461
5462    unsafe impl fidl::encoding::TypeMarker for ControllerGetPlayStatusResponse {
5463        type Owned = Self;
5464
5465        #[inline(always)]
5466        fn inline_align(_context: fidl::encoding::Context) -> usize {
5467            8
5468        }
5469
5470        #[inline(always)]
5471        fn inline_size(_context: fidl::encoding::Context) -> usize {
5472            16
5473        }
5474    }
5475
5476    unsafe impl<D: fidl::encoding::ResourceDialect>
5477        fidl::encoding::Encode<ControllerGetPlayStatusResponse, D>
5478        for &ControllerGetPlayStatusResponse
5479    {
5480        #[inline]
5481        unsafe fn encode(
5482            self,
5483            encoder: &mut fidl::encoding::Encoder<'_, D>,
5484            offset: usize,
5485            _depth: fidl::encoding::Depth,
5486        ) -> fidl::Result<()> {
5487            encoder.debug_check_bounds::<ControllerGetPlayStatusResponse>(offset);
5488            // Delegate to tuple encoding.
5489            fidl::encoding::Encode::<ControllerGetPlayStatusResponse, D>::encode(
5490                (<PlayStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.play_status),),
5491                encoder,
5492                offset,
5493                _depth,
5494            )
5495        }
5496    }
5497    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PlayStatus, D>>
5498        fidl::encoding::Encode<ControllerGetPlayStatusResponse, D> for (T0,)
5499    {
5500        #[inline]
5501        unsafe fn encode(
5502            self,
5503            encoder: &mut fidl::encoding::Encoder<'_, D>,
5504            offset: usize,
5505            depth: fidl::encoding::Depth,
5506        ) -> fidl::Result<()> {
5507            encoder.debug_check_bounds::<ControllerGetPlayStatusResponse>(offset);
5508            // Zero out padding regions. There's no need to apply masks
5509            // because the unmasked parts will be overwritten by fields.
5510            // Write the fields.
5511            self.0.encode(encoder, offset + 0, depth)?;
5512            Ok(())
5513        }
5514    }
5515
5516    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5517        for ControllerGetPlayStatusResponse
5518    {
5519        #[inline(always)]
5520        fn new_empty() -> Self {
5521            Self { play_status: fidl::new_empty!(PlayStatus, D) }
5522        }
5523
5524        #[inline]
5525        unsafe fn decode(
5526            &mut self,
5527            decoder: &mut fidl::encoding::Decoder<'_, D>,
5528            offset: usize,
5529            _depth: fidl::encoding::Depth,
5530        ) -> fidl::Result<()> {
5531            decoder.debug_check_bounds::<Self>(offset);
5532            // Verify that padding bytes are zero.
5533            fidl::decode!(PlayStatus, D, &mut self.play_status, decoder, offset + 0, _depth)?;
5534            Ok(())
5535        }
5536    }
5537
5538    impl fidl::encoding::ValueTypeMarker for ControllerGetPlayerApplicationSettingsResponse {
5539        type Borrowed<'a> = &'a Self;
5540        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5541            value
5542        }
5543    }
5544
5545    unsafe impl fidl::encoding::TypeMarker for ControllerGetPlayerApplicationSettingsResponse {
5546        type Owned = Self;
5547
5548        #[inline(always)]
5549        fn inline_align(_context: fidl::encoding::Context) -> usize {
5550            8
5551        }
5552
5553        #[inline(always)]
5554        fn inline_size(_context: fidl::encoding::Context) -> usize {
5555            16
5556        }
5557    }
5558
5559    unsafe impl<D: fidl::encoding::ResourceDialect>
5560        fidl::encoding::Encode<ControllerGetPlayerApplicationSettingsResponse, D>
5561        for &ControllerGetPlayerApplicationSettingsResponse
5562    {
5563        #[inline]
5564        unsafe fn encode(
5565            self,
5566            encoder: &mut fidl::encoding::Encoder<'_, D>,
5567            offset: usize,
5568            _depth: fidl::encoding::Depth,
5569        ) -> fidl::Result<()> {
5570            encoder.debug_check_bounds::<ControllerGetPlayerApplicationSettingsResponse>(offset);
5571            // Delegate to tuple encoding.
5572            fidl::encoding::Encode::<ControllerGetPlayerApplicationSettingsResponse, D>::encode(
5573                (<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
5574                    &self.current_settings,
5575                ),),
5576                encoder,
5577                offset,
5578                _depth,
5579            )
5580        }
5581    }
5582    unsafe impl<
5583            D: fidl::encoding::ResourceDialect,
5584            T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
5585        > fidl::encoding::Encode<ControllerGetPlayerApplicationSettingsResponse, D> for (T0,)
5586    {
5587        #[inline]
5588        unsafe fn encode(
5589            self,
5590            encoder: &mut fidl::encoding::Encoder<'_, D>,
5591            offset: usize,
5592            depth: fidl::encoding::Depth,
5593        ) -> fidl::Result<()> {
5594            encoder.debug_check_bounds::<ControllerGetPlayerApplicationSettingsResponse>(offset);
5595            // Zero out padding regions. There's no need to apply masks
5596            // because the unmasked parts will be overwritten by fields.
5597            // Write the fields.
5598            self.0.encode(encoder, offset + 0, depth)?;
5599            Ok(())
5600        }
5601    }
5602
5603    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5604        for ControllerGetPlayerApplicationSettingsResponse
5605    {
5606        #[inline(always)]
5607        fn new_empty() -> Self {
5608            Self { current_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
5609        }
5610
5611        #[inline]
5612        unsafe fn decode(
5613            &mut self,
5614            decoder: &mut fidl::encoding::Decoder<'_, D>,
5615            offset: usize,
5616            _depth: fidl::encoding::Depth,
5617        ) -> fidl::Result<()> {
5618            decoder.debug_check_bounds::<Self>(offset);
5619            // Verify that padding bytes are zero.
5620            fidl::decode!(
5621                PlayerApplicationSettings,
5622                D,
5623                &mut self.current_settings,
5624                decoder,
5625                offset + 0,
5626                _depth
5627            )?;
5628            Ok(())
5629        }
5630    }
5631
5632    impl fidl::encoding::ValueTypeMarker for ControllerSetAbsoluteVolumeResponse {
5633        type Borrowed<'a> = &'a Self;
5634        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5635            value
5636        }
5637    }
5638
5639    unsafe impl fidl::encoding::TypeMarker for ControllerSetAbsoluteVolumeResponse {
5640        type Owned = Self;
5641
5642        #[inline(always)]
5643        fn inline_align(_context: fidl::encoding::Context) -> usize {
5644            1
5645        }
5646
5647        #[inline(always)]
5648        fn inline_size(_context: fidl::encoding::Context) -> usize {
5649            1
5650        }
5651        #[inline(always)]
5652        fn encode_is_copy() -> bool {
5653            true
5654        }
5655
5656        #[inline(always)]
5657        fn decode_is_copy() -> bool {
5658            true
5659        }
5660    }
5661
5662    unsafe impl<D: fidl::encoding::ResourceDialect>
5663        fidl::encoding::Encode<ControllerSetAbsoluteVolumeResponse, D>
5664        for &ControllerSetAbsoluteVolumeResponse
5665    {
5666        #[inline]
5667        unsafe fn encode(
5668            self,
5669            encoder: &mut fidl::encoding::Encoder<'_, D>,
5670            offset: usize,
5671            _depth: fidl::encoding::Depth,
5672        ) -> fidl::Result<()> {
5673            encoder.debug_check_bounds::<ControllerSetAbsoluteVolumeResponse>(offset);
5674            unsafe {
5675                // Copy the object into the buffer.
5676                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5677                (buf_ptr as *mut ControllerSetAbsoluteVolumeResponse)
5678                    .write_unaligned((self as *const ControllerSetAbsoluteVolumeResponse).read());
5679                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5680                // done second because the memcpy will write garbage to these bytes.
5681            }
5682            Ok(())
5683        }
5684    }
5685    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
5686        fidl::encoding::Encode<ControllerSetAbsoluteVolumeResponse, D> for (T0,)
5687    {
5688        #[inline]
5689        unsafe fn encode(
5690            self,
5691            encoder: &mut fidl::encoding::Encoder<'_, D>,
5692            offset: usize,
5693            depth: fidl::encoding::Depth,
5694        ) -> fidl::Result<()> {
5695            encoder.debug_check_bounds::<ControllerSetAbsoluteVolumeResponse>(offset);
5696            // Zero out padding regions. There's no need to apply masks
5697            // because the unmasked parts will be overwritten by fields.
5698            // Write the fields.
5699            self.0.encode(encoder, offset + 0, depth)?;
5700            Ok(())
5701        }
5702    }
5703
5704    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5705        for ControllerSetAbsoluteVolumeResponse
5706    {
5707        #[inline(always)]
5708        fn new_empty() -> Self {
5709            Self { set_volume: fidl::new_empty!(u8, D) }
5710        }
5711
5712        #[inline]
5713        unsafe fn decode(
5714            &mut self,
5715            decoder: &mut fidl::encoding::Decoder<'_, D>,
5716            offset: usize,
5717            _depth: fidl::encoding::Depth,
5718        ) -> fidl::Result<()> {
5719            decoder.debug_check_bounds::<Self>(offset);
5720            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5721            // Verify that padding bytes are zero.
5722            // Copy from the buffer into the object.
5723            unsafe {
5724                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
5725            }
5726            Ok(())
5727        }
5728    }
5729
5730    impl fidl::encoding::ValueTypeMarker for ControllerSetPlayerApplicationSettingsResponse {
5731        type Borrowed<'a> = &'a Self;
5732        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5733            value
5734        }
5735    }
5736
5737    unsafe impl fidl::encoding::TypeMarker for ControllerSetPlayerApplicationSettingsResponse {
5738        type Owned = Self;
5739
5740        #[inline(always)]
5741        fn inline_align(_context: fidl::encoding::Context) -> usize {
5742            8
5743        }
5744
5745        #[inline(always)]
5746        fn inline_size(_context: fidl::encoding::Context) -> usize {
5747            16
5748        }
5749    }
5750
5751    unsafe impl<D: fidl::encoding::ResourceDialect>
5752        fidl::encoding::Encode<ControllerSetPlayerApplicationSettingsResponse, D>
5753        for &ControllerSetPlayerApplicationSettingsResponse
5754    {
5755        #[inline]
5756        unsafe fn encode(
5757            self,
5758            encoder: &mut fidl::encoding::Encoder<'_, D>,
5759            offset: usize,
5760            _depth: fidl::encoding::Depth,
5761        ) -> fidl::Result<()> {
5762            encoder.debug_check_bounds::<ControllerSetPlayerApplicationSettingsResponse>(offset);
5763            // Delegate to tuple encoding.
5764            fidl::encoding::Encode::<ControllerSetPlayerApplicationSettingsResponse, D>::encode(
5765                (<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
5766                    &self.set_settings,
5767                ),),
5768                encoder,
5769                offset,
5770                _depth,
5771            )
5772        }
5773    }
5774    unsafe impl<
5775            D: fidl::encoding::ResourceDialect,
5776            T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
5777        > fidl::encoding::Encode<ControllerSetPlayerApplicationSettingsResponse, D> for (T0,)
5778    {
5779        #[inline]
5780        unsafe fn encode(
5781            self,
5782            encoder: &mut fidl::encoding::Encoder<'_, D>,
5783            offset: usize,
5784            depth: fidl::encoding::Depth,
5785        ) -> fidl::Result<()> {
5786            encoder.debug_check_bounds::<ControllerSetPlayerApplicationSettingsResponse>(offset);
5787            // Zero out padding regions. There's no need to apply masks
5788            // because the unmasked parts will be overwritten by fields.
5789            // Write the fields.
5790            self.0.encode(encoder, offset + 0, depth)?;
5791            Ok(())
5792        }
5793    }
5794
5795    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5796        for ControllerSetPlayerApplicationSettingsResponse
5797    {
5798        #[inline(always)]
5799        fn new_empty() -> Self {
5800            Self { set_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
5801        }
5802
5803        #[inline]
5804        unsafe fn decode(
5805            &mut self,
5806            decoder: &mut fidl::encoding::Decoder<'_, D>,
5807            offset: usize,
5808            _depth: fidl::encoding::Depth,
5809        ) -> fidl::Result<()> {
5810            decoder.debug_check_bounds::<Self>(offset);
5811            // Verify that padding bytes are zero.
5812            fidl::decode!(
5813                PlayerApplicationSettings,
5814                D,
5815                &mut self.set_settings,
5816                decoder,
5817                offset + 0,
5818                _depth
5819            )?;
5820            Ok(())
5821        }
5822    }
5823
5824    impl fidl::encoding::ValueTypeMarker for CustomAttributeValue {
5825        type Borrowed<'a> = &'a Self;
5826        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5827            value
5828        }
5829    }
5830
5831    unsafe impl fidl::encoding::TypeMarker for CustomAttributeValue {
5832        type Owned = Self;
5833
5834        #[inline(always)]
5835        fn inline_align(_context: fidl::encoding::Context) -> usize {
5836            8
5837        }
5838
5839        #[inline(always)]
5840        fn inline_size(_context: fidl::encoding::Context) -> usize {
5841            24
5842        }
5843    }
5844
5845    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CustomAttributeValue, D>
5846        for &CustomAttributeValue
5847    {
5848        #[inline]
5849        unsafe fn encode(
5850            self,
5851            encoder: &mut fidl::encoding::Encoder<'_, D>,
5852            offset: usize,
5853            _depth: fidl::encoding::Depth,
5854        ) -> fidl::Result<()> {
5855            encoder.debug_check_bounds::<CustomAttributeValue>(offset);
5856            // Delegate to tuple encoding.
5857            fidl::encoding::Encode::<CustomAttributeValue, D>::encode(
5858                (
5859                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
5860                        &self.description,
5861                    ),
5862                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
5863                ),
5864                encoder,
5865                offset,
5866                _depth,
5867            )
5868        }
5869    }
5870    unsafe impl<
5871            D: fidl::encoding::ResourceDialect,
5872            T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
5873            T1: fidl::encoding::Encode<u8, D>,
5874        > fidl::encoding::Encode<CustomAttributeValue, D> for (T0, T1)
5875    {
5876        #[inline]
5877        unsafe fn encode(
5878            self,
5879            encoder: &mut fidl::encoding::Encoder<'_, D>,
5880            offset: usize,
5881            depth: fidl::encoding::Depth,
5882        ) -> fidl::Result<()> {
5883            encoder.debug_check_bounds::<CustomAttributeValue>(offset);
5884            // Zero out padding regions. There's no need to apply masks
5885            // because the unmasked parts will be overwritten by fields.
5886            unsafe {
5887                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
5888                (ptr as *mut u64).write_unaligned(0);
5889            }
5890            // Write the fields.
5891            self.0.encode(encoder, offset + 0, depth)?;
5892            self.1.encode(encoder, offset + 16, depth)?;
5893            Ok(())
5894        }
5895    }
5896
5897    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CustomAttributeValue {
5898        #[inline(always)]
5899        fn new_empty() -> Self {
5900            Self {
5901                description: fidl::new_empty!(fidl::encoding::BoundedString<255>, D),
5902                value: fidl::new_empty!(u8, D),
5903            }
5904        }
5905
5906        #[inline]
5907        unsafe fn decode(
5908            &mut self,
5909            decoder: &mut fidl::encoding::Decoder<'_, D>,
5910            offset: usize,
5911            _depth: fidl::encoding::Depth,
5912        ) -> fidl::Result<()> {
5913            decoder.debug_check_bounds::<Self>(offset);
5914            // Verify that padding bytes are zero.
5915            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
5916            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5917            let mask = 0xffffffffffffff00u64;
5918            let maskedval = padval & mask;
5919            if maskedval != 0 {
5920                return Err(fidl::Error::NonZeroPadding {
5921                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
5922                });
5923            }
5924            fidl::decode!(
5925                fidl::encoding::BoundedString<255>,
5926                D,
5927                &mut self.description,
5928                decoder,
5929                offset + 0,
5930                _depth
5931            )?;
5932            fidl::decode!(u8, D, &mut self.value, decoder, offset + 16, _depth)?;
5933            Ok(())
5934        }
5935    }
5936
5937    impl fidl::encoding::ValueTypeMarker for Parent {
5938        type Borrowed<'a> = &'a Self;
5939        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5940            value
5941        }
5942    }
5943
5944    unsafe impl fidl::encoding::TypeMarker for Parent {
5945        type Owned = Self;
5946
5947        #[inline(always)]
5948        fn inline_align(_context: fidl::encoding::Context) -> usize {
5949            1
5950        }
5951
5952        #[inline(always)]
5953        fn inline_size(_context: fidl::encoding::Context) -> usize {
5954            1
5955        }
5956    }
5957
5958    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Parent, D> for &Parent {
5959        #[inline]
5960        unsafe fn encode(
5961            self,
5962            encoder: &mut fidl::encoding::Encoder<'_, D>,
5963            offset: usize,
5964            _depth: fidl::encoding::Depth,
5965        ) -> fidl::Result<()> {
5966            encoder.debug_check_bounds::<Parent>(offset);
5967            encoder.write_num(0u8, offset);
5968            Ok(())
5969        }
5970    }
5971
5972    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Parent {
5973        #[inline(always)]
5974        fn new_empty() -> Self {
5975            Self
5976        }
5977
5978        #[inline]
5979        unsafe fn decode(
5980            &mut self,
5981            decoder: &mut fidl::encoding::Decoder<'_, D>,
5982            offset: usize,
5983            _depth: fidl::encoding::Depth,
5984        ) -> fidl::Result<()> {
5985            decoder.debug_check_bounds::<Self>(offset);
5986            match decoder.read_num::<u8>(offset) {
5987                0 => Ok(()),
5988                _ => Err(fidl::Error::Invalid),
5989            }
5990        }
5991    }
5992
5993    impl fidl::encoding::ValueTypeMarker for TargetHandlerGetNotificationRequest {
5994        type Borrowed<'a> = &'a Self;
5995        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5996            value
5997        }
5998    }
5999
6000    unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetNotificationRequest {
6001        type Owned = Self;
6002
6003        #[inline(always)]
6004        fn inline_align(_context: fidl::encoding::Context) -> usize {
6005            1
6006        }
6007
6008        #[inline(always)]
6009        fn inline_size(_context: fidl::encoding::Context) -> usize {
6010            1
6011        }
6012    }
6013
6014    unsafe impl<D: fidl::encoding::ResourceDialect>
6015        fidl::encoding::Encode<TargetHandlerGetNotificationRequest, D>
6016        for &TargetHandlerGetNotificationRequest
6017    {
6018        #[inline]
6019        unsafe fn encode(
6020            self,
6021            encoder: &mut fidl::encoding::Encoder<'_, D>,
6022            offset: usize,
6023            _depth: fidl::encoding::Depth,
6024        ) -> fidl::Result<()> {
6025            encoder.debug_check_bounds::<TargetHandlerGetNotificationRequest>(offset);
6026            // Delegate to tuple encoding.
6027            fidl::encoding::Encode::<TargetHandlerGetNotificationRequest, D>::encode(
6028                (<NotificationEvent as fidl::encoding::ValueTypeMarker>::borrow(&self.event_id),),
6029                encoder,
6030                offset,
6031                _depth,
6032            )
6033        }
6034    }
6035    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<NotificationEvent, D>>
6036        fidl::encoding::Encode<TargetHandlerGetNotificationRequest, D> for (T0,)
6037    {
6038        #[inline]
6039        unsafe fn encode(
6040            self,
6041            encoder: &mut fidl::encoding::Encoder<'_, D>,
6042            offset: usize,
6043            depth: fidl::encoding::Depth,
6044        ) -> fidl::Result<()> {
6045            encoder.debug_check_bounds::<TargetHandlerGetNotificationRequest>(offset);
6046            // Zero out padding regions. There's no need to apply masks
6047            // because the unmasked parts will be overwritten by fields.
6048            // Write the fields.
6049            self.0.encode(encoder, offset + 0, depth)?;
6050            Ok(())
6051        }
6052    }
6053
6054    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6055        for TargetHandlerGetNotificationRequest
6056    {
6057        #[inline(always)]
6058        fn new_empty() -> Self {
6059            Self { event_id: fidl::new_empty!(NotificationEvent, D) }
6060        }
6061
6062        #[inline]
6063        unsafe fn decode(
6064            &mut self,
6065            decoder: &mut fidl::encoding::Decoder<'_, D>,
6066            offset: usize,
6067            _depth: fidl::encoding::Depth,
6068        ) -> fidl::Result<()> {
6069            decoder.debug_check_bounds::<Self>(offset);
6070            // Verify that padding bytes are zero.
6071            fidl::decode!(NotificationEvent, D, &mut self.event_id, decoder, offset + 0, _depth)?;
6072            Ok(())
6073        }
6074    }
6075
6076    impl fidl::encoding::ValueTypeMarker for TargetHandlerGetPlayerApplicationSettingsRequest {
6077        type Borrowed<'a> = &'a Self;
6078        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6079            value
6080        }
6081    }
6082
6083    unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetPlayerApplicationSettingsRequest {
6084        type Owned = Self;
6085
6086        #[inline(always)]
6087        fn inline_align(_context: fidl::encoding::Context) -> usize {
6088            8
6089        }
6090
6091        #[inline(always)]
6092        fn inline_size(_context: fidl::encoding::Context) -> usize {
6093            16
6094        }
6095    }
6096
6097    unsafe impl<D: fidl::encoding::ResourceDialect>
6098        fidl::encoding::Encode<TargetHandlerGetPlayerApplicationSettingsRequest, D>
6099        for &TargetHandlerGetPlayerApplicationSettingsRequest
6100    {
6101        #[inline]
6102        unsafe fn encode(
6103            self,
6104            encoder: &mut fidl::encoding::Encoder<'_, D>,
6105            offset: usize,
6106            _depth: fidl::encoding::Depth,
6107        ) -> fidl::Result<()> {
6108            encoder.debug_check_bounds::<TargetHandlerGetPlayerApplicationSettingsRequest>(offset);
6109            // Delegate to tuple encoding.
6110            fidl::encoding::Encode::<TargetHandlerGetPlayerApplicationSettingsRequest, D>::encode(
6111                (
6112                    <fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131> as fidl::encoding::ValueTypeMarker>::borrow(&self.attribute_ids),
6113                ),
6114                encoder, offset, _depth
6115            )
6116        }
6117    }
6118    unsafe impl<
6119            D: fidl::encoding::ResourceDialect,
6120            T0: fidl::encoding::Encode<
6121                fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>,
6122                D,
6123            >,
6124        > fidl::encoding::Encode<TargetHandlerGetPlayerApplicationSettingsRequest, D> for (T0,)
6125    {
6126        #[inline]
6127        unsafe fn encode(
6128            self,
6129            encoder: &mut fidl::encoding::Encoder<'_, D>,
6130            offset: usize,
6131            depth: fidl::encoding::Depth,
6132        ) -> fidl::Result<()> {
6133            encoder.debug_check_bounds::<TargetHandlerGetPlayerApplicationSettingsRequest>(offset);
6134            // Zero out padding regions. There's no need to apply masks
6135            // because the unmasked parts will be overwritten by fields.
6136            // Write the fields.
6137            self.0.encode(encoder, offset + 0, depth)?;
6138            Ok(())
6139        }
6140    }
6141
6142    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6143        for TargetHandlerGetPlayerApplicationSettingsRequest
6144    {
6145        #[inline(always)]
6146        fn new_empty() -> Self {
6147            Self {
6148                attribute_ids: fidl::new_empty!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D),
6149            }
6150        }
6151
6152        #[inline]
6153        unsafe fn decode(
6154            &mut self,
6155            decoder: &mut fidl::encoding::Decoder<'_, D>,
6156            offset: usize,
6157            _depth: fidl::encoding::Depth,
6158        ) -> fidl::Result<()> {
6159            decoder.debug_check_bounds::<Self>(offset);
6160            // Verify that padding bytes are zero.
6161            fidl::decode!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D, &mut self.attribute_ids, decoder, offset + 0, _depth)?;
6162            Ok(())
6163        }
6164    }
6165
6166    impl fidl::encoding::ValueTypeMarker for TargetHandlerSendCommandRequest {
6167        type Borrowed<'a> = &'a Self;
6168        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6169            value
6170        }
6171    }
6172
6173    unsafe impl fidl::encoding::TypeMarker for TargetHandlerSendCommandRequest {
6174        type Owned = Self;
6175
6176        #[inline(always)]
6177        fn inline_align(_context: fidl::encoding::Context) -> usize {
6178            1
6179        }
6180
6181        #[inline(always)]
6182        fn inline_size(_context: fidl::encoding::Context) -> usize {
6183            2
6184        }
6185    }
6186
6187    unsafe impl<D: fidl::encoding::ResourceDialect>
6188        fidl::encoding::Encode<TargetHandlerSendCommandRequest, D>
6189        for &TargetHandlerSendCommandRequest
6190    {
6191        #[inline]
6192        unsafe fn encode(
6193            self,
6194            encoder: &mut fidl::encoding::Encoder<'_, D>,
6195            offset: usize,
6196            _depth: fidl::encoding::Depth,
6197        ) -> fidl::Result<()> {
6198            encoder.debug_check_bounds::<TargetHandlerSendCommandRequest>(offset);
6199            // Delegate to tuple encoding.
6200            fidl::encoding::Encode::<TargetHandlerSendCommandRequest, D>::encode(
6201                (
6202                    <AvcPanelCommand as fidl::encoding::ValueTypeMarker>::borrow(&self.command),
6203                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.pressed),
6204                ),
6205                encoder,
6206                offset,
6207                _depth,
6208            )
6209        }
6210    }
6211    unsafe impl<
6212            D: fidl::encoding::ResourceDialect,
6213            T0: fidl::encoding::Encode<AvcPanelCommand, D>,
6214            T1: fidl::encoding::Encode<bool, D>,
6215        > fidl::encoding::Encode<TargetHandlerSendCommandRequest, D> for (T0, T1)
6216    {
6217        #[inline]
6218        unsafe fn encode(
6219            self,
6220            encoder: &mut fidl::encoding::Encoder<'_, D>,
6221            offset: usize,
6222            depth: fidl::encoding::Depth,
6223        ) -> fidl::Result<()> {
6224            encoder.debug_check_bounds::<TargetHandlerSendCommandRequest>(offset);
6225            // Zero out padding regions. There's no need to apply masks
6226            // because the unmasked parts will be overwritten by fields.
6227            // Write the fields.
6228            self.0.encode(encoder, offset + 0, depth)?;
6229            self.1.encode(encoder, offset + 1, depth)?;
6230            Ok(())
6231        }
6232    }
6233
6234    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6235        for TargetHandlerSendCommandRequest
6236    {
6237        #[inline(always)]
6238        fn new_empty() -> Self {
6239            Self {
6240                command: fidl::new_empty!(AvcPanelCommand, D),
6241                pressed: fidl::new_empty!(bool, D),
6242            }
6243        }
6244
6245        #[inline]
6246        unsafe fn decode(
6247            &mut self,
6248            decoder: &mut fidl::encoding::Decoder<'_, D>,
6249            offset: usize,
6250            _depth: fidl::encoding::Depth,
6251        ) -> fidl::Result<()> {
6252            decoder.debug_check_bounds::<Self>(offset);
6253            // Verify that padding bytes are zero.
6254            fidl::decode!(AvcPanelCommand, D, &mut self.command, decoder, offset + 0, _depth)?;
6255            fidl::decode!(bool, D, &mut self.pressed, decoder, offset + 1, _depth)?;
6256            Ok(())
6257        }
6258    }
6259
6260    impl fidl::encoding::ValueTypeMarker for TargetHandlerSetAddressedPlayerRequest {
6261        type Borrowed<'a> = &'a Self;
6262        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6263            value
6264        }
6265    }
6266
6267    unsafe impl fidl::encoding::TypeMarker for TargetHandlerSetAddressedPlayerRequest {
6268        type Owned = Self;
6269
6270        #[inline(always)]
6271        fn inline_align(_context: fidl::encoding::Context) -> usize {
6272            2
6273        }
6274
6275        #[inline(always)]
6276        fn inline_size(_context: fidl::encoding::Context) -> usize {
6277            2
6278        }
6279        #[inline(always)]
6280        fn encode_is_copy() -> bool {
6281            true
6282        }
6283
6284        #[inline(always)]
6285        fn decode_is_copy() -> bool {
6286            true
6287        }
6288    }
6289
6290    unsafe impl<D: fidl::encoding::ResourceDialect>
6291        fidl::encoding::Encode<TargetHandlerSetAddressedPlayerRequest, D>
6292        for &TargetHandlerSetAddressedPlayerRequest
6293    {
6294        #[inline]
6295        unsafe fn encode(
6296            self,
6297            encoder: &mut fidl::encoding::Encoder<'_, D>,
6298            offset: usize,
6299            _depth: fidl::encoding::Depth,
6300        ) -> fidl::Result<()> {
6301            encoder.debug_check_bounds::<TargetHandlerSetAddressedPlayerRequest>(offset);
6302            unsafe {
6303                // Copy the object into the buffer.
6304                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6305                (buf_ptr as *mut TargetHandlerSetAddressedPlayerRequest).write_unaligned(
6306                    (self as *const TargetHandlerSetAddressedPlayerRequest).read(),
6307                );
6308                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6309                // done second because the memcpy will write garbage to these bytes.
6310            }
6311            Ok(())
6312        }
6313    }
6314    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AddressedPlayerId, D>>
6315        fidl::encoding::Encode<TargetHandlerSetAddressedPlayerRequest, D> for (T0,)
6316    {
6317        #[inline]
6318        unsafe fn encode(
6319            self,
6320            encoder: &mut fidl::encoding::Encoder<'_, D>,
6321            offset: usize,
6322            depth: fidl::encoding::Depth,
6323        ) -> fidl::Result<()> {
6324            encoder.debug_check_bounds::<TargetHandlerSetAddressedPlayerRequest>(offset);
6325            // Zero out padding regions. There's no need to apply masks
6326            // because the unmasked parts will be overwritten by fields.
6327            // Write the fields.
6328            self.0.encode(encoder, offset + 0, depth)?;
6329            Ok(())
6330        }
6331    }
6332
6333    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6334        for TargetHandlerSetAddressedPlayerRequest
6335    {
6336        #[inline(always)]
6337        fn new_empty() -> Self {
6338            Self { player_id: fidl::new_empty!(AddressedPlayerId, D) }
6339        }
6340
6341        #[inline]
6342        unsafe fn decode(
6343            &mut self,
6344            decoder: &mut fidl::encoding::Decoder<'_, D>,
6345            offset: usize,
6346            _depth: fidl::encoding::Depth,
6347        ) -> fidl::Result<()> {
6348            decoder.debug_check_bounds::<Self>(offset);
6349            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6350            // Verify that padding bytes are zero.
6351            // Copy from the buffer into the object.
6352            unsafe {
6353                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
6354            }
6355            Ok(())
6356        }
6357    }
6358
6359    impl fidl::encoding::ValueTypeMarker for TargetHandlerSetPlayerApplicationSettingsRequest {
6360        type Borrowed<'a> = &'a Self;
6361        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6362            value
6363        }
6364    }
6365
6366    unsafe impl fidl::encoding::TypeMarker for TargetHandlerSetPlayerApplicationSettingsRequest {
6367        type Owned = Self;
6368
6369        #[inline(always)]
6370        fn inline_align(_context: fidl::encoding::Context) -> usize {
6371            8
6372        }
6373
6374        #[inline(always)]
6375        fn inline_size(_context: fidl::encoding::Context) -> usize {
6376            16
6377        }
6378    }
6379
6380    unsafe impl<D: fidl::encoding::ResourceDialect>
6381        fidl::encoding::Encode<TargetHandlerSetPlayerApplicationSettingsRequest, D>
6382        for &TargetHandlerSetPlayerApplicationSettingsRequest
6383    {
6384        #[inline]
6385        unsafe fn encode(
6386            self,
6387            encoder: &mut fidl::encoding::Encoder<'_, D>,
6388            offset: usize,
6389            _depth: fidl::encoding::Depth,
6390        ) -> fidl::Result<()> {
6391            encoder.debug_check_bounds::<TargetHandlerSetPlayerApplicationSettingsRequest>(offset);
6392            // Delegate to tuple encoding.
6393            fidl::encoding::Encode::<TargetHandlerSetPlayerApplicationSettingsRequest, D>::encode(
6394                (<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
6395                    &self.requested_settings,
6396                ),),
6397                encoder,
6398                offset,
6399                _depth,
6400            )
6401        }
6402    }
6403    unsafe impl<
6404            D: fidl::encoding::ResourceDialect,
6405            T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
6406        > fidl::encoding::Encode<TargetHandlerSetPlayerApplicationSettingsRequest, D> for (T0,)
6407    {
6408        #[inline]
6409        unsafe fn encode(
6410            self,
6411            encoder: &mut fidl::encoding::Encoder<'_, D>,
6412            offset: usize,
6413            depth: fidl::encoding::Depth,
6414        ) -> fidl::Result<()> {
6415            encoder.debug_check_bounds::<TargetHandlerSetPlayerApplicationSettingsRequest>(offset);
6416            // Zero out padding regions. There's no need to apply masks
6417            // because the unmasked parts will be overwritten by fields.
6418            // Write the fields.
6419            self.0.encode(encoder, offset + 0, depth)?;
6420            Ok(())
6421        }
6422    }
6423
6424    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6425        for TargetHandlerSetPlayerApplicationSettingsRequest
6426    {
6427        #[inline(always)]
6428        fn new_empty() -> Self {
6429            Self { requested_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
6430        }
6431
6432        #[inline]
6433        unsafe fn decode(
6434            &mut self,
6435            decoder: &mut fidl::encoding::Decoder<'_, D>,
6436            offset: usize,
6437            _depth: fidl::encoding::Depth,
6438        ) -> fidl::Result<()> {
6439            decoder.debug_check_bounds::<Self>(offset);
6440            // Verify that padding bytes are zero.
6441            fidl::decode!(
6442                PlayerApplicationSettings,
6443                D,
6444                &mut self.requested_settings,
6445                decoder,
6446                offset + 0,
6447                _depth
6448            )?;
6449            Ok(())
6450        }
6451    }
6452
6453    impl fidl::encoding::ValueTypeMarker for TargetHandlerWatchNotificationRequest {
6454        type Borrowed<'a> = &'a Self;
6455        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6456            value
6457        }
6458    }
6459
6460    unsafe impl fidl::encoding::TypeMarker for TargetHandlerWatchNotificationRequest {
6461        type Owned = Self;
6462
6463        #[inline(always)]
6464        fn inline_align(_context: fidl::encoding::Context) -> usize {
6465            8
6466        }
6467
6468        #[inline(always)]
6469        fn inline_size(_context: fidl::encoding::Context) -> usize {
6470            32
6471        }
6472    }
6473
6474    unsafe impl<D: fidl::encoding::ResourceDialect>
6475        fidl::encoding::Encode<TargetHandlerWatchNotificationRequest, D>
6476        for &TargetHandlerWatchNotificationRequest
6477    {
6478        #[inline]
6479        unsafe fn encode(
6480            self,
6481            encoder: &mut fidl::encoding::Encoder<'_, D>,
6482            offset: usize,
6483            _depth: fidl::encoding::Depth,
6484        ) -> fidl::Result<()> {
6485            encoder.debug_check_bounds::<TargetHandlerWatchNotificationRequest>(offset);
6486            // Delegate to tuple encoding.
6487            fidl::encoding::Encode::<TargetHandlerWatchNotificationRequest, D>::encode(
6488                (
6489                    <NotificationEvent as fidl::encoding::ValueTypeMarker>::borrow(&self.event_id),
6490                    <Notification as fidl::encoding::ValueTypeMarker>::borrow(&self.current),
6491                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.pos_change_interval),
6492                ),
6493                encoder,
6494                offset,
6495                _depth,
6496            )
6497        }
6498    }
6499    unsafe impl<
6500            D: fidl::encoding::ResourceDialect,
6501            T0: fidl::encoding::Encode<NotificationEvent, D>,
6502            T1: fidl::encoding::Encode<Notification, D>,
6503            T2: fidl::encoding::Encode<u32, D>,
6504        > fidl::encoding::Encode<TargetHandlerWatchNotificationRequest, D> for (T0, T1, T2)
6505    {
6506        #[inline]
6507        unsafe fn encode(
6508            self,
6509            encoder: &mut fidl::encoding::Encoder<'_, D>,
6510            offset: usize,
6511            depth: fidl::encoding::Depth,
6512        ) -> fidl::Result<()> {
6513            encoder.debug_check_bounds::<TargetHandlerWatchNotificationRequest>(offset);
6514            // Zero out padding regions. There's no need to apply masks
6515            // because the unmasked parts will be overwritten by fields.
6516            unsafe {
6517                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
6518                (ptr as *mut u64).write_unaligned(0);
6519            }
6520            unsafe {
6521                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
6522                (ptr as *mut u64).write_unaligned(0);
6523            }
6524            // Write the fields.
6525            self.0.encode(encoder, offset + 0, depth)?;
6526            self.1.encode(encoder, offset + 8, depth)?;
6527            self.2.encode(encoder, offset + 24, depth)?;
6528            Ok(())
6529        }
6530    }
6531
6532    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6533        for TargetHandlerWatchNotificationRequest
6534    {
6535        #[inline(always)]
6536        fn new_empty() -> Self {
6537            Self {
6538                event_id: fidl::new_empty!(NotificationEvent, D),
6539                current: fidl::new_empty!(Notification, D),
6540                pos_change_interval: fidl::new_empty!(u32, D),
6541            }
6542        }
6543
6544        #[inline]
6545        unsafe fn decode(
6546            &mut self,
6547            decoder: &mut fidl::encoding::Decoder<'_, D>,
6548            offset: usize,
6549            _depth: fidl::encoding::Depth,
6550        ) -> fidl::Result<()> {
6551            decoder.debug_check_bounds::<Self>(offset);
6552            // Verify that padding bytes are zero.
6553            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
6554            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6555            let mask = 0xffffffffffffff00u64;
6556            let maskedval = padval & mask;
6557            if maskedval != 0 {
6558                return Err(fidl::Error::NonZeroPadding {
6559                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
6560                });
6561            }
6562            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
6563            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6564            let mask = 0xffffffff00000000u64;
6565            let maskedval = padval & mask;
6566            if maskedval != 0 {
6567                return Err(fidl::Error::NonZeroPadding {
6568                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
6569                });
6570            }
6571            fidl::decode!(NotificationEvent, D, &mut self.event_id, decoder, offset + 0, _depth)?;
6572            fidl::decode!(Notification, D, &mut self.current, decoder, offset + 8, _depth)?;
6573            fidl::decode!(u32, D, &mut self.pos_change_interval, decoder, offset + 24, _depth)?;
6574            Ok(())
6575        }
6576    }
6577
6578    impl fidl::encoding::ValueTypeMarker for TargetHandlerGetEventsSupportedResponse {
6579        type Borrowed<'a> = &'a Self;
6580        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6581            value
6582        }
6583    }
6584
6585    unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetEventsSupportedResponse {
6586        type Owned = Self;
6587
6588        #[inline(always)]
6589        fn inline_align(_context: fidl::encoding::Context) -> usize {
6590            8
6591        }
6592
6593        #[inline(always)]
6594        fn inline_size(_context: fidl::encoding::Context) -> usize {
6595            16
6596        }
6597    }
6598
6599    unsafe impl<D: fidl::encoding::ResourceDialect>
6600        fidl::encoding::Encode<TargetHandlerGetEventsSupportedResponse, D>
6601        for &TargetHandlerGetEventsSupportedResponse
6602    {
6603        #[inline]
6604        unsafe fn encode(
6605            self,
6606            encoder: &mut fidl::encoding::Encoder<'_, D>,
6607            offset: usize,
6608            _depth: fidl::encoding::Depth,
6609        ) -> fidl::Result<()> {
6610            encoder.debug_check_bounds::<TargetHandlerGetEventsSupportedResponse>(offset);
6611            // Delegate to tuple encoding.
6612            fidl::encoding::Encode::<TargetHandlerGetEventsSupportedResponse, D>::encode(
6613                (
6614                    <fidl::encoding::Vector<NotificationEvent, 255> as fidl::encoding::ValueTypeMarker>::borrow(&self.notification_ids),
6615                ),
6616                encoder, offset, _depth
6617            )
6618        }
6619    }
6620    unsafe impl<
6621            D: fidl::encoding::ResourceDialect,
6622            T0: fidl::encoding::Encode<fidl::encoding::Vector<NotificationEvent, 255>, D>,
6623        > fidl::encoding::Encode<TargetHandlerGetEventsSupportedResponse, D> for (T0,)
6624    {
6625        #[inline]
6626        unsafe fn encode(
6627            self,
6628            encoder: &mut fidl::encoding::Encoder<'_, D>,
6629            offset: usize,
6630            depth: fidl::encoding::Depth,
6631        ) -> fidl::Result<()> {
6632            encoder.debug_check_bounds::<TargetHandlerGetEventsSupportedResponse>(offset);
6633            // Zero out padding regions. There's no need to apply masks
6634            // because the unmasked parts will be overwritten by fields.
6635            // Write the fields.
6636            self.0.encode(encoder, offset + 0, depth)?;
6637            Ok(())
6638        }
6639    }
6640
6641    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6642        for TargetHandlerGetEventsSupportedResponse
6643    {
6644        #[inline(always)]
6645        fn new_empty() -> Self {
6646            Self {
6647                notification_ids: fidl::new_empty!(fidl::encoding::Vector<NotificationEvent, 255>, D),
6648            }
6649        }
6650
6651        #[inline]
6652        unsafe fn decode(
6653            &mut self,
6654            decoder: &mut fidl::encoding::Decoder<'_, D>,
6655            offset: usize,
6656            _depth: fidl::encoding::Depth,
6657        ) -> fidl::Result<()> {
6658            decoder.debug_check_bounds::<Self>(offset);
6659            // Verify that padding bytes are zero.
6660            fidl::decode!(fidl::encoding::Vector<NotificationEvent, 255>, D, &mut self.notification_ids, decoder, offset + 0, _depth)?;
6661            Ok(())
6662        }
6663    }
6664
6665    impl fidl::encoding::ValueTypeMarker for TargetHandlerGetMediaAttributesResponse {
6666        type Borrowed<'a> = &'a Self;
6667        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6668            value
6669        }
6670    }
6671
6672    unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetMediaAttributesResponse {
6673        type Owned = Self;
6674
6675        #[inline(always)]
6676        fn inline_align(_context: fidl::encoding::Context) -> usize {
6677            8
6678        }
6679
6680        #[inline(always)]
6681        fn inline_size(_context: fidl::encoding::Context) -> usize {
6682            16
6683        }
6684    }
6685
6686    unsafe impl<D: fidl::encoding::ResourceDialect>
6687        fidl::encoding::Encode<TargetHandlerGetMediaAttributesResponse, D>
6688        for &TargetHandlerGetMediaAttributesResponse
6689    {
6690        #[inline]
6691        unsafe fn encode(
6692            self,
6693            encoder: &mut fidl::encoding::Encoder<'_, D>,
6694            offset: usize,
6695            _depth: fidl::encoding::Depth,
6696        ) -> fidl::Result<()> {
6697            encoder.debug_check_bounds::<TargetHandlerGetMediaAttributesResponse>(offset);
6698            // Delegate to tuple encoding.
6699            fidl::encoding::Encode::<TargetHandlerGetMediaAttributesResponse, D>::encode(
6700                (<MediaAttributes as fidl::encoding::ValueTypeMarker>::borrow(&self.attributes),),
6701                encoder,
6702                offset,
6703                _depth,
6704            )
6705        }
6706    }
6707    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<MediaAttributes, D>>
6708        fidl::encoding::Encode<TargetHandlerGetMediaAttributesResponse, D> for (T0,)
6709    {
6710        #[inline]
6711        unsafe fn encode(
6712            self,
6713            encoder: &mut fidl::encoding::Encoder<'_, D>,
6714            offset: usize,
6715            depth: fidl::encoding::Depth,
6716        ) -> fidl::Result<()> {
6717            encoder.debug_check_bounds::<TargetHandlerGetMediaAttributesResponse>(offset);
6718            // Zero out padding regions. There's no need to apply masks
6719            // because the unmasked parts will be overwritten by fields.
6720            // Write the fields.
6721            self.0.encode(encoder, offset + 0, depth)?;
6722            Ok(())
6723        }
6724    }
6725
6726    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6727        for TargetHandlerGetMediaAttributesResponse
6728    {
6729        #[inline(always)]
6730        fn new_empty() -> Self {
6731            Self { attributes: fidl::new_empty!(MediaAttributes, D) }
6732        }
6733
6734        #[inline]
6735        unsafe fn decode(
6736            &mut self,
6737            decoder: &mut fidl::encoding::Decoder<'_, D>,
6738            offset: usize,
6739            _depth: fidl::encoding::Depth,
6740        ) -> fidl::Result<()> {
6741            decoder.debug_check_bounds::<Self>(offset);
6742            // Verify that padding bytes are zero.
6743            fidl::decode!(MediaAttributes, D, &mut self.attributes, decoder, offset + 0, _depth)?;
6744            Ok(())
6745        }
6746    }
6747
6748    impl fidl::encoding::ValueTypeMarker for TargetHandlerGetMediaPlayerItemsResponse {
6749        type Borrowed<'a> = &'a Self;
6750        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6751            value
6752        }
6753    }
6754
6755    unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetMediaPlayerItemsResponse {
6756        type Owned = Self;
6757
6758        #[inline(always)]
6759        fn inline_align(_context: fidl::encoding::Context) -> usize {
6760            8
6761        }
6762
6763        #[inline(always)]
6764        fn inline_size(_context: fidl::encoding::Context) -> usize {
6765            16
6766        }
6767    }
6768
6769    unsafe impl<D: fidl::encoding::ResourceDialect>
6770        fidl::encoding::Encode<TargetHandlerGetMediaPlayerItemsResponse, D>
6771        for &TargetHandlerGetMediaPlayerItemsResponse
6772    {
6773        #[inline]
6774        unsafe fn encode(
6775            self,
6776            encoder: &mut fidl::encoding::Encoder<'_, D>,
6777            offset: usize,
6778            _depth: fidl::encoding::Depth,
6779        ) -> fidl::Result<()> {
6780            encoder.debug_check_bounds::<TargetHandlerGetMediaPlayerItemsResponse>(offset);
6781            // Delegate to tuple encoding.
6782            fidl::encoding::Encode::<TargetHandlerGetMediaPlayerItemsResponse, D>::encode(
6783                (
6784                    <fidl::encoding::Vector<MediaPlayerItem, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
6785                ),
6786                encoder, offset, _depth
6787            )
6788        }
6789    }
6790    unsafe impl<
6791            D: fidl::encoding::ResourceDialect,
6792            T0: fidl::encoding::Encode<fidl::encoding::Vector<MediaPlayerItem, 16>, D>,
6793        > fidl::encoding::Encode<TargetHandlerGetMediaPlayerItemsResponse, D> for (T0,)
6794    {
6795        #[inline]
6796        unsafe fn encode(
6797            self,
6798            encoder: &mut fidl::encoding::Encoder<'_, D>,
6799            offset: usize,
6800            depth: fidl::encoding::Depth,
6801        ) -> fidl::Result<()> {
6802            encoder.debug_check_bounds::<TargetHandlerGetMediaPlayerItemsResponse>(offset);
6803            // Zero out padding regions. There's no need to apply masks
6804            // because the unmasked parts will be overwritten by fields.
6805            // Write the fields.
6806            self.0.encode(encoder, offset + 0, depth)?;
6807            Ok(())
6808        }
6809    }
6810
6811    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6812        for TargetHandlerGetMediaPlayerItemsResponse
6813    {
6814        #[inline(always)]
6815        fn new_empty() -> Self {
6816            Self { items: fidl::new_empty!(fidl::encoding::Vector<MediaPlayerItem, 16>, D) }
6817        }
6818
6819        #[inline]
6820        unsafe fn decode(
6821            &mut self,
6822            decoder: &mut fidl::encoding::Decoder<'_, D>,
6823            offset: usize,
6824            _depth: fidl::encoding::Depth,
6825        ) -> fidl::Result<()> {
6826            decoder.debug_check_bounds::<Self>(offset);
6827            // Verify that padding bytes are zero.
6828            fidl::decode!(fidl::encoding::Vector<MediaPlayerItem, 16>, D, &mut self.items, decoder, offset + 0, _depth)?;
6829            Ok(())
6830        }
6831    }
6832
6833    impl fidl::encoding::ValueTypeMarker for TargetHandlerGetNotificationResponse {
6834        type Borrowed<'a> = &'a Self;
6835        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6836            value
6837        }
6838    }
6839
6840    unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetNotificationResponse {
6841        type Owned = Self;
6842
6843        #[inline(always)]
6844        fn inline_align(_context: fidl::encoding::Context) -> usize {
6845            8
6846        }
6847
6848        #[inline(always)]
6849        fn inline_size(_context: fidl::encoding::Context) -> usize {
6850            16
6851        }
6852    }
6853
6854    unsafe impl<D: fidl::encoding::ResourceDialect>
6855        fidl::encoding::Encode<TargetHandlerGetNotificationResponse, D>
6856        for &TargetHandlerGetNotificationResponse
6857    {
6858        #[inline]
6859        unsafe fn encode(
6860            self,
6861            encoder: &mut fidl::encoding::Encoder<'_, D>,
6862            offset: usize,
6863            _depth: fidl::encoding::Depth,
6864        ) -> fidl::Result<()> {
6865            encoder.debug_check_bounds::<TargetHandlerGetNotificationResponse>(offset);
6866            // Delegate to tuple encoding.
6867            fidl::encoding::Encode::<TargetHandlerGetNotificationResponse, D>::encode(
6868                (<Notification as fidl::encoding::ValueTypeMarker>::borrow(&self.current_value),),
6869                encoder,
6870                offset,
6871                _depth,
6872            )
6873        }
6874    }
6875    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Notification, D>>
6876        fidl::encoding::Encode<TargetHandlerGetNotificationResponse, D> for (T0,)
6877    {
6878        #[inline]
6879        unsafe fn encode(
6880            self,
6881            encoder: &mut fidl::encoding::Encoder<'_, D>,
6882            offset: usize,
6883            depth: fidl::encoding::Depth,
6884        ) -> fidl::Result<()> {
6885            encoder.debug_check_bounds::<TargetHandlerGetNotificationResponse>(offset);
6886            // Zero out padding regions. There's no need to apply masks
6887            // because the unmasked parts will be overwritten by fields.
6888            // Write the fields.
6889            self.0.encode(encoder, offset + 0, depth)?;
6890            Ok(())
6891        }
6892    }
6893
6894    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6895        for TargetHandlerGetNotificationResponse
6896    {
6897        #[inline(always)]
6898        fn new_empty() -> Self {
6899            Self { current_value: fidl::new_empty!(Notification, D) }
6900        }
6901
6902        #[inline]
6903        unsafe fn decode(
6904            &mut self,
6905            decoder: &mut fidl::encoding::Decoder<'_, D>,
6906            offset: usize,
6907            _depth: fidl::encoding::Depth,
6908        ) -> fidl::Result<()> {
6909            decoder.debug_check_bounds::<Self>(offset);
6910            // Verify that padding bytes are zero.
6911            fidl::decode!(Notification, D, &mut self.current_value, decoder, offset + 0, _depth)?;
6912            Ok(())
6913        }
6914    }
6915
6916    impl fidl::encoding::ValueTypeMarker for TargetHandlerGetPlayStatusResponse {
6917        type Borrowed<'a> = &'a Self;
6918        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6919            value
6920        }
6921    }
6922
6923    unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetPlayStatusResponse {
6924        type Owned = Self;
6925
6926        #[inline(always)]
6927        fn inline_align(_context: fidl::encoding::Context) -> usize {
6928            8
6929        }
6930
6931        #[inline(always)]
6932        fn inline_size(_context: fidl::encoding::Context) -> usize {
6933            16
6934        }
6935    }
6936
6937    unsafe impl<D: fidl::encoding::ResourceDialect>
6938        fidl::encoding::Encode<TargetHandlerGetPlayStatusResponse, D>
6939        for &TargetHandlerGetPlayStatusResponse
6940    {
6941        #[inline]
6942        unsafe fn encode(
6943            self,
6944            encoder: &mut fidl::encoding::Encoder<'_, D>,
6945            offset: usize,
6946            _depth: fidl::encoding::Depth,
6947        ) -> fidl::Result<()> {
6948            encoder.debug_check_bounds::<TargetHandlerGetPlayStatusResponse>(offset);
6949            // Delegate to tuple encoding.
6950            fidl::encoding::Encode::<TargetHandlerGetPlayStatusResponse, D>::encode(
6951                (<PlayStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.play_status),),
6952                encoder,
6953                offset,
6954                _depth,
6955            )
6956        }
6957    }
6958    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PlayStatus, D>>
6959        fidl::encoding::Encode<TargetHandlerGetPlayStatusResponse, D> for (T0,)
6960    {
6961        #[inline]
6962        unsafe fn encode(
6963            self,
6964            encoder: &mut fidl::encoding::Encoder<'_, D>,
6965            offset: usize,
6966            depth: fidl::encoding::Depth,
6967        ) -> fidl::Result<()> {
6968            encoder.debug_check_bounds::<TargetHandlerGetPlayStatusResponse>(offset);
6969            // Zero out padding regions. There's no need to apply masks
6970            // because the unmasked parts will be overwritten by fields.
6971            // Write the fields.
6972            self.0.encode(encoder, offset + 0, depth)?;
6973            Ok(())
6974        }
6975    }
6976
6977    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6978        for TargetHandlerGetPlayStatusResponse
6979    {
6980        #[inline(always)]
6981        fn new_empty() -> Self {
6982            Self { play_status: fidl::new_empty!(PlayStatus, D) }
6983        }
6984
6985        #[inline]
6986        unsafe fn decode(
6987            &mut self,
6988            decoder: &mut fidl::encoding::Decoder<'_, D>,
6989            offset: usize,
6990            _depth: fidl::encoding::Depth,
6991        ) -> fidl::Result<()> {
6992            decoder.debug_check_bounds::<Self>(offset);
6993            // Verify that padding bytes are zero.
6994            fidl::decode!(PlayStatus, D, &mut self.play_status, decoder, offset + 0, _depth)?;
6995            Ok(())
6996        }
6997    }
6998
6999    impl fidl::encoding::ValueTypeMarker for TargetHandlerGetPlayerApplicationSettingsResponse {
7000        type Borrowed<'a> = &'a Self;
7001        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7002            value
7003        }
7004    }
7005
7006    unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetPlayerApplicationSettingsResponse {
7007        type Owned = Self;
7008
7009        #[inline(always)]
7010        fn inline_align(_context: fidl::encoding::Context) -> usize {
7011            8
7012        }
7013
7014        #[inline(always)]
7015        fn inline_size(_context: fidl::encoding::Context) -> usize {
7016            16
7017        }
7018    }
7019
7020    unsafe impl<D: fidl::encoding::ResourceDialect>
7021        fidl::encoding::Encode<TargetHandlerGetPlayerApplicationSettingsResponse, D>
7022        for &TargetHandlerGetPlayerApplicationSettingsResponse
7023    {
7024        #[inline]
7025        unsafe fn encode(
7026            self,
7027            encoder: &mut fidl::encoding::Encoder<'_, D>,
7028            offset: usize,
7029            _depth: fidl::encoding::Depth,
7030        ) -> fidl::Result<()> {
7031            encoder.debug_check_bounds::<TargetHandlerGetPlayerApplicationSettingsResponse>(offset);
7032            // Delegate to tuple encoding.
7033            fidl::encoding::Encode::<TargetHandlerGetPlayerApplicationSettingsResponse, D>::encode(
7034                (<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
7035                    &self.current_settings,
7036                ),),
7037                encoder,
7038                offset,
7039                _depth,
7040            )
7041        }
7042    }
7043    unsafe impl<
7044            D: fidl::encoding::ResourceDialect,
7045            T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
7046        > fidl::encoding::Encode<TargetHandlerGetPlayerApplicationSettingsResponse, D> for (T0,)
7047    {
7048        #[inline]
7049        unsafe fn encode(
7050            self,
7051            encoder: &mut fidl::encoding::Encoder<'_, D>,
7052            offset: usize,
7053            depth: fidl::encoding::Depth,
7054        ) -> fidl::Result<()> {
7055            encoder.debug_check_bounds::<TargetHandlerGetPlayerApplicationSettingsResponse>(offset);
7056            // Zero out padding regions. There's no need to apply masks
7057            // because the unmasked parts will be overwritten by fields.
7058            // Write the fields.
7059            self.0.encode(encoder, offset + 0, depth)?;
7060            Ok(())
7061        }
7062    }
7063
7064    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7065        for TargetHandlerGetPlayerApplicationSettingsResponse
7066    {
7067        #[inline(always)]
7068        fn new_empty() -> Self {
7069            Self { current_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
7070        }
7071
7072        #[inline]
7073        unsafe fn decode(
7074            &mut self,
7075            decoder: &mut fidl::encoding::Decoder<'_, D>,
7076            offset: usize,
7077            _depth: fidl::encoding::Depth,
7078        ) -> fidl::Result<()> {
7079            decoder.debug_check_bounds::<Self>(offset);
7080            // Verify that padding bytes are zero.
7081            fidl::decode!(
7082                PlayerApplicationSettings,
7083                D,
7084                &mut self.current_settings,
7085                decoder,
7086                offset + 0,
7087                _depth
7088            )?;
7089            Ok(())
7090        }
7091    }
7092
7093    impl fidl::encoding::ValueTypeMarker
7094        for TargetHandlerListPlayerApplicationSettingAttributesResponse
7095    {
7096        type Borrowed<'a> = &'a Self;
7097        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7098            value
7099        }
7100    }
7101
7102    unsafe impl fidl::encoding::TypeMarker
7103        for TargetHandlerListPlayerApplicationSettingAttributesResponse
7104    {
7105        type Owned = Self;
7106
7107        #[inline(always)]
7108        fn inline_align(_context: fidl::encoding::Context) -> usize {
7109            8
7110        }
7111
7112        #[inline(always)]
7113        fn inline_size(_context: fidl::encoding::Context) -> usize {
7114            16
7115        }
7116    }
7117
7118    unsafe impl<D: fidl::encoding::ResourceDialect>
7119        fidl::encoding::Encode<TargetHandlerListPlayerApplicationSettingAttributesResponse, D>
7120        for &TargetHandlerListPlayerApplicationSettingAttributesResponse
7121    {
7122        #[inline]
7123        unsafe fn encode(
7124            self,
7125            encoder: &mut fidl::encoding::Encoder<'_, D>,
7126            offset: usize,
7127            _depth: fidl::encoding::Depth,
7128        ) -> fidl::Result<()> {
7129            encoder
7130                .debug_check_bounds::<TargetHandlerListPlayerApplicationSettingAttributesResponse>(
7131                    offset,
7132                );
7133            // Delegate to tuple encoding.
7134            fidl::encoding::Encode::<TargetHandlerListPlayerApplicationSettingAttributesResponse, D>::encode(
7135                (
7136                    <fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131> as fidl::encoding::ValueTypeMarker>::borrow(&self.attributes),
7137                ),
7138                encoder, offset, _depth
7139            )
7140        }
7141    }
7142    unsafe impl<
7143            D: fidl::encoding::ResourceDialect,
7144            T0: fidl::encoding::Encode<
7145                fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>,
7146                D,
7147            >,
7148        > fidl::encoding::Encode<TargetHandlerListPlayerApplicationSettingAttributesResponse, D>
7149        for (T0,)
7150    {
7151        #[inline]
7152        unsafe fn encode(
7153            self,
7154            encoder: &mut fidl::encoding::Encoder<'_, D>,
7155            offset: usize,
7156            depth: fidl::encoding::Depth,
7157        ) -> fidl::Result<()> {
7158            encoder
7159                .debug_check_bounds::<TargetHandlerListPlayerApplicationSettingAttributesResponse>(
7160                    offset,
7161                );
7162            // Zero out padding regions. There's no need to apply masks
7163            // because the unmasked parts will be overwritten by fields.
7164            // Write the fields.
7165            self.0.encode(encoder, offset + 0, depth)?;
7166            Ok(())
7167        }
7168    }
7169
7170    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7171        for TargetHandlerListPlayerApplicationSettingAttributesResponse
7172    {
7173        #[inline(always)]
7174        fn new_empty() -> Self {
7175            Self {
7176                attributes: fidl::new_empty!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D),
7177            }
7178        }
7179
7180        #[inline]
7181        unsafe fn decode(
7182            &mut self,
7183            decoder: &mut fidl::encoding::Decoder<'_, D>,
7184            offset: usize,
7185            _depth: fidl::encoding::Depth,
7186        ) -> fidl::Result<()> {
7187            decoder.debug_check_bounds::<Self>(offset);
7188            // Verify that padding bytes are zero.
7189            fidl::decode!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D, &mut self.attributes, decoder, offset + 0, _depth)?;
7190            Ok(())
7191        }
7192    }
7193
7194    impl fidl::encoding::ValueTypeMarker for TargetHandlerSetPlayerApplicationSettingsResponse {
7195        type Borrowed<'a> = &'a Self;
7196        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7197            value
7198        }
7199    }
7200
7201    unsafe impl fidl::encoding::TypeMarker for TargetHandlerSetPlayerApplicationSettingsResponse {
7202        type Owned = Self;
7203
7204        #[inline(always)]
7205        fn inline_align(_context: fidl::encoding::Context) -> usize {
7206            8
7207        }
7208
7209        #[inline(always)]
7210        fn inline_size(_context: fidl::encoding::Context) -> usize {
7211            16
7212        }
7213    }
7214
7215    unsafe impl<D: fidl::encoding::ResourceDialect>
7216        fidl::encoding::Encode<TargetHandlerSetPlayerApplicationSettingsResponse, D>
7217        for &TargetHandlerSetPlayerApplicationSettingsResponse
7218    {
7219        #[inline]
7220        unsafe fn encode(
7221            self,
7222            encoder: &mut fidl::encoding::Encoder<'_, D>,
7223            offset: usize,
7224            _depth: fidl::encoding::Depth,
7225        ) -> fidl::Result<()> {
7226            encoder.debug_check_bounds::<TargetHandlerSetPlayerApplicationSettingsResponse>(offset);
7227            // Delegate to tuple encoding.
7228            fidl::encoding::Encode::<TargetHandlerSetPlayerApplicationSettingsResponse, D>::encode(
7229                (<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
7230                    &self.set_settings,
7231                ),),
7232                encoder,
7233                offset,
7234                _depth,
7235            )
7236        }
7237    }
7238    unsafe impl<
7239            D: fidl::encoding::ResourceDialect,
7240            T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
7241        > fidl::encoding::Encode<TargetHandlerSetPlayerApplicationSettingsResponse, D> for (T0,)
7242    {
7243        #[inline]
7244        unsafe fn encode(
7245            self,
7246            encoder: &mut fidl::encoding::Encoder<'_, D>,
7247            offset: usize,
7248            depth: fidl::encoding::Depth,
7249        ) -> fidl::Result<()> {
7250            encoder.debug_check_bounds::<TargetHandlerSetPlayerApplicationSettingsResponse>(offset);
7251            // Zero out padding regions. There's no need to apply masks
7252            // because the unmasked parts will be overwritten by fields.
7253            // Write the fields.
7254            self.0.encode(encoder, offset + 0, depth)?;
7255            Ok(())
7256        }
7257    }
7258
7259    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7260        for TargetHandlerSetPlayerApplicationSettingsResponse
7261    {
7262        #[inline(always)]
7263        fn new_empty() -> Self {
7264            Self { set_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
7265        }
7266
7267        #[inline]
7268        unsafe fn decode(
7269            &mut self,
7270            decoder: &mut fidl::encoding::Decoder<'_, D>,
7271            offset: usize,
7272            _depth: fidl::encoding::Depth,
7273        ) -> fidl::Result<()> {
7274            decoder.debug_check_bounds::<Self>(offset);
7275            // Verify that padding bytes are zero.
7276            fidl::decode!(
7277                PlayerApplicationSettings,
7278                D,
7279                &mut self.set_settings,
7280                decoder,
7281                offset + 0,
7282                _depth
7283            )?;
7284            Ok(())
7285        }
7286    }
7287
7288    impl fidl::encoding::ValueTypeMarker for TargetHandlerWatchNotificationResponse {
7289        type Borrowed<'a> = &'a Self;
7290        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7291            value
7292        }
7293    }
7294
7295    unsafe impl fidl::encoding::TypeMarker for TargetHandlerWatchNotificationResponse {
7296        type Owned = Self;
7297
7298        #[inline(always)]
7299        fn inline_align(_context: fidl::encoding::Context) -> usize {
7300            8
7301        }
7302
7303        #[inline(always)]
7304        fn inline_size(_context: fidl::encoding::Context) -> usize {
7305            16
7306        }
7307    }
7308
7309    unsafe impl<D: fidl::encoding::ResourceDialect>
7310        fidl::encoding::Encode<TargetHandlerWatchNotificationResponse, D>
7311        for &TargetHandlerWatchNotificationResponse
7312    {
7313        #[inline]
7314        unsafe fn encode(
7315            self,
7316            encoder: &mut fidl::encoding::Encoder<'_, D>,
7317            offset: usize,
7318            _depth: fidl::encoding::Depth,
7319        ) -> fidl::Result<()> {
7320            encoder.debug_check_bounds::<TargetHandlerWatchNotificationResponse>(offset);
7321            // Delegate to tuple encoding.
7322            fidl::encoding::Encode::<TargetHandlerWatchNotificationResponse, D>::encode(
7323                (<Notification as fidl::encoding::ValueTypeMarker>::borrow(&self.new_value),),
7324                encoder,
7325                offset,
7326                _depth,
7327            )
7328        }
7329    }
7330    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Notification, D>>
7331        fidl::encoding::Encode<TargetHandlerWatchNotificationResponse, D> for (T0,)
7332    {
7333        #[inline]
7334        unsafe fn encode(
7335            self,
7336            encoder: &mut fidl::encoding::Encoder<'_, D>,
7337            offset: usize,
7338            depth: fidl::encoding::Depth,
7339        ) -> fidl::Result<()> {
7340            encoder.debug_check_bounds::<TargetHandlerWatchNotificationResponse>(offset);
7341            // Zero out padding regions. There's no need to apply masks
7342            // because the unmasked parts will be overwritten by fields.
7343            // Write the fields.
7344            self.0.encode(encoder, offset + 0, depth)?;
7345            Ok(())
7346        }
7347    }
7348
7349    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7350        for TargetHandlerWatchNotificationResponse
7351    {
7352        #[inline(always)]
7353        fn new_empty() -> Self {
7354            Self { new_value: fidl::new_empty!(Notification, D) }
7355        }
7356
7357        #[inline]
7358        unsafe fn decode(
7359            &mut self,
7360            decoder: &mut fidl::encoding::Decoder<'_, D>,
7361            offset: usize,
7362            _depth: fidl::encoding::Depth,
7363        ) -> fidl::Result<()> {
7364            decoder.debug_check_bounds::<Self>(offset);
7365            // Verify that padding bytes are zero.
7366            fidl::decode!(Notification, D, &mut self.new_value, decoder, offset + 0, _depth)?;
7367            Ok(())
7368        }
7369    }
7370
7371    impl CustomPlayerApplicationSetting {
7372        #[inline(always)]
7373        fn max_ordinal_present(&self) -> u64 {
7374            if let Some(_) = self.current_value {
7375                return 4;
7376            }
7377            if let Some(_) = self.possible_values {
7378                return 3;
7379            }
7380            if let Some(_) = self.attribute_name {
7381                return 2;
7382            }
7383            if let Some(_) = self.attribute_id {
7384                return 1;
7385            }
7386            0
7387        }
7388    }
7389
7390    impl fidl::encoding::ValueTypeMarker for CustomPlayerApplicationSetting {
7391        type Borrowed<'a> = &'a Self;
7392        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7393            value
7394        }
7395    }
7396
7397    unsafe impl fidl::encoding::TypeMarker for CustomPlayerApplicationSetting {
7398        type Owned = Self;
7399
7400        #[inline(always)]
7401        fn inline_align(_context: fidl::encoding::Context) -> usize {
7402            8
7403        }
7404
7405        #[inline(always)]
7406        fn inline_size(_context: fidl::encoding::Context) -> usize {
7407            16
7408        }
7409    }
7410
7411    unsafe impl<D: fidl::encoding::ResourceDialect>
7412        fidl::encoding::Encode<CustomPlayerApplicationSetting, D>
7413        for &CustomPlayerApplicationSetting
7414    {
7415        unsafe fn encode(
7416            self,
7417            encoder: &mut fidl::encoding::Encoder<'_, D>,
7418            offset: usize,
7419            mut depth: fidl::encoding::Depth,
7420        ) -> fidl::Result<()> {
7421            encoder.debug_check_bounds::<CustomPlayerApplicationSetting>(offset);
7422            // Vector header
7423            let max_ordinal: u64 = self.max_ordinal_present();
7424            encoder.write_num(max_ordinal, offset);
7425            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7426            // Calling encoder.out_of_line_offset(0) is not allowed.
7427            if max_ordinal == 0 {
7428                return Ok(());
7429            }
7430            depth.increment()?;
7431            let envelope_size = 8;
7432            let bytes_len = max_ordinal as usize * envelope_size;
7433            #[allow(unused_variables)]
7434            let offset = encoder.out_of_line_offset(bytes_len);
7435            let mut _prev_end_offset: usize = 0;
7436            if 1 > max_ordinal {
7437                return Ok(());
7438            }
7439
7440            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7441            // are envelope_size bytes.
7442            let cur_offset: usize = (1 - 1) * envelope_size;
7443
7444            // Zero reserved fields.
7445            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7446
7447            // Safety:
7448            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7449            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7450            //   envelope_size bytes, there is always sufficient room.
7451            fidl::encoding::encode_in_envelope_optional::<u8, D>(
7452                self.attribute_id.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
7453                encoder,
7454                offset + cur_offset,
7455                depth,
7456            )?;
7457
7458            _prev_end_offset = cur_offset + envelope_size;
7459            if 2 > max_ordinal {
7460                return Ok(());
7461            }
7462
7463            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7464            // are envelope_size bytes.
7465            let cur_offset: usize = (2 - 1) * envelope_size;
7466
7467            // Zero reserved fields.
7468            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7469
7470            // Safety:
7471            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7472            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7473            //   envelope_size bytes, there is always sufficient room.
7474            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
7475                self.attribute_name.as_ref().map(
7476                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
7477                ),
7478                encoder,
7479                offset + cur_offset,
7480                depth,
7481            )?;
7482
7483            _prev_end_offset = cur_offset + envelope_size;
7484            if 3 > max_ordinal {
7485                return Ok(());
7486            }
7487
7488            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7489            // are envelope_size bytes.
7490            let cur_offset: usize = (3 - 1) * envelope_size;
7491
7492            // Zero reserved fields.
7493            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7494
7495            // Safety:
7496            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7497            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7498            //   envelope_size bytes, there is always sufficient room.
7499            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<CustomAttributeValue, 255>, D>(
7500            self.possible_values.as_ref().map(<fidl::encoding::Vector<CustomAttributeValue, 255> as fidl::encoding::ValueTypeMarker>::borrow),
7501            encoder, offset + cur_offset, depth
7502        )?;
7503
7504            _prev_end_offset = cur_offset + envelope_size;
7505            if 4 > max_ordinal {
7506                return Ok(());
7507            }
7508
7509            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7510            // are envelope_size bytes.
7511            let cur_offset: usize = (4 - 1) * envelope_size;
7512
7513            // Zero reserved fields.
7514            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7515
7516            // Safety:
7517            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7518            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7519            //   envelope_size bytes, there is always sufficient room.
7520            fidl::encoding::encode_in_envelope_optional::<u8, D>(
7521                self.current_value.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
7522                encoder,
7523                offset + cur_offset,
7524                depth,
7525            )?;
7526
7527            _prev_end_offset = cur_offset + envelope_size;
7528
7529            Ok(())
7530        }
7531    }
7532
7533    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7534        for CustomPlayerApplicationSetting
7535    {
7536        #[inline(always)]
7537        fn new_empty() -> Self {
7538            Self::default()
7539        }
7540
7541        unsafe fn decode(
7542            &mut self,
7543            decoder: &mut fidl::encoding::Decoder<'_, D>,
7544            offset: usize,
7545            mut depth: fidl::encoding::Depth,
7546        ) -> fidl::Result<()> {
7547            decoder.debug_check_bounds::<Self>(offset);
7548            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7549                None => return Err(fidl::Error::NotNullable),
7550                Some(len) => len,
7551            };
7552            // Calling decoder.out_of_line_offset(0) is not allowed.
7553            if len == 0 {
7554                return Ok(());
7555            };
7556            depth.increment()?;
7557            let envelope_size = 8;
7558            let bytes_len = len * envelope_size;
7559            let offset = decoder.out_of_line_offset(bytes_len)?;
7560            // Decode the envelope for each type.
7561            let mut _next_ordinal_to_read = 0;
7562            let mut next_offset = offset;
7563            let end_offset = offset + bytes_len;
7564            _next_ordinal_to_read += 1;
7565            if next_offset >= end_offset {
7566                return Ok(());
7567            }
7568
7569            // Decode unknown envelopes for gaps in ordinals.
7570            while _next_ordinal_to_read < 1 {
7571                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7572                _next_ordinal_to_read += 1;
7573                next_offset += envelope_size;
7574            }
7575
7576            let next_out_of_line = decoder.next_out_of_line();
7577            let handles_before = decoder.remaining_handles();
7578            if let Some((inlined, num_bytes, num_handles)) =
7579                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7580            {
7581                let member_inline_size =
7582                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7583                if inlined != (member_inline_size <= 4) {
7584                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7585                }
7586                let inner_offset;
7587                let mut inner_depth = depth.clone();
7588                if inlined {
7589                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7590                    inner_offset = next_offset;
7591                } else {
7592                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7593                    inner_depth.increment()?;
7594                }
7595                let val_ref = self.attribute_id.get_or_insert_with(|| fidl::new_empty!(u8, D));
7596                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
7597                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7598                {
7599                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7600                }
7601                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7602                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7603                }
7604            }
7605
7606            next_offset += envelope_size;
7607            _next_ordinal_to_read += 1;
7608            if next_offset >= end_offset {
7609                return Ok(());
7610            }
7611
7612            // Decode unknown envelopes for gaps in ordinals.
7613            while _next_ordinal_to_read < 2 {
7614                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7615                _next_ordinal_to_read += 1;
7616                next_offset += envelope_size;
7617            }
7618
7619            let next_out_of_line = decoder.next_out_of_line();
7620            let handles_before = decoder.remaining_handles();
7621            if let Some((inlined, num_bytes, num_handles)) =
7622                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7623            {
7624                let member_inline_size =
7625                    <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
7626                        decoder.context,
7627                    );
7628                if inlined != (member_inline_size <= 4) {
7629                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7630                }
7631                let inner_offset;
7632                let mut inner_depth = depth.clone();
7633                if inlined {
7634                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7635                    inner_offset = next_offset;
7636                } else {
7637                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7638                    inner_depth.increment()?;
7639                }
7640                let val_ref = self
7641                    .attribute_name
7642                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
7643                fidl::decode!(
7644                    fidl::encoding::BoundedString<255>,
7645                    D,
7646                    val_ref,
7647                    decoder,
7648                    inner_offset,
7649                    inner_depth
7650                )?;
7651                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7652                {
7653                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7654                }
7655                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7656                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7657                }
7658            }
7659
7660            next_offset += envelope_size;
7661            _next_ordinal_to_read += 1;
7662            if next_offset >= end_offset {
7663                return Ok(());
7664            }
7665
7666            // Decode unknown envelopes for gaps in ordinals.
7667            while _next_ordinal_to_read < 3 {
7668                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7669                _next_ordinal_to_read += 1;
7670                next_offset += envelope_size;
7671            }
7672
7673            let next_out_of_line = decoder.next_out_of_line();
7674            let handles_before = decoder.remaining_handles();
7675            if let Some((inlined, num_bytes, num_handles)) =
7676                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7677            {
7678                let member_inline_size = <fidl::encoding::Vector<CustomAttributeValue, 255> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7679                if inlined != (member_inline_size <= 4) {
7680                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7681                }
7682                let inner_offset;
7683                let mut inner_depth = depth.clone();
7684                if inlined {
7685                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7686                    inner_offset = next_offset;
7687                } else {
7688                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7689                    inner_depth.increment()?;
7690                }
7691                let val_ref = self.possible_values.get_or_insert_with(
7692                    || fidl::new_empty!(fidl::encoding::Vector<CustomAttributeValue, 255>, D),
7693                );
7694                fidl::decode!(fidl::encoding::Vector<CustomAttributeValue, 255>, D, val_ref, decoder, inner_offset, inner_depth)?;
7695                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7696                {
7697                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7698                }
7699                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7700                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7701                }
7702            }
7703
7704            next_offset += envelope_size;
7705            _next_ordinal_to_read += 1;
7706            if next_offset >= end_offset {
7707                return Ok(());
7708            }
7709
7710            // Decode unknown envelopes for gaps in ordinals.
7711            while _next_ordinal_to_read < 4 {
7712                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7713                _next_ordinal_to_read += 1;
7714                next_offset += envelope_size;
7715            }
7716
7717            let next_out_of_line = decoder.next_out_of_line();
7718            let handles_before = decoder.remaining_handles();
7719            if let Some((inlined, num_bytes, num_handles)) =
7720                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7721            {
7722                let member_inline_size =
7723                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7724                if inlined != (member_inline_size <= 4) {
7725                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7726                }
7727                let inner_offset;
7728                let mut inner_depth = depth.clone();
7729                if inlined {
7730                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7731                    inner_offset = next_offset;
7732                } else {
7733                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7734                    inner_depth.increment()?;
7735                }
7736                let val_ref = self.current_value.get_or_insert_with(|| fidl::new_empty!(u8, D));
7737                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
7738                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7739                {
7740                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7741                }
7742                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7743                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7744                }
7745            }
7746
7747            next_offset += envelope_size;
7748
7749            // Decode the remaining unknown envelopes.
7750            while next_offset < end_offset {
7751                _next_ordinal_to_read += 1;
7752                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7753                next_offset += envelope_size;
7754            }
7755
7756            Ok(())
7757        }
7758    }
7759
7760    impl FolderItem {
7761        #[inline(always)]
7762        fn max_ordinal_present(&self) -> u64 {
7763            if let Some(_) = self.displayable_name {
7764                return 4;
7765            }
7766            if let Some(_) = self.is_playable {
7767                return 3;
7768            }
7769            if let Some(_) = self.folder_type {
7770                return 2;
7771            }
7772            if let Some(_) = self.folder_uid {
7773                return 1;
7774            }
7775            0
7776        }
7777    }
7778
7779    impl fidl::encoding::ValueTypeMarker for FolderItem {
7780        type Borrowed<'a> = &'a Self;
7781        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7782            value
7783        }
7784    }
7785
7786    unsafe impl fidl::encoding::TypeMarker for FolderItem {
7787        type Owned = Self;
7788
7789        #[inline(always)]
7790        fn inline_align(_context: fidl::encoding::Context) -> usize {
7791            8
7792        }
7793
7794        #[inline(always)]
7795        fn inline_size(_context: fidl::encoding::Context) -> usize {
7796            16
7797        }
7798    }
7799
7800    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FolderItem, D>
7801        for &FolderItem
7802    {
7803        unsafe fn encode(
7804            self,
7805            encoder: &mut fidl::encoding::Encoder<'_, D>,
7806            offset: usize,
7807            mut depth: fidl::encoding::Depth,
7808        ) -> fidl::Result<()> {
7809            encoder.debug_check_bounds::<FolderItem>(offset);
7810            // Vector header
7811            let max_ordinal: u64 = self.max_ordinal_present();
7812            encoder.write_num(max_ordinal, offset);
7813            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7814            // Calling encoder.out_of_line_offset(0) is not allowed.
7815            if max_ordinal == 0 {
7816                return Ok(());
7817            }
7818            depth.increment()?;
7819            let envelope_size = 8;
7820            let bytes_len = max_ordinal as usize * envelope_size;
7821            #[allow(unused_variables)]
7822            let offset = encoder.out_of_line_offset(bytes_len);
7823            let mut _prev_end_offset: usize = 0;
7824            if 1 > max_ordinal {
7825                return Ok(());
7826            }
7827
7828            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7829            // are envelope_size bytes.
7830            let cur_offset: usize = (1 - 1) * envelope_size;
7831
7832            // Zero reserved fields.
7833            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7834
7835            // Safety:
7836            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7837            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7838            //   envelope_size bytes, there is always sufficient room.
7839            fidl::encoding::encode_in_envelope_optional::<u64, D>(
7840                self.folder_uid.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7841                encoder,
7842                offset + cur_offset,
7843                depth,
7844            )?;
7845
7846            _prev_end_offset = cur_offset + envelope_size;
7847            if 2 > max_ordinal {
7848                return Ok(());
7849            }
7850
7851            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7852            // are envelope_size bytes.
7853            let cur_offset: usize = (2 - 1) * envelope_size;
7854
7855            // Zero reserved fields.
7856            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7857
7858            // Safety:
7859            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7860            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7861            //   envelope_size bytes, there is always sufficient room.
7862            fidl::encoding::encode_in_envelope_optional::<FolderType, D>(
7863                self.folder_type
7864                    .as_ref()
7865                    .map(<FolderType as fidl::encoding::ValueTypeMarker>::borrow),
7866                encoder,
7867                offset + cur_offset,
7868                depth,
7869            )?;
7870
7871            _prev_end_offset = cur_offset + envelope_size;
7872            if 3 > max_ordinal {
7873                return Ok(());
7874            }
7875
7876            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7877            // are envelope_size bytes.
7878            let cur_offset: usize = (3 - 1) * envelope_size;
7879
7880            // Zero reserved fields.
7881            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7882
7883            // Safety:
7884            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7885            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7886            //   envelope_size bytes, there is always sufficient room.
7887            fidl::encoding::encode_in_envelope_optional::<bool, D>(
7888                self.is_playable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
7889                encoder,
7890                offset + cur_offset,
7891                depth,
7892            )?;
7893
7894            _prev_end_offset = cur_offset + envelope_size;
7895            if 4 > max_ordinal {
7896                return Ok(());
7897            }
7898
7899            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7900            // are envelope_size bytes.
7901            let cur_offset: usize = (4 - 1) * envelope_size;
7902
7903            // Zero reserved fields.
7904            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7905
7906            // Safety:
7907            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7908            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7909            //   envelope_size bytes, there is always sufficient room.
7910            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
7911                self.displayable_name.as_ref().map(
7912                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
7913                ),
7914                encoder,
7915                offset + cur_offset,
7916                depth,
7917            )?;
7918
7919            _prev_end_offset = cur_offset + envelope_size;
7920
7921            Ok(())
7922        }
7923    }
7924
7925    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FolderItem {
7926        #[inline(always)]
7927        fn new_empty() -> Self {
7928            Self::default()
7929        }
7930
7931        unsafe fn decode(
7932            &mut self,
7933            decoder: &mut fidl::encoding::Decoder<'_, D>,
7934            offset: usize,
7935            mut depth: fidl::encoding::Depth,
7936        ) -> fidl::Result<()> {
7937            decoder.debug_check_bounds::<Self>(offset);
7938            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7939                None => return Err(fidl::Error::NotNullable),
7940                Some(len) => len,
7941            };
7942            // Calling decoder.out_of_line_offset(0) is not allowed.
7943            if len == 0 {
7944                return Ok(());
7945            };
7946            depth.increment()?;
7947            let envelope_size = 8;
7948            let bytes_len = len * envelope_size;
7949            let offset = decoder.out_of_line_offset(bytes_len)?;
7950            // Decode the envelope for each type.
7951            let mut _next_ordinal_to_read = 0;
7952            let mut next_offset = offset;
7953            let end_offset = offset + bytes_len;
7954            _next_ordinal_to_read += 1;
7955            if next_offset >= end_offset {
7956                return Ok(());
7957            }
7958
7959            // Decode unknown envelopes for gaps in ordinals.
7960            while _next_ordinal_to_read < 1 {
7961                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7962                _next_ordinal_to_read += 1;
7963                next_offset += envelope_size;
7964            }
7965
7966            let next_out_of_line = decoder.next_out_of_line();
7967            let handles_before = decoder.remaining_handles();
7968            if let Some((inlined, num_bytes, num_handles)) =
7969                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7970            {
7971                let member_inline_size =
7972                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7973                if inlined != (member_inline_size <= 4) {
7974                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7975                }
7976                let inner_offset;
7977                let mut inner_depth = depth.clone();
7978                if inlined {
7979                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7980                    inner_offset = next_offset;
7981                } else {
7982                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7983                    inner_depth.increment()?;
7984                }
7985                let val_ref = self.folder_uid.get_or_insert_with(|| fidl::new_empty!(u64, D));
7986                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
7987                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7988                {
7989                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7990                }
7991                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7992                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7993                }
7994            }
7995
7996            next_offset += envelope_size;
7997            _next_ordinal_to_read += 1;
7998            if next_offset >= end_offset {
7999                return Ok(());
8000            }
8001
8002            // Decode unknown envelopes for gaps in ordinals.
8003            while _next_ordinal_to_read < 2 {
8004                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8005                _next_ordinal_to_read += 1;
8006                next_offset += envelope_size;
8007            }
8008
8009            let next_out_of_line = decoder.next_out_of_line();
8010            let handles_before = decoder.remaining_handles();
8011            if let Some((inlined, num_bytes, num_handles)) =
8012                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8013            {
8014                let member_inline_size =
8015                    <FolderType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8016                if inlined != (member_inline_size <= 4) {
8017                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8018                }
8019                let inner_offset;
8020                let mut inner_depth = depth.clone();
8021                if inlined {
8022                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8023                    inner_offset = next_offset;
8024                } else {
8025                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8026                    inner_depth.increment()?;
8027                }
8028                let val_ref =
8029                    self.folder_type.get_or_insert_with(|| fidl::new_empty!(FolderType, D));
8030                fidl::decode!(FolderType, D, val_ref, decoder, inner_offset, inner_depth)?;
8031                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8032                {
8033                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8034                }
8035                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8036                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8037                }
8038            }
8039
8040            next_offset += envelope_size;
8041            _next_ordinal_to_read += 1;
8042            if next_offset >= end_offset {
8043                return Ok(());
8044            }
8045
8046            // Decode unknown envelopes for gaps in ordinals.
8047            while _next_ordinal_to_read < 3 {
8048                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8049                _next_ordinal_to_read += 1;
8050                next_offset += envelope_size;
8051            }
8052
8053            let next_out_of_line = decoder.next_out_of_line();
8054            let handles_before = decoder.remaining_handles();
8055            if let Some((inlined, num_bytes, num_handles)) =
8056                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8057            {
8058                let member_inline_size =
8059                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8060                if inlined != (member_inline_size <= 4) {
8061                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8062                }
8063                let inner_offset;
8064                let mut inner_depth = depth.clone();
8065                if inlined {
8066                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8067                    inner_offset = next_offset;
8068                } else {
8069                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8070                    inner_depth.increment()?;
8071                }
8072                let val_ref = self.is_playable.get_or_insert_with(|| fidl::new_empty!(bool, D));
8073                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
8074                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8075                {
8076                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8077                }
8078                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8079                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8080                }
8081            }
8082
8083            next_offset += envelope_size;
8084            _next_ordinal_to_read += 1;
8085            if next_offset >= end_offset {
8086                return Ok(());
8087            }
8088
8089            // Decode unknown envelopes for gaps in ordinals.
8090            while _next_ordinal_to_read < 4 {
8091                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8092                _next_ordinal_to_read += 1;
8093                next_offset += envelope_size;
8094            }
8095
8096            let next_out_of_line = decoder.next_out_of_line();
8097            let handles_before = decoder.remaining_handles();
8098            if let Some((inlined, num_bytes, num_handles)) =
8099                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8100            {
8101                let member_inline_size =
8102                    <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
8103                        decoder.context,
8104                    );
8105                if inlined != (member_inline_size <= 4) {
8106                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8107                }
8108                let inner_offset;
8109                let mut inner_depth = depth.clone();
8110                if inlined {
8111                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8112                    inner_offset = next_offset;
8113                } else {
8114                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8115                    inner_depth.increment()?;
8116                }
8117                let val_ref = self
8118                    .displayable_name
8119                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
8120                fidl::decode!(
8121                    fidl::encoding::BoundedString<255>,
8122                    D,
8123                    val_ref,
8124                    decoder,
8125                    inner_offset,
8126                    inner_depth
8127                )?;
8128                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8129                {
8130                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8131                }
8132                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8133                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8134                }
8135            }
8136
8137            next_offset += envelope_size;
8138
8139            // Decode the remaining unknown envelopes.
8140            while next_offset < end_offset {
8141                _next_ordinal_to_read += 1;
8142                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8143                next_offset += envelope_size;
8144            }
8145
8146            Ok(())
8147        }
8148    }
8149
8150    impl MediaAttributes {
8151        #[inline(always)]
8152        fn max_ordinal_present(&self) -> u64 {
8153            if let Some(_) = self.playing_time {
8154                return 7;
8155            }
8156            if let Some(_) = self.genre {
8157                return 6;
8158            }
8159            if let Some(_) = self.total_number_of_tracks {
8160                return 5;
8161            }
8162            if let Some(_) = self.track_number {
8163                return 4;
8164            }
8165            if let Some(_) = self.album_name {
8166                return 3;
8167            }
8168            if let Some(_) = self.artist_name {
8169                return 2;
8170            }
8171            if let Some(_) = self.title {
8172                return 1;
8173            }
8174            0
8175        }
8176    }
8177
8178    impl fidl::encoding::ValueTypeMarker for MediaAttributes {
8179        type Borrowed<'a> = &'a Self;
8180        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8181            value
8182        }
8183    }
8184
8185    unsafe impl fidl::encoding::TypeMarker for MediaAttributes {
8186        type Owned = Self;
8187
8188        #[inline(always)]
8189        fn inline_align(_context: fidl::encoding::Context) -> usize {
8190            8
8191        }
8192
8193        #[inline(always)]
8194        fn inline_size(_context: fidl::encoding::Context) -> usize {
8195            16
8196        }
8197    }
8198
8199    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MediaAttributes, D>
8200        for &MediaAttributes
8201    {
8202        unsafe fn encode(
8203            self,
8204            encoder: &mut fidl::encoding::Encoder<'_, D>,
8205            offset: usize,
8206            mut depth: fidl::encoding::Depth,
8207        ) -> fidl::Result<()> {
8208            encoder.debug_check_bounds::<MediaAttributes>(offset);
8209            // Vector header
8210            let max_ordinal: u64 = self.max_ordinal_present();
8211            encoder.write_num(max_ordinal, offset);
8212            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8213            // Calling encoder.out_of_line_offset(0) is not allowed.
8214            if max_ordinal == 0 {
8215                return Ok(());
8216            }
8217            depth.increment()?;
8218            let envelope_size = 8;
8219            let bytes_len = max_ordinal as usize * envelope_size;
8220            #[allow(unused_variables)]
8221            let offset = encoder.out_of_line_offset(bytes_len);
8222            let mut _prev_end_offset: usize = 0;
8223            if 1 > max_ordinal {
8224                return Ok(());
8225            }
8226
8227            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8228            // are envelope_size bytes.
8229            let cur_offset: usize = (1 - 1) * envelope_size;
8230
8231            // Zero reserved fields.
8232            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8233
8234            // Safety:
8235            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8236            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8237            //   envelope_size bytes, there is always sufficient room.
8238            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
8239            self.title.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
8240            encoder, offset + cur_offset, depth
8241        )?;
8242
8243            _prev_end_offset = cur_offset + envelope_size;
8244            if 2 > max_ordinal {
8245                return Ok(());
8246            }
8247
8248            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8249            // are envelope_size bytes.
8250            let cur_offset: usize = (2 - 1) * envelope_size;
8251
8252            // Zero reserved fields.
8253            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8254
8255            // Safety:
8256            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8257            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8258            //   envelope_size bytes, there is always sufficient room.
8259            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
8260            self.artist_name.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
8261            encoder, offset + cur_offset, depth
8262        )?;
8263
8264            _prev_end_offset = cur_offset + envelope_size;
8265            if 3 > max_ordinal {
8266                return Ok(());
8267            }
8268
8269            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8270            // are envelope_size bytes.
8271            let cur_offset: usize = (3 - 1) * envelope_size;
8272
8273            // Zero reserved fields.
8274            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8275
8276            // Safety:
8277            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8278            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8279            //   envelope_size bytes, there is always sufficient room.
8280            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
8281            self.album_name.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
8282            encoder, offset + cur_offset, depth
8283        )?;
8284
8285            _prev_end_offset = cur_offset + envelope_size;
8286            if 4 > max_ordinal {
8287                return Ok(());
8288            }
8289
8290            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8291            // are envelope_size bytes.
8292            let cur_offset: usize = (4 - 1) * envelope_size;
8293
8294            // Zero reserved fields.
8295            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8296
8297            // Safety:
8298            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8299            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8300            //   envelope_size bytes, there is always sufficient room.
8301            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
8302            self.track_number.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
8303            encoder, offset + cur_offset, depth
8304        )?;
8305
8306            _prev_end_offset = cur_offset + envelope_size;
8307            if 5 > max_ordinal {
8308                return Ok(());
8309            }
8310
8311            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8312            // are envelope_size bytes.
8313            let cur_offset: usize = (5 - 1) * envelope_size;
8314
8315            // Zero reserved fields.
8316            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8317
8318            // Safety:
8319            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8320            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8321            //   envelope_size bytes, there is always sufficient room.
8322            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
8323            self.total_number_of_tracks.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
8324            encoder, offset + cur_offset, depth
8325        )?;
8326
8327            _prev_end_offset = cur_offset + envelope_size;
8328            if 6 > max_ordinal {
8329                return Ok(());
8330            }
8331
8332            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8333            // are envelope_size bytes.
8334            let cur_offset: usize = (6 - 1) * envelope_size;
8335
8336            // Zero reserved fields.
8337            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8338
8339            // Safety:
8340            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8341            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8342            //   envelope_size bytes, there is always sufficient room.
8343            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
8344            self.genre.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
8345            encoder, offset + cur_offset, depth
8346        )?;
8347
8348            _prev_end_offset = cur_offset + envelope_size;
8349            if 7 > max_ordinal {
8350                return Ok(());
8351            }
8352
8353            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8354            // are envelope_size bytes.
8355            let cur_offset: usize = (7 - 1) * envelope_size;
8356
8357            // Zero reserved fields.
8358            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8359
8360            // Safety:
8361            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8362            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8363            //   envelope_size bytes, there is always sufficient room.
8364            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
8365            self.playing_time.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
8366            encoder, offset + cur_offset, depth
8367        )?;
8368
8369            _prev_end_offset = cur_offset + envelope_size;
8370
8371            Ok(())
8372        }
8373    }
8374
8375    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MediaAttributes {
8376        #[inline(always)]
8377        fn new_empty() -> Self {
8378            Self::default()
8379        }
8380
8381        unsafe fn decode(
8382            &mut self,
8383            decoder: &mut fidl::encoding::Decoder<'_, D>,
8384            offset: usize,
8385            mut depth: fidl::encoding::Depth,
8386        ) -> fidl::Result<()> {
8387            decoder.debug_check_bounds::<Self>(offset);
8388            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8389                None => return Err(fidl::Error::NotNullable),
8390                Some(len) => len,
8391            };
8392            // Calling decoder.out_of_line_offset(0) is not allowed.
8393            if len == 0 {
8394                return Ok(());
8395            };
8396            depth.increment()?;
8397            let envelope_size = 8;
8398            let bytes_len = len * envelope_size;
8399            let offset = decoder.out_of_line_offset(bytes_len)?;
8400            // Decode the envelope for each type.
8401            let mut _next_ordinal_to_read = 0;
8402            let mut next_offset = offset;
8403            let end_offset = offset + bytes_len;
8404            _next_ordinal_to_read += 1;
8405            if next_offset >= end_offset {
8406                return Ok(());
8407            }
8408
8409            // Decode unknown envelopes for gaps in ordinals.
8410            while _next_ordinal_to_read < 1 {
8411                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8412                _next_ordinal_to_read += 1;
8413                next_offset += envelope_size;
8414            }
8415
8416            let next_out_of_line = decoder.next_out_of_line();
8417            let handles_before = decoder.remaining_handles();
8418            if let Some((inlined, num_bytes, num_handles)) =
8419                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8420            {
8421                let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8422                if inlined != (member_inline_size <= 4) {
8423                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8424                }
8425                let inner_offset;
8426                let mut inner_depth = depth.clone();
8427                if inlined {
8428                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8429                    inner_offset = next_offset;
8430                } else {
8431                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8432                    inner_depth.increment()?;
8433                }
8434                let val_ref = self.title.get_or_insert_with(|| {
8435                    fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
8436                });
8437                fidl::decode!(
8438                    fidl::encoding::BoundedString<65535>,
8439                    D,
8440                    val_ref,
8441                    decoder,
8442                    inner_offset,
8443                    inner_depth
8444                )?;
8445                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8446                {
8447                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8448                }
8449                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8450                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8451                }
8452            }
8453
8454            next_offset += envelope_size;
8455            _next_ordinal_to_read += 1;
8456            if next_offset >= end_offset {
8457                return Ok(());
8458            }
8459
8460            // Decode unknown envelopes for gaps in ordinals.
8461            while _next_ordinal_to_read < 2 {
8462                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8463                _next_ordinal_to_read += 1;
8464                next_offset += envelope_size;
8465            }
8466
8467            let next_out_of_line = decoder.next_out_of_line();
8468            let handles_before = decoder.remaining_handles();
8469            if let Some((inlined, num_bytes, num_handles)) =
8470                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8471            {
8472                let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8473                if inlined != (member_inline_size <= 4) {
8474                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8475                }
8476                let inner_offset;
8477                let mut inner_depth = depth.clone();
8478                if inlined {
8479                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8480                    inner_offset = next_offset;
8481                } else {
8482                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8483                    inner_depth.increment()?;
8484                }
8485                let val_ref = self.artist_name.get_or_insert_with(|| {
8486                    fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
8487                });
8488                fidl::decode!(
8489                    fidl::encoding::BoundedString<65535>,
8490                    D,
8491                    val_ref,
8492                    decoder,
8493                    inner_offset,
8494                    inner_depth
8495                )?;
8496                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8497                {
8498                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8499                }
8500                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8501                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8502                }
8503            }
8504
8505            next_offset += envelope_size;
8506            _next_ordinal_to_read += 1;
8507            if next_offset >= end_offset {
8508                return Ok(());
8509            }
8510
8511            // Decode unknown envelopes for gaps in ordinals.
8512            while _next_ordinal_to_read < 3 {
8513                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8514                _next_ordinal_to_read += 1;
8515                next_offset += envelope_size;
8516            }
8517
8518            let next_out_of_line = decoder.next_out_of_line();
8519            let handles_before = decoder.remaining_handles();
8520            if let Some((inlined, num_bytes, num_handles)) =
8521                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8522            {
8523                let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8524                if inlined != (member_inline_size <= 4) {
8525                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8526                }
8527                let inner_offset;
8528                let mut inner_depth = depth.clone();
8529                if inlined {
8530                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8531                    inner_offset = next_offset;
8532                } else {
8533                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8534                    inner_depth.increment()?;
8535                }
8536                let val_ref = self.album_name.get_or_insert_with(|| {
8537                    fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
8538                });
8539                fidl::decode!(
8540                    fidl::encoding::BoundedString<65535>,
8541                    D,
8542                    val_ref,
8543                    decoder,
8544                    inner_offset,
8545                    inner_depth
8546                )?;
8547                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8548                {
8549                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8550                }
8551                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8552                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8553                }
8554            }
8555
8556            next_offset += envelope_size;
8557            _next_ordinal_to_read += 1;
8558            if next_offset >= end_offset {
8559                return Ok(());
8560            }
8561
8562            // Decode unknown envelopes for gaps in ordinals.
8563            while _next_ordinal_to_read < 4 {
8564                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8565                _next_ordinal_to_read += 1;
8566                next_offset += envelope_size;
8567            }
8568
8569            let next_out_of_line = decoder.next_out_of_line();
8570            let handles_before = decoder.remaining_handles();
8571            if let Some((inlined, num_bytes, num_handles)) =
8572                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8573            {
8574                let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8575                if inlined != (member_inline_size <= 4) {
8576                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8577                }
8578                let inner_offset;
8579                let mut inner_depth = depth.clone();
8580                if inlined {
8581                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8582                    inner_offset = next_offset;
8583                } else {
8584                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8585                    inner_depth.increment()?;
8586                }
8587                let val_ref = self.track_number.get_or_insert_with(|| {
8588                    fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
8589                });
8590                fidl::decode!(
8591                    fidl::encoding::BoundedString<65535>,
8592                    D,
8593                    val_ref,
8594                    decoder,
8595                    inner_offset,
8596                    inner_depth
8597                )?;
8598                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8599                {
8600                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8601                }
8602                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8603                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8604                }
8605            }
8606
8607            next_offset += envelope_size;
8608            _next_ordinal_to_read += 1;
8609            if next_offset >= end_offset {
8610                return Ok(());
8611            }
8612
8613            // Decode unknown envelopes for gaps in ordinals.
8614            while _next_ordinal_to_read < 5 {
8615                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8616                _next_ordinal_to_read += 1;
8617                next_offset += envelope_size;
8618            }
8619
8620            let next_out_of_line = decoder.next_out_of_line();
8621            let handles_before = decoder.remaining_handles();
8622            if let Some((inlined, num_bytes, num_handles)) =
8623                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8624            {
8625                let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8626                if inlined != (member_inline_size <= 4) {
8627                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8628                }
8629                let inner_offset;
8630                let mut inner_depth = depth.clone();
8631                if inlined {
8632                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8633                    inner_offset = next_offset;
8634                } else {
8635                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8636                    inner_depth.increment()?;
8637                }
8638                let val_ref = self.total_number_of_tracks.get_or_insert_with(|| {
8639                    fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
8640                });
8641                fidl::decode!(
8642                    fidl::encoding::BoundedString<65535>,
8643                    D,
8644                    val_ref,
8645                    decoder,
8646                    inner_offset,
8647                    inner_depth
8648                )?;
8649                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8650                {
8651                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8652                }
8653                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8654                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8655                }
8656            }
8657
8658            next_offset += envelope_size;
8659            _next_ordinal_to_read += 1;
8660            if next_offset >= end_offset {
8661                return Ok(());
8662            }
8663
8664            // Decode unknown envelopes for gaps in ordinals.
8665            while _next_ordinal_to_read < 6 {
8666                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8667                _next_ordinal_to_read += 1;
8668                next_offset += envelope_size;
8669            }
8670
8671            let next_out_of_line = decoder.next_out_of_line();
8672            let handles_before = decoder.remaining_handles();
8673            if let Some((inlined, num_bytes, num_handles)) =
8674                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8675            {
8676                let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8677                if inlined != (member_inline_size <= 4) {
8678                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8679                }
8680                let inner_offset;
8681                let mut inner_depth = depth.clone();
8682                if inlined {
8683                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8684                    inner_offset = next_offset;
8685                } else {
8686                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8687                    inner_depth.increment()?;
8688                }
8689                let val_ref = self.genre.get_or_insert_with(|| {
8690                    fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
8691                });
8692                fidl::decode!(
8693                    fidl::encoding::BoundedString<65535>,
8694                    D,
8695                    val_ref,
8696                    decoder,
8697                    inner_offset,
8698                    inner_depth
8699                )?;
8700                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8701                {
8702                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8703                }
8704                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8705                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8706                }
8707            }
8708
8709            next_offset += envelope_size;
8710            _next_ordinal_to_read += 1;
8711            if next_offset >= end_offset {
8712                return Ok(());
8713            }
8714
8715            // Decode unknown envelopes for gaps in ordinals.
8716            while _next_ordinal_to_read < 7 {
8717                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8718                _next_ordinal_to_read += 1;
8719                next_offset += envelope_size;
8720            }
8721
8722            let next_out_of_line = decoder.next_out_of_line();
8723            let handles_before = decoder.remaining_handles();
8724            if let Some((inlined, num_bytes, num_handles)) =
8725                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8726            {
8727                let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8728                if inlined != (member_inline_size <= 4) {
8729                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8730                }
8731                let inner_offset;
8732                let mut inner_depth = depth.clone();
8733                if inlined {
8734                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8735                    inner_offset = next_offset;
8736                } else {
8737                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8738                    inner_depth.increment()?;
8739                }
8740                let val_ref = self.playing_time.get_or_insert_with(|| {
8741                    fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
8742                });
8743                fidl::decode!(
8744                    fidl::encoding::BoundedString<65535>,
8745                    D,
8746                    val_ref,
8747                    decoder,
8748                    inner_offset,
8749                    inner_depth
8750                )?;
8751                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8752                {
8753                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8754                }
8755                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8756                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8757                }
8758            }
8759
8760            next_offset += envelope_size;
8761
8762            // Decode the remaining unknown envelopes.
8763            while next_offset < end_offset {
8764                _next_ordinal_to_read += 1;
8765                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8766                next_offset += envelope_size;
8767            }
8768
8769            Ok(())
8770        }
8771    }
8772
8773    impl MediaElementItem {
8774        #[inline(always)]
8775        fn max_ordinal_present(&self) -> u64 {
8776            if let Some(_) = self.attributes {
8777                return 4;
8778            }
8779            if let Some(_) = self.displayable_name {
8780                return 3;
8781            }
8782            if let Some(_) = self.media_type {
8783                return 2;
8784            }
8785            if let Some(_) = self.media_element_uid {
8786                return 1;
8787            }
8788            0
8789        }
8790    }
8791
8792    impl fidl::encoding::ValueTypeMarker for MediaElementItem {
8793        type Borrowed<'a> = &'a Self;
8794        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8795            value
8796        }
8797    }
8798
8799    unsafe impl fidl::encoding::TypeMarker for MediaElementItem {
8800        type Owned = Self;
8801
8802        #[inline(always)]
8803        fn inline_align(_context: fidl::encoding::Context) -> usize {
8804            8
8805        }
8806
8807        #[inline(always)]
8808        fn inline_size(_context: fidl::encoding::Context) -> usize {
8809            16
8810        }
8811    }
8812
8813    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MediaElementItem, D>
8814        for &MediaElementItem
8815    {
8816        unsafe fn encode(
8817            self,
8818            encoder: &mut fidl::encoding::Encoder<'_, D>,
8819            offset: usize,
8820            mut depth: fidl::encoding::Depth,
8821        ) -> fidl::Result<()> {
8822            encoder.debug_check_bounds::<MediaElementItem>(offset);
8823            // Vector header
8824            let max_ordinal: u64 = self.max_ordinal_present();
8825            encoder.write_num(max_ordinal, offset);
8826            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8827            // Calling encoder.out_of_line_offset(0) is not allowed.
8828            if max_ordinal == 0 {
8829                return Ok(());
8830            }
8831            depth.increment()?;
8832            let envelope_size = 8;
8833            let bytes_len = max_ordinal as usize * envelope_size;
8834            #[allow(unused_variables)]
8835            let offset = encoder.out_of_line_offset(bytes_len);
8836            let mut _prev_end_offset: usize = 0;
8837            if 1 > max_ordinal {
8838                return Ok(());
8839            }
8840
8841            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8842            // are envelope_size bytes.
8843            let cur_offset: usize = (1 - 1) * envelope_size;
8844
8845            // Zero reserved fields.
8846            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8847
8848            // Safety:
8849            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8850            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8851            //   envelope_size bytes, there is always sufficient room.
8852            fidl::encoding::encode_in_envelope_optional::<u64, D>(
8853                self.media_element_uid
8854                    .as_ref()
8855                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8856                encoder,
8857                offset + cur_offset,
8858                depth,
8859            )?;
8860
8861            _prev_end_offset = cur_offset + envelope_size;
8862            if 2 > max_ordinal {
8863                return Ok(());
8864            }
8865
8866            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8867            // are envelope_size bytes.
8868            let cur_offset: usize = (2 - 1) * envelope_size;
8869
8870            // Zero reserved fields.
8871            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8872
8873            // Safety:
8874            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8875            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8876            //   envelope_size bytes, there is always sufficient room.
8877            fidl::encoding::encode_in_envelope_optional::<MediaType, D>(
8878                self.media_type
8879                    .as_ref()
8880                    .map(<MediaType as fidl::encoding::ValueTypeMarker>::borrow),
8881                encoder,
8882                offset + cur_offset,
8883                depth,
8884            )?;
8885
8886            _prev_end_offset = cur_offset + envelope_size;
8887            if 3 > max_ordinal {
8888                return Ok(());
8889            }
8890
8891            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8892            // are envelope_size bytes.
8893            let cur_offset: usize = (3 - 1) * envelope_size;
8894
8895            // Zero reserved fields.
8896            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8897
8898            // Safety:
8899            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8900            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8901            //   envelope_size bytes, there is always sufficient room.
8902            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
8903                self.displayable_name.as_ref().map(
8904                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
8905                ),
8906                encoder,
8907                offset + cur_offset,
8908                depth,
8909            )?;
8910
8911            _prev_end_offset = cur_offset + envelope_size;
8912            if 4 > max_ordinal {
8913                return Ok(());
8914            }
8915
8916            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8917            // are envelope_size bytes.
8918            let cur_offset: usize = (4 - 1) * envelope_size;
8919
8920            // Zero reserved fields.
8921            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8922
8923            // Safety:
8924            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8925            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8926            //   envelope_size bytes, there is always sufficient room.
8927            fidl::encoding::encode_in_envelope_optional::<MediaAttributes, D>(
8928                self.attributes
8929                    .as_ref()
8930                    .map(<MediaAttributes as fidl::encoding::ValueTypeMarker>::borrow),
8931                encoder,
8932                offset + cur_offset,
8933                depth,
8934            )?;
8935
8936            _prev_end_offset = cur_offset + envelope_size;
8937
8938            Ok(())
8939        }
8940    }
8941
8942    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MediaElementItem {
8943        #[inline(always)]
8944        fn new_empty() -> Self {
8945            Self::default()
8946        }
8947
8948        unsafe fn decode(
8949            &mut self,
8950            decoder: &mut fidl::encoding::Decoder<'_, D>,
8951            offset: usize,
8952            mut depth: fidl::encoding::Depth,
8953        ) -> fidl::Result<()> {
8954            decoder.debug_check_bounds::<Self>(offset);
8955            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8956                None => return Err(fidl::Error::NotNullable),
8957                Some(len) => len,
8958            };
8959            // Calling decoder.out_of_line_offset(0) is not allowed.
8960            if len == 0 {
8961                return Ok(());
8962            };
8963            depth.increment()?;
8964            let envelope_size = 8;
8965            let bytes_len = len * envelope_size;
8966            let offset = decoder.out_of_line_offset(bytes_len)?;
8967            // Decode the envelope for each type.
8968            let mut _next_ordinal_to_read = 0;
8969            let mut next_offset = offset;
8970            let end_offset = offset + bytes_len;
8971            _next_ordinal_to_read += 1;
8972            if next_offset >= end_offset {
8973                return Ok(());
8974            }
8975
8976            // Decode unknown envelopes for gaps in ordinals.
8977            while _next_ordinal_to_read < 1 {
8978                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8979                _next_ordinal_to_read += 1;
8980                next_offset += envelope_size;
8981            }
8982
8983            let next_out_of_line = decoder.next_out_of_line();
8984            let handles_before = decoder.remaining_handles();
8985            if let Some((inlined, num_bytes, num_handles)) =
8986                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8987            {
8988                let member_inline_size =
8989                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8990                if inlined != (member_inline_size <= 4) {
8991                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8992                }
8993                let inner_offset;
8994                let mut inner_depth = depth.clone();
8995                if inlined {
8996                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8997                    inner_offset = next_offset;
8998                } else {
8999                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9000                    inner_depth.increment()?;
9001                }
9002                let val_ref =
9003                    self.media_element_uid.get_or_insert_with(|| fidl::new_empty!(u64, D));
9004                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
9005                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9006                {
9007                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9008                }
9009                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9010                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9011                }
9012            }
9013
9014            next_offset += envelope_size;
9015            _next_ordinal_to_read += 1;
9016            if next_offset >= end_offset {
9017                return Ok(());
9018            }
9019
9020            // Decode unknown envelopes for gaps in ordinals.
9021            while _next_ordinal_to_read < 2 {
9022                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9023                _next_ordinal_to_read += 1;
9024                next_offset += envelope_size;
9025            }
9026
9027            let next_out_of_line = decoder.next_out_of_line();
9028            let handles_before = decoder.remaining_handles();
9029            if let Some((inlined, num_bytes, num_handles)) =
9030                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9031            {
9032                let member_inline_size =
9033                    <MediaType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9034                if inlined != (member_inline_size <= 4) {
9035                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9036                }
9037                let inner_offset;
9038                let mut inner_depth = depth.clone();
9039                if inlined {
9040                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9041                    inner_offset = next_offset;
9042                } else {
9043                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9044                    inner_depth.increment()?;
9045                }
9046                let val_ref = self.media_type.get_or_insert_with(|| fidl::new_empty!(MediaType, D));
9047                fidl::decode!(MediaType, D, val_ref, decoder, inner_offset, inner_depth)?;
9048                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9049                {
9050                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9051                }
9052                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9053                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9054                }
9055            }
9056
9057            next_offset += envelope_size;
9058            _next_ordinal_to_read += 1;
9059            if next_offset >= end_offset {
9060                return Ok(());
9061            }
9062
9063            // Decode unknown envelopes for gaps in ordinals.
9064            while _next_ordinal_to_read < 3 {
9065                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9066                _next_ordinal_to_read += 1;
9067                next_offset += envelope_size;
9068            }
9069
9070            let next_out_of_line = decoder.next_out_of_line();
9071            let handles_before = decoder.remaining_handles();
9072            if let Some((inlined, num_bytes, num_handles)) =
9073                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9074            {
9075                let member_inline_size =
9076                    <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
9077                        decoder.context,
9078                    );
9079                if inlined != (member_inline_size <= 4) {
9080                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9081                }
9082                let inner_offset;
9083                let mut inner_depth = depth.clone();
9084                if inlined {
9085                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9086                    inner_offset = next_offset;
9087                } else {
9088                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9089                    inner_depth.increment()?;
9090                }
9091                let val_ref = self
9092                    .displayable_name
9093                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
9094                fidl::decode!(
9095                    fidl::encoding::BoundedString<255>,
9096                    D,
9097                    val_ref,
9098                    decoder,
9099                    inner_offset,
9100                    inner_depth
9101                )?;
9102                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9103                {
9104                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9105                }
9106                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9107                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9108                }
9109            }
9110
9111            next_offset += envelope_size;
9112            _next_ordinal_to_read += 1;
9113            if next_offset >= end_offset {
9114                return Ok(());
9115            }
9116
9117            // Decode unknown envelopes for gaps in ordinals.
9118            while _next_ordinal_to_read < 4 {
9119                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9120                _next_ordinal_to_read += 1;
9121                next_offset += envelope_size;
9122            }
9123
9124            let next_out_of_line = decoder.next_out_of_line();
9125            let handles_before = decoder.remaining_handles();
9126            if let Some((inlined, num_bytes, num_handles)) =
9127                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9128            {
9129                let member_inline_size =
9130                    <MediaAttributes as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9131                if inlined != (member_inline_size <= 4) {
9132                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9133                }
9134                let inner_offset;
9135                let mut inner_depth = depth.clone();
9136                if inlined {
9137                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9138                    inner_offset = next_offset;
9139                } else {
9140                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9141                    inner_depth.increment()?;
9142                }
9143                let val_ref =
9144                    self.attributes.get_or_insert_with(|| fidl::new_empty!(MediaAttributes, D));
9145                fidl::decode!(MediaAttributes, D, val_ref, decoder, inner_offset, inner_depth)?;
9146                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9147                {
9148                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9149                }
9150                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9151                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9152                }
9153            }
9154
9155            next_offset += envelope_size;
9156
9157            // Decode the remaining unknown envelopes.
9158            while next_offset < end_offset {
9159                _next_ordinal_to_read += 1;
9160                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9161                next_offset += envelope_size;
9162            }
9163
9164            Ok(())
9165        }
9166    }
9167
9168    impl MediaPlayerItem {
9169        #[inline(always)]
9170        fn max_ordinal_present(&self) -> u64 {
9171            if let Some(_) = self.feature_bits_ext {
9172                return 7;
9173            }
9174            if let Some(_) = self.feature_bits {
9175                return 6;
9176            }
9177            if let Some(_) = self.displayable_name {
9178                return 5;
9179            }
9180            if let Some(_) = self.playback_status {
9181                return 4;
9182            }
9183            if let Some(_) = self.sub_type {
9184                return 3;
9185            }
9186            if let Some(_) = self.major_type {
9187                return 2;
9188            }
9189            if let Some(_) = self.player_id {
9190                return 1;
9191            }
9192            0
9193        }
9194    }
9195
9196    impl fidl::encoding::ValueTypeMarker for MediaPlayerItem {
9197        type Borrowed<'a> = &'a Self;
9198        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9199            value
9200        }
9201    }
9202
9203    unsafe impl fidl::encoding::TypeMarker for MediaPlayerItem {
9204        type Owned = Self;
9205
9206        #[inline(always)]
9207        fn inline_align(_context: fidl::encoding::Context) -> usize {
9208            8
9209        }
9210
9211        #[inline(always)]
9212        fn inline_size(_context: fidl::encoding::Context) -> usize {
9213            16
9214        }
9215    }
9216
9217    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MediaPlayerItem, D>
9218        for &MediaPlayerItem
9219    {
9220        unsafe fn encode(
9221            self,
9222            encoder: &mut fidl::encoding::Encoder<'_, D>,
9223            offset: usize,
9224            mut depth: fidl::encoding::Depth,
9225        ) -> fidl::Result<()> {
9226            encoder.debug_check_bounds::<MediaPlayerItem>(offset);
9227            // Vector header
9228            let max_ordinal: u64 = self.max_ordinal_present();
9229            encoder.write_num(max_ordinal, offset);
9230            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9231            // Calling encoder.out_of_line_offset(0) is not allowed.
9232            if max_ordinal == 0 {
9233                return Ok(());
9234            }
9235            depth.increment()?;
9236            let envelope_size = 8;
9237            let bytes_len = max_ordinal as usize * envelope_size;
9238            #[allow(unused_variables)]
9239            let offset = encoder.out_of_line_offset(bytes_len);
9240            let mut _prev_end_offset: usize = 0;
9241            if 1 > max_ordinal {
9242                return Ok(());
9243            }
9244
9245            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9246            // are envelope_size bytes.
9247            let cur_offset: usize = (1 - 1) * envelope_size;
9248
9249            // Zero reserved fields.
9250            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9251
9252            // Safety:
9253            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9254            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9255            //   envelope_size bytes, there is always sufficient room.
9256            fidl::encoding::encode_in_envelope_optional::<u16, D>(
9257                self.player_id.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
9258                encoder,
9259                offset + cur_offset,
9260                depth,
9261            )?;
9262
9263            _prev_end_offset = cur_offset + envelope_size;
9264            if 2 > max_ordinal {
9265                return Ok(());
9266            }
9267
9268            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9269            // are envelope_size bytes.
9270            let cur_offset: usize = (2 - 1) * envelope_size;
9271
9272            // Zero reserved fields.
9273            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9274
9275            // Safety:
9276            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9277            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9278            //   envelope_size bytes, there is always sufficient room.
9279            fidl::encoding::encode_in_envelope_optional::<MajorPlayerType, D>(
9280                self.major_type
9281                    .as_ref()
9282                    .map(<MajorPlayerType as fidl::encoding::ValueTypeMarker>::borrow),
9283                encoder,
9284                offset + cur_offset,
9285                depth,
9286            )?;
9287
9288            _prev_end_offset = cur_offset + envelope_size;
9289            if 3 > max_ordinal {
9290                return Ok(());
9291            }
9292
9293            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9294            // are envelope_size bytes.
9295            let cur_offset: usize = (3 - 1) * envelope_size;
9296
9297            // Zero reserved fields.
9298            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9299
9300            // Safety:
9301            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9302            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9303            //   envelope_size bytes, there is always sufficient room.
9304            fidl::encoding::encode_in_envelope_optional::<PlayerSubType, D>(
9305                self.sub_type
9306                    .as_ref()
9307                    .map(<PlayerSubType as fidl::encoding::ValueTypeMarker>::borrow),
9308                encoder,
9309                offset + cur_offset,
9310                depth,
9311            )?;
9312
9313            _prev_end_offset = cur_offset + envelope_size;
9314            if 4 > max_ordinal {
9315                return Ok(());
9316            }
9317
9318            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9319            // are envelope_size bytes.
9320            let cur_offset: usize = (4 - 1) * envelope_size;
9321
9322            // Zero reserved fields.
9323            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9324
9325            // Safety:
9326            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9327            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9328            //   envelope_size bytes, there is always sufficient room.
9329            fidl::encoding::encode_in_envelope_optional::<PlaybackStatus, D>(
9330                self.playback_status
9331                    .as_ref()
9332                    .map(<PlaybackStatus as fidl::encoding::ValueTypeMarker>::borrow),
9333                encoder,
9334                offset + cur_offset,
9335                depth,
9336            )?;
9337
9338            _prev_end_offset = cur_offset + envelope_size;
9339            if 5 > max_ordinal {
9340                return Ok(());
9341            }
9342
9343            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9344            // are envelope_size bytes.
9345            let cur_offset: usize = (5 - 1) * envelope_size;
9346
9347            // Zero reserved fields.
9348            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9349
9350            // Safety:
9351            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9352            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9353            //   envelope_size bytes, there is always sufficient room.
9354            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
9355                self.displayable_name.as_ref().map(
9356                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
9357                ),
9358                encoder,
9359                offset + cur_offset,
9360                depth,
9361            )?;
9362
9363            _prev_end_offset = cur_offset + envelope_size;
9364            if 6 > max_ordinal {
9365                return Ok(());
9366            }
9367
9368            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9369            // are envelope_size bytes.
9370            let cur_offset: usize = (6 - 1) * envelope_size;
9371
9372            // Zero reserved fields.
9373            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9374
9375            // Safety:
9376            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9377            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9378            //   envelope_size bytes, there is always sufficient room.
9379            fidl::encoding::encode_in_envelope_optional::<PlayerFeatureBits, D>(
9380                self.feature_bits
9381                    .as_ref()
9382                    .map(<PlayerFeatureBits as fidl::encoding::ValueTypeMarker>::borrow),
9383                encoder,
9384                offset + cur_offset,
9385                depth,
9386            )?;
9387
9388            _prev_end_offset = cur_offset + envelope_size;
9389            if 7 > max_ordinal {
9390                return Ok(());
9391            }
9392
9393            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9394            // are envelope_size bytes.
9395            let cur_offset: usize = (7 - 1) * envelope_size;
9396
9397            // Zero reserved fields.
9398            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9399
9400            // Safety:
9401            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9402            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9403            //   envelope_size bytes, there is always sufficient room.
9404            fidl::encoding::encode_in_envelope_optional::<PlayerFeatureBitsExt, D>(
9405                self.feature_bits_ext
9406                    .as_ref()
9407                    .map(<PlayerFeatureBitsExt as fidl::encoding::ValueTypeMarker>::borrow),
9408                encoder,
9409                offset + cur_offset,
9410                depth,
9411            )?;
9412
9413            _prev_end_offset = cur_offset + envelope_size;
9414
9415            Ok(())
9416        }
9417    }
9418
9419    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MediaPlayerItem {
9420        #[inline(always)]
9421        fn new_empty() -> Self {
9422            Self::default()
9423        }
9424
9425        unsafe fn decode(
9426            &mut self,
9427            decoder: &mut fidl::encoding::Decoder<'_, D>,
9428            offset: usize,
9429            mut depth: fidl::encoding::Depth,
9430        ) -> fidl::Result<()> {
9431            decoder.debug_check_bounds::<Self>(offset);
9432            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9433                None => return Err(fidl::Error::NotNullable),
9434                Some(len) => len,
9435            };
9436            // Calling decoder.out_of_line_offset(0) is not allowed.
9437            if len == 0 {
9438                return Ok(());
9439            };
9440            depth.increment()?;
9441            let envelope_size = 8;
9442            let bytes_len = len * envelope_size;
9443            let offset = decoder.out_of_line_offset(bytes_len)?;
9444            // Decode the envelope for each type.
9445            let mut _next_ordinal_to_read = 0;
9446            let mut next_offset = offset;
9447            let end_offset = offset + bytes_len;
9448            _next_ordinal_to_read += 1;
9449            if next_offset >= end_offset {
9450                return Ok(());
9451            }
9452
9453            // Decode unknown envelopes for gaps in ordinals.
9454            while _next_ordinal_to_read < 1 {
9455                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9456                _next_ordinal_to_read += 1;
9457                next_offset += envelope_size;
9458            }
9459
9460            let next_out_of_line = decoder.next_out_of_line();
9461            let handles_before = decoder.remaining_handles();
9462            if let Some((inlined, num_bytes, num_handles)) =
9463                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9464            {
9465                let member_inline_size =
9466                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9467                if inlined != (member_inline_size <= 4) {
9468                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9469                }
9470                let inner_offset;
9471                let mut inner_depth = depth.clone();
9472                if inlined {
9473                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9474                    inner_offset = next_offset;
9475                } else {
9476                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9477                    inner_depth.increment()?;
9478                }
9479                let val_ref = self.player_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
9480                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
9481                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9482                {
9483                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9484                }
9485                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9486                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9487                }
9488            }
9489
9490            next_offset += envelope_size;
9491            _next_ordinal_to_read += 1;
9492            if next_offset >= end_offset {
9493                return Ok(());
9494            }
9495
9496            // Decode unknown envelopes for gaps in ordinals.
9497            while _next_ordinal_to_read < 2 {
9498                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9499                _next_ordinal_to_read += 1;
9500                next_offset += envelope_size;
9501            }
9502
9503            let next_out_of_line = decoder.next_out_of_line();
9504            let handles_before = decoder.remaining_handles();
9505            if let Some((inlined, num_bytes, num_handles)) =
9506                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9507            {
9508                let member_inline_size =
9509                    <MajorPlayerType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9510                if inlined != (member_inline_size <= 4) {
9511                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9512                }
9513                let inner_offset;
9514                let mut inner_depth = depth.clone();
9515                if inlined {
9516                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9517                    inner_offset = next_offset;
9518                } else {
9519                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9520                    inner_depth.increment()?;
9521                }
9522                let val_ref =
9523                    self.major_type.get_or_insert_with(|| fidl::new_empty!(MajorPlayerType, D));
9524                fidl::decode!(MajorPlayerType, D, val_ref, decoder, inner_offset, inner_depth)?;
9525                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9526                {
9527                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9528                }
9529                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9530                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9531                }
9532            }
9533
9534            next_offset += envelope_size;
9535            _next_ordinal_to_read += 1;
9536            if next_offset >= end_offset {
9537                return Ok(());
9538            }
9539
9540            // Decode unknown envelopes for gaps in ordinals.
9541            while _next_ordinal_to_read < 3 {
9542                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9543                _next_ordinal_to_read += 1;
9544                next_offset += envelope_size;
9545            }
9546
9547            let next_out_of_line = decoder.next_out_of_line();
9548            let handles_before = decoder.remaining_handles();
9549            if let Some((inlined, num_bytes, num_handles)) =
9550                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9551            {
9552                let member_inline_size =
9553                    <PlayerSubType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9554                if inlined != (member_inline_size <= 4) {
9555                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9556                }
9557                let inner_offset;
9558                let mut inner_depth = depth.clone();
9559                if inlined {
9560                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9561                    inner_offset = next_offset;
9562                } else {
9563                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9564                    inner_depth.increment()?;
9565                }
9566                let val_ref =
9567                    self.sub_type.get_or_insert_with(|| fidl::new_empty!(PlayerSubType, D));
9568                fidl::decode!(PlayerSubType, D, val_ref, decoder, inner_offset, inner_depth)?;
9569                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9570                {
9571                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9572                }
9573                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9574                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9575                }
9576            }
9577
9578            next_offset += envelope_size;
9579            _next_ordinal_to_read += 1;
9580            if next_offset >= end_offset {
9581                return Ok(());
9582            }
9583
9584            // Decode unknown envelopes for gaps in ordinals.
9585            while _next_ordinal_to_read < 4 {
9586                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9587                _next_ordinal_to_read += 1;
9588                next_offset += envelope_size;
9589            }
9590
9591            let next_out_of_line = decoder.next_out_of_line();
9592            let handles_before = decoder.remaining_handles();
9593            if let Some((inlined, num_bytes, num_handles)) =
9594                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9595            {
9596                let member_inline_size =
9597                    <PlaybackStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9598                if inlined != (member_inline_size <= 4) {
9599                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9600                }
9601                let inner_offset;
9602                let mut inner_depth = depth.clone();
9603                if inlined {
9604                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9605                    inner_offset = next_offset;
9606                } else {
9607                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9608                    inner_depth.increment()?;
9609                }
9610                let val_ref =
9611                    self.playback_status.get_or_insert_with(|| fidl::new_empty!(PlaybackStatus, D));
9612                fidl::decode!(PlaybackStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
9613                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9614                {
9615                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9616                }
9617                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9618                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9619                }
9620            }
9621
9622            next_offset += envelope_size;
9623            _next_ordinal_to_read += 1;
9624            if next_offset >= end_offset {
9625                return Ok(());
9626            }
9627
9628            // Decode unknown envelopes for gaps in ordinals.
9629            while _next_ordinal_to_read < 5 {
9630                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9631                _next_ordinal_to_read += 1;
9632                next_offset += envelope_size;
9633            }
9634
9635            let next_out_of_line = decoder.next_out_of_line();
9636            let handles_before = decoder.remaining_handles();
9637            if let Some((inlined, num_bytes, num_handles)) =
9638                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9639            {
9640                let member_inline_size =
9641                    <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
9642                        decoder.context,
9643                    );
9644                if inlined != (member_inline_size <= 4) {
9645                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9646                }
9647                let inner_offset;
9648                let mut inner_depth = depth.clone();
9649                if inlined {
9650                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9651                    inner_offset = next_offset;
9652                } else {
9653                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9654                    inner_depth.increment()?;
9655                }
9656                let val_ref = self
9657                    .displayable_name
9658                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
9659                fidl::decode!(
9660                    fidl::encoding::BoundedString<255>,
9661                    D,
9662                    val_ref,
9663                    decoder,
9664                    inner_offset,
9665                    inner_depth
9666                )?;
9667                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9668                {
9669                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9670                }
9671                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9672                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9673                }
9674            }
9675
9676            next_offset += envelope_size;
9677            _next_ordinal_to_read += 1;
9678            if next_offset >= end_offset {
9679                return Ok(());
9680            }
9681
9682            // Decode unknown envelopes for gaps in ordinals.
9683            while _next_ordinal_to_read < 6 {
9684                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9685                _next_ordinal_to_read += 1;
9686                next_offset += envelope_size;
9687            }
9688
9689            let next_out_of_line = decoder.next_out_of_line();
9690            let handles_before = decoder.remaining_handles();
9691            if let Some((inlined, num_bytes, num_handles)) =
9692                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9693            {
9694                let member_inline_size =
9695                    <PlayerFeatureBits as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9696                if inlined != (member_inline_size <= 4) {
9697                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9698                }
9699                let inner_offset;
9700                let mut inner_depth = depth.clone();
9701                if inlined {
9702                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9703                    inner_offset = next_offset;
9704                } else {
9705                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9706                    inner_depth.increment()?;
9707                }
9708                let val_ref =
9709                    self.feature_bits.get_or_insert_with(|| fidl::new_empty!(PlayerFeatureBits, D));
9710                fidl::decode!(PlayerFeatureBits, D, val_ref, decoder, inner_offset, inner_depth)?;
9711                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9712                {
9713                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9714                }
9715                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9716                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9717                }
9718            }
9719
9720            next_offset += envelope_size;
9721            _next_ordinal_to_read += 1;
9722            if next_offset >= end_offset {
9723                return Ok(());
9724            }
9725
9726            // Decode unknown envelopes for gaps in ordinals.
9727            while _next_ordinal_to_read < 7 {
9728                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9729                _next_ordinal_to_read += 1;
9730                next_offset += envelope_size;
9731            }
9732
9733            let next_out_of_line = decoder.next_out_of_line();
9734            let handles_before = decoder.remaining_handles();
9735            if let Some((inlined, num_bytes, num_handles)) =
9736                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9737            {
9738                let member_inline_size =
9739                    <PlayerFeatureBitsExt as fidl::encoding::TypeMarker>::inline_size(
9740                        decoder.context,
9741                    );
9742                if inlined != (member_inline_size <= 4) {
9743                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9744                }
9745                let inner_offset;
9746                let mut inner_depth = depth.clone();
9747                if inlined {
9748                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9749                    inner_offset = next_offset;
9750                } else {
9751                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9752                    inner_depth.increment()?;
9753                }
9754                let val_ref = self
9755                    .feature_bits_ext
9756                    .get_or_insert_with(|| fidl::new_empty!(PlayerFeatureBitsExt, D));
9757                fidl::decode!(
9758                    PlayerFeatureBitsExt,
9759                    D,
9760                    val_ref,
9761                    decoder,
9762                    inner_offset,
9763                    inner_depth
9764                )?;
9765                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9766                {
9767                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9768                }
9769                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9770                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9771                }
9772            }
9773
9774            next_offset += envelope_size;
9775
9776            // Decode the remaining unknown envelopes.
9777            while next_offset < end_offset {
9778                _next_ordinal_to_read += 1;
9779                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9780                next_offset += envelope_size;
9781            }
9782
9783            Ok(())
9784        }
9785    }
9786
9787    impl Notification {
9788        #[inline(always)]
9789        fn max_ordinal_present(&self) -> u64 {
9790            if let Some(_) = self.addressed_player {
9791                return 11;
9792            }
9793            if let Some(_) = self.available_players_changed {
9794                return 10;
9795            }
9796            if let Some(_) = self.device_connected {
9797                return 9;
9798            }
9799            if let Some(_) = self.volume {
9800                return 8;
9801            }
9802            if let Some(_) = self.player_id {
9803                return 7;
9804            }
9805            if let Some(_) = self.application_settings {
9806                return 6;
9807            }
9808            if let Some(_) = self.system_status {
9809                return 5;
9810            }
9811            if let Some(_) = self.battery_status {
9812                return 4;
9813            }
9814            if let Some(_) = self.pos {
9815                return 3;
9816            }
9817            if let Some(_) = self.track_id {
9818                return 2;
9819            }
9820            if let Some(_) = self.status {
9821                return 1;
9822            }
9823            0
9824        }
9825    }
9826
9827    impl fidl::encoding::ValueTypeMarker for Notification {
9828        type Borrowed<'a> = &'a Self;
9829        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9830            value
9831        }
9832    }
9833
9834    unsafe impl fidl::encoding::TypeMarker for Notification {
9835        type Owned = Self;
9836
9837        #[inline(always)]
9838        fn inline_align(_context: fidl::encoding::Context) -> usize {
9839            8
9840        }
9841
9842        #[inline(always)]
9843        fn inline_size(_context: fidl::encoding::Context) -> usize {
9844            16
9845        }
9846    }
9847
9848    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Notification, D>
9849        for &Notification
9850    {
9851        unsafe fn encode(
9852            self,
9853            encoder: &mut fidl::encoding::Encoder<'_, D>,
9854            offset: usize,
9855            mut depth: fidl::encoding::Depth,
9856        ) -> fidl::Result<()> {
9857            encoder.debug_check_bounds::<Notification>(offset);
9858            // Vector header
9859            let max_ordinal: u64 = self.max_ordinal_present();
9860            encoder.write_num(max_ordinal, offset);
9861            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9862            // Calling encoder.out_of_line_offset(0) is not allowed.
9863            if max_ordinal == 0 {
9864                return Ok(());
9865            }
9866            depth.increment()?;
9867            let envelope_size = 8;
9868            let bytes_len = max_ordinal as usize * envelope_size;
9869            #[allow(unused_variables)]
9870            let offset = encoder.out_of_line_offset(bytes_len);
9871            let mut _prev_end_offset: usize = 0;
9872            if 1 > max_ordinal {
9873                return Ok(());
9874            }
9875
9876            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9877            // are envelope_size bytes.
9878            let cur_offset: usize = (1 - 1) * envelope_size;
9879
9880            // Zero reserved fields.
9881            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9882
9883            // Safety:
9884            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9885            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9886            //   envelope_size bytes, there is always sufficient room.
9887            fidl::encoding::encode_in_envelope_optional::<PlaybackStatus, D>(
9888                self.status
9889                    .as_ref()
9890                    .map(<PlaybackStatus as fidl::encoding::ValueTypeMarker>::borrow),
9891                encoder,
9892                offset + cur_offset,
9893                depth,
9894            )?;
9895
9896            _prev_end_offset = cur_offset + envelope_size;
9897            if 2 > max_ordinal {
9898                return Ok(());
9899            }
9900
9901            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9902            // are envelope_size bytes.
9903            let cur_offset: usize = (2 - 1) * envelope_size;
9904
9905            // Zero reserved fields.
9906            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9907
9908            // Safety:
9909            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9910            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9911            //   envelope_size bytes, there is always sufficient room.
9912            fidl::encoding::encode_in_envelope_optional::<u64, D>(
9913                self.track_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9914                encoder,
9915                offset + cur_offset,
9916                depth,
9917            )?;
9918
9919            _prev_end_offset = cur_offset + envelope_size;
9920            if 3 > max_ordinal {
9921                return Ok(());
9922            }
9923
9924            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9925            // are envelope_size bytes.
9926            let cur_offset: usize = (3 - 1) * envelope_size;
9927
9928            // Zero reserved fields.
9929            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9930
9931            // Safety:
9932            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9933            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9934            //   envelope_size bytes, there is always sufficient room.
9935            fidl::encoding::encode_in_envelope_optional::<u32, D>(
9936                self.pos.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
9937                encoder,
9938                offset + cur_offset,
9939                depth,
9940            )?;
9941
9942            _prev_end_offset = cur_offset + envelope_size;
9943            if 4 > max_ordinal {
9944                return Ok(());
9945            }
9946
9947            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9948            // are envelope_size bytes.
9949            let cur_offset: usize = (4 - 1) * envelope_size;
9950
9951            // Zero reserved fields.
9952            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9953
9954            // Safety:
9955            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9956            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9957            //   envelope_size bytes, there is always sufficient room.
9958            fidl::encoding::encode_in_envelope_optional::<BatteryStatus, D>(
9959                self.battery_status
9960                    .as_ref()
9961                    .map(<BatteryStatus as fidl::encoding::ValueTypeMarker>::borrow),
9962                encoder,
9963                offset + cur_offset,
9964                depth,
9965            )?;
9966
9967            _prev_end_offset = cur_offset + envelope_size;
9968            if 5 > max_ordinal {
9969                return Ok(());
9970            }
9971
9972            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9973            // are envelope_size bytes.
9974            let cur_offset: usize = (5 - 1) * envelope_size;
9975
9976            // Zero reserved fields.
9977            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9978
9979            // Safety:
9980            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9981            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9982            //   envelope_size bytes, there is always sufficient room.
9983            fidl::encoding::encode_in_envelope_optional::<SystemStatus, D>(
9984                self.system_status
9985                    .as_ref()
9986                    .map(<SystemStatus as fidl::encoding::ValueTypeMarker>::borrow),
9987                encoder,
9988                offset + cur_offset,
9989                depth,
9990            )?;
9991
9992            _prev_end_offset = cur_offset + envelope_size;
9993            if 6 > max_ordinal {
9994                return Ok(());
9995            }
9996
9997            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9998            // are envelope_size bytes.
9999            let cur_offset: usize = (6 - 1) * envelope_size;
10000
10001            // Zero reserved fields.
10002            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10003
10004            // Safety:
10005            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10006            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10007            //   envelope_size bytes, there is always sufficient room.
10008            fidl::encoding::encode_in_envelope_optional::<PlayerApplicationSettings, D>(
10009                self.application_settings
10010                    .as_ref()
10011                    .map(<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow),
10012                encoder,
10013                offset + cur_offset,
10014                depth,
10015            )?;
10016
10017            _prev_end_offset = cur_offset + envelope_size;
10018            if 7 > max_ordinal {
10019                return Ok(());
10020            }
10021
10022            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10023            // are envelope_size bytes.
10024            let cur_offset: usize = (7 - 1) * envelope_size;
10025
10026            // Zero reserved fields.
10027            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10028
10029            // Safety:
10030            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10031            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10032            //   envelope_size bytes, there is always sufficient room.
10033            fidl::encoding::encode_in_envelope_optional::<u16, D>(
10034                self.player_id.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
10035                encoder,
10036                offset + cur_offset,
10037                depth,
10038            )?;
10039
10040            _prev_end_offset = cur_offset + envelope_size;
10041            if 8 > max_ordinal {
10042                return Ok(());
10043            }
10044
10045            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10046            // are envelope_size bytes.
10047            let cur_offset: usize = (8 - 1) * envelope_size;
10048
10049            // Zero reserved fields.
10050            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10051
10052            // Safety:
10053            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10054            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10055            //   envelope_size bytes, there is always sufficient room.
10056            fidl::encoding::encode_in_envelope_optional::<u8, D>(
10057                self.volume.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
10058                encoder,
10059                offset + cur_offset,
10060                depth,
10061            )?;
10062
10063            _prev_end_offset = cur_offset + envelope_size;
10064            if 9 > max_ordinal {
10065                return Ok(());
10066            }
10067
10068            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10069            // are envelope_size bytes.
10070            let cur_offset: usize = (9 - 1) * envelope_size;
10071
10072            // Zero reserved fields.
10073            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10074
10075            // Safety:
10076            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10077            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10078            //   envelope_size bytes, there is always sufficient room.
10079            fidl::encoding::encode_in_envelope_optional::<bool, D>(
10080                self.device_connected
10081                    .as_ref()
10082                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
10083                encoder,
10084                offset + cur_offset,
10085                depth,
10086            )?;
10087
10088            _prev_end_offset = cur_offset + envelope_size;
10089            if 10 > max_ordinal {
10090                return Ok(());
10091            }
10092
10093            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10094            // are envelope_size bytes.
10095            let cur_offset: usize = (10 - 1) * envelope_size;
10096
10097            // Zero reserved fields.
10098            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10099
10100            // Safety:
10101            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10102            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10103            //   envelope_size bytes, there is always sufficient room.
10104            fidl::encoding::encode_in_envelope_optional::<bool, D>(
10105                self.available_players_changed
10106                    .as_ref()
10107                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
10108                encoder,
10109                offset + cur_offset,
10110                depth,
10111            )?;
10112
10113            _prev_end_offset = cur_offset + envelope_size;
10114            if 11 > max_ordinal {
10115                return Ok(());
10116            }
10117
10118            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10119            // are envelope_size bytes.
10120            let cur_offset: usize = (11 - 1) * envelope_size;
10121
10122            // Zero reserved fields.
10123            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10124
10125            // Safety:
10126            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10127            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10128            //   envelope_size bytes, there is always sufficient room.
10129            fidl::encoding::encode_in_envelope_optional::<u16, D>(
10130                self.addressed_player
10131                    .as_ref()
10132                    .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
10133                encoder,
10134                offset + cur_offset,
10135                depth,
10136            )?;
10137
10138            _prev_end_offset = cur_offset + envelope_size;
10139
10140            Ok(())
10141        }
10142    }
10143
10144    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Notification {
10145        #[inline(always)]
10146        fn new_empty() -> Self {
10147            Self::default()
10148        }
10149
10150        unsafe fn decode(
10151            &mut self,
10152            decoder: &mut fidl::encoding::Decoder<'_, D>,
10153            offset: usize,
10154            mut depth: fidl::encoding::Depth,
10155        ) -> fidl::Result<()> {
10156            decoder.debug_check_bounds::<Self>(offset);
10157            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10158                None => return Err(fidl::Error::NotNullable),
10159                Some(len) => len,
10160            };
10161            // Calling decoder.out_of_line_offset(0) is not allowed.
10162            if len == 0 {
10163                return Ok(());
10164            };
10165            depth.increment()?;
10166            let envelope_size = 8;
10167            let bytes_len = len * envelope_size;
10168            let offset = decoder.out_of_line_offset(bytes_len)?;
10169            // Decode the envelope for each type.
10170            let mut _next_ordinal_to_read = 0;
10171            let mut next_offset = offset;
10172            let end_offset = offset + bytes_len;
10173            _next_ordinal_to_read += 1;
10174            if next_offset >= end_offset {
10175                return Ok(());
10176            }
10177
10178            // Decode unknown envelopes for gaps in ordinals.
10179            while _next_ordinal_to_read < 1 {
10180                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10181                _next_ordinal_to_read += 1;
10182                next_offset += envelope_size;
10183            }
10184
10185            let next_out_of_line = decoder.next_out_of_line();
10186            let handles_before = decoder.remaining_handles();
10187            if let Some((inlined, num_bytes, num_handles)) =
10188                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10189            {
10190                let member_inline_size =
10191                    <PlaybackStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10192                if inlined != (member_inline_size <= 4) {
10193                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10194                }
10195                let inner_offset;
10196                let mut inner_depth = depth.clone();
10197                if inlined {
10198                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10199                    inner_offset = next_offset;
10200                } else {
10201                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10202                    inner_depth.increment()?;
10203                }
10204                let val_ref =
10205                    self.status.get_or_insert_with(|| fidl::new_empty!(PlaybackStatus, D));
10206                fidl::decode!(PlaybackStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
10207                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10208                {
10209                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10210                }
10211                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10212                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10213                }
10214            }
10215
10216            next_offset += envelope_size;
10217            _next_ordinal_to_read += 1;
10218            if next_offset >= end_offset {
10219                return Ok(());
10220            }
10221
10222            // Decode unknown envelopes for gaps in ordinals.
10223            while _next_ordinal_to_read < 2 {
10224                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10225                _next_ordinal_to_read += 1;
10226                next_offset += envelope_size;
10227            }
10228
10229            let next_out_of_line = decoder.next_out_of_line();
10230            let handles_before = decoder.remaining_handles();
10231            if let Some((inlined, num_bytes, num_handles)) =
10232                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10233            {
10234                let member_inline_size =
10235                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10236                if inlined != (member_inline_size <= 4) {
10237                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10238                }
10239                let inner_offset;
10240                let mut inner_depth = depth.clone();
10241                if inlined {
10242                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10243                    inner_offset = next_offset;
10244                } else {
10245                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10246                    inner_depth.increment()?;
10247                }
10248                let val_ref = self.track_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
10249                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
10250                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10251                {
10252                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10253                }
10254                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10255                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10256                }
10257            }
10258
10259            next_offset += envelope_size;
10260            _next_ordinal_to_read += 1;
10261            if next_offset >= end_offset {
10262                return Ok(());
10263            }
10264
10265            // Decode unknown envelopes for gaps in ordinals.
10266            while _next_ordinal_to_read < 3 {
10267                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10268                _next_ordinal_to_read += 1;
10269                next_offset += envelope_size;
10270            }
10271
10272            let next_out_of_line = decoder.next_out_of_line();
10273            let handles_before = decoder.remaining_handles();
10274            if let Some((inlined, num_bytes, num_handles)) =
10275                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10276            {
10277                let member_inline_size =
10278                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10279                if inlined != (member_inline_size <= 4) {
10280                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10281                }
10282                let inner_offset;
10283                let mut inner_depth = depth.clone();
10284                if inlined {
10285                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10286                    inner_offset = next_offset;
10287                } else {
10288                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10289                    inner_depth.increment()?;
10290                }
10291                let val_ref = self.pos.get_or_insert_with(|| fidl::new_empty!(u32, D));
10292                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
10293                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10294                {
10295                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10296                }
10297                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10298                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10299                }
10300            }
10301
10302            next_offset += envelope_size;
10303            _next_ordinal_to_read += 1;
10304            if next_offset >= end_offset {
10305                return Ok(());
10306            }
10307
10308            // Decode unknown envelopes for gaps in ordinals.
10309            while _next_ordinal_to_read < 4 {
10310                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10311                _next_ordinal_to_read += 1;
10312                next_offset += envelope_size;
10313            }
10314
10315            let next_out_of_line = decoder.next_out_of_line();
10316            let handles_before = decoder.remaining_handles();
10317            if let Some((inlined, num_bytes, num_handles)) =
10318                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10319            {
10320                let member_inline_size =
10321                    <BatteryStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10322                if inlined != (member_inline_size <= 4) {
10323                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10324                }
10325                let inner_offset;
10326                let mut inner_depth = depth.clone();
10327                if inlined {
10328                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10329                    inner_offset = next_offset;
10330                } else {
10331                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10332                    inner_depth.increment()?;
10333                }
10334                let val_ref =
10335                    self.battery_status.get_or_insert_with(|| fidl::new_empty!(BatteryStatus, D));
10336                fidl::decode!(BatteryStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
10337                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10338                {
10339                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10340                }
10341                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10342                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10343                }
10344            }
10345
10346            next_offset += envelope_size;
10347            _next_ordinal_to_read += 1;
10348            if next_offset >= end_offset {
10349                return Ok(());
10350            }
10351
10352            // Decode unknown envelopes for gaps in ordinals.
10353            while _next_ordinal_to_read < 5 {
10354                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10355                _next_ordinal_to_read += 1;
10356                next_offset += envelope_size;
10357            }
10358
10359            let next_out_of_line = decoder.next_out_of_line();
10360            let handles_before = decoder.remaining_handles();
10361            if let Some((inlined, num_bytes, num_handles)) =
10362                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10363            {
10364                let member_inline_size =
10365                    <SystemStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10366                if inlined != (member_inline_size <= 4) {
10367                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10368                }
10369                let inner_offset;
10370                let mut inner_depth = depth.clone();
10371                if inlined {
10372                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10373                    inner_offset = next_offset;
10374                } else {
10375                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10376                    inner_depth.increment()?;
10377                }
10378                let val_ref =
10379                    self.system_status.get_or_insert_with(|| fidl::new_empty!(SystemStatus, D));
10380                fidl::decode!(SystemStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
10381                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10382                {
10383                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10384                }
10385                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10386                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10387                }
10388            }
10389
10390            next_offset += envelope_size;
10391            _next_ordinal_to_read += 1;
10392            if next_offset >= end_offset {
10393                return Ok(());
10394            }
10395
10396            // Decode unknown envelopes for gaps in ordinals.
10397            while _next_ordinal_to_read < 6 {
10398                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10399                _next_ordinal_to_read += 1;
10400                next_offset += envelope_size;
10401            }
10402
10403            let next_out_of_line = decoder.next_out_of_line();
10404            let handles_before = decoder.remaining_handles();
10405            if let Some((inlined, num_bytes, num_handles)) =
10406                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10407            {
10408                let member_inline_size =
10409                    <PlayerApplicationSettings as fidl::encoding::TypeMarker>::inline_size(
10410                        decoder.context,
10411                    );
10412                if inlined != (member_inline_size <= 4) {
10413                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10414                }
10415                let inner_offset;
10416                let mut inner_depth = depth.clone();
10417                if inlined {
10418                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10419                    inner_offset = next_offset;
10420                } else {
10421                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10422                    inner_depth.increment()?;
10423                }
10424                let val_ref = self
10425                    .application_settings
10426                    .get_or_insert_with(|| fidl::new_empty!(PlayerApplicationSettings, D));
10427                fidl::decode!(
10428                    PlayerApplicationSettings,
10429                    D,
10430                    val_ref,
10431                    decoder,
10432                    inner_offset,
10433                    inner_depth
10434                )?;
10435                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10436                {
10437                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10438                }
10439                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10440                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10441                }
10442            }
10443
10444            next_offset += envelope_size;
10445            _next_ordinal_to_read += 1;
10446            if next_offset >= end_offset {
10447                return Ok(());
10448            }
10449
10450            // Decode unknown envelopes for gaps in ordinals.
10451            while _next_ordinal_to_read < 7 {
10452                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10453                _next_ordinal_to_read += 1;
10454                next_offset += envelope_size;
10455            }
10456
10457            let next_out_of_line = decoder.next_out_of_line();
10458            let handles_before = decoder.remaining_handles();
10459            if let Some((inlined, num_bytes, num_handles)) =
10460                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10461            {
10462                let member_inline_size =
10463                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10464                if inlined != (member_inline_size <= 4) {
10465                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10466                }
10467                let inner_offset;
10468                let mut inner_depth = depth.clone();
10469                if inlined {
10470                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10471                    inner_offset = next_offset;
10472                } else {
10473                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10474                    inner_depth.increment()?;
10475                }
10476                let val_ref = self.player_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
10477                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
10478                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10479                {
10480                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10481                }
10482                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10483                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10484                }
10485            }
10486
10487            next_offset += envelope_size;
10488            _next_ordinal_to_read += 1;
10489            if next_offset >= end_offset {
10490                return Ok(());
10491            }
10492
10493            // Decode unknown envelopes for gaps in ordinals.
10494            while _next_ordinal_to_read < 8 {
10495                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10496                _next_ordinal_to_read += 1;
10497                next_offset += envelope_size;
10498            }
10499
10500            let next_out_of_line = decoder.next_out_of_line();
10501            let handles_before = decoder.remaining_handles();
10502            if let Some((inlined, num_bytes, num_handles)) =
10503                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10504            {
10505                let member_inline_size =
10506                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10507                if inlined != (member_inline_size <= 4) {
10508                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10509                }
10510                let inner_offset;
10511                let mut inner_depth = depth.clone();
10512                if inlined {
10513                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10514                    inner_offset = next_offset;
10515                } else {
10516                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10517                    inner_depth.increment()?;
10518                }
10519                let val_ref = self.volume.get_or_insert_with(|| fidl::new_empty!(u8, D));
10520                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
10521                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10522                {
10523                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10524                }
10525                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10526                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10527                }
10528            }
10529
10530            next_offset += envelope_size;
10531            _next_ordinal_to_read += 1;
10532            if next_offset >= end_offset {
10533                return Ok(());
10534            }
10535
10536            // Decode unknown envelopes for gaps in ordinals.
10537            while _next_ordinal_to_read < 9 {
10538                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10539                _next_ordinal_to_read += 1;
10540                next_offset += envelope_size;
10541            }
10542
10543            let next_out_of_line = decoder.next_out_of_line();
10544            let handles_before = decoder.remaining_handles();
10545            if let Some((inlined, num_bytes, num_handles)) =
10546                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10547            {
10548                let member_inline_size =
10549                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10550                if inlined != (member_inline_size <= 4) {
10551                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10552                }
10553                let inner_offset;
10554                let mut inner_depth = depth.clone();
10555                if inlined {
10556                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10557                    inner_offset = next_offset;
10558                } else {
10559                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10560                    inner_depth.increment()?;
10561                }
10562                let val_ref =
10563                    self.device_connected.get_or_insert_with(|| fidl::new_empty!(bool, D));
10564                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
10565                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10566                {
10567                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10568                }
10569                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10570                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10571                }
10572            }
10573
10574            next_offset += envelope_size;
10575            _next_ordinal_to_read += 1;
10576            if next_offset >= end_offset {
10577                return Ok(());
10578            }
10579
10580            // Decode unknown envelopes for gaps in ordinals.
10581            while _next_ordinal_to_read < 10 {
10582                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10583                _next_ordinal_to_read += 1;
10584                next_offset += envelope_size;
10585            }
10586
10587            let next_out_of_line = decoder.next_out_of_line();
10588            let handles_before = decoder.remaining_handles();
10589            if let Some((inlined, num_bytes, num_handles)) =
10590                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10591            {
10592                let member_inline_size =
10593                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10594                if inlined != (member_inline_size <= 4) {
10595                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10596                }
10597                let inner_offset;
10598                let mut inner_depth = depth.clone();
10599                if inlined {
10600                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10601                    inner_offset = next_offset;
10602                } else {
10603                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10604                    inner_depth.increment()?;
10605                }
10606                let val_ref =
10607                    self.available_players_changed.get_or_insert_with(|| fidl::new_empty!(bool, D));
10608                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
10609                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10610                {
10611                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10612                }
10613                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10614                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10615                }
10616            }
10617
10618            next_offset += envelope_size;
10619            _next_ordinal_to_read += 1;
10620            if next_offset >= end_offset {
10621                return Ok(());
10622            }
10623
10624            // Decode unknown envelopes for gaps in ordinals.
10625            while _next_ordinal_to_read < 11 {
10626                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10627                _next_ordinal_to_read += 1;
10628                next_offset += envelope_size;
10629            }
10630
10631            let next_out_of_line = decoder.next_out_of_line();
10632            let handles_before = decoder.remaining_handles();
10633            if let Some((inlined, num_bytes, num_handles)) =
10634                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10635            {
10636                let member_inline_size =
10637                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10638                if inlined != (member_inline_size <= 4) {
10639                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10640                }
10641                let inner_offset;
10642                let mut inner_depth = depth.clone();
10643                if inlined {
10644                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10645                    inner_offset = next_offset;
10646                } else {
10647                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10648                    inner_depth.increment()?;
10649                }
10650                let val_ref = self.addressed_player.get_or_insert_with(|| fidl::new_empty!(u16, D));
10651                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
10652                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10653                {
10654                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10655                }
10656                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10657                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10658                }
10659            }
10660
10661            next_offset += envelope_size;
10662
10663            // Decode the remaining unknown envelopes.
10664            while next_offset < end_offset {
10665                _next_ordinal_to_read += 1;
10666                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10667                next_offset += envelope_size;
10668            }
10669
10670            Ok(())
10671        }
10672    }
10673
10674    impl PlayStatus {
10675        #[inline(always)]
10676        fn max_ordinal_present(&self) -> u64 {
10677            if let Some(_) = self.playback_status {
10678                return 3;
10679            }
10680            if let Some(_) = self.song_position {
10681                return 2;
10682            }
10683            if let Some(_) = self.song_length {
10684                return 1;
10685            }
10686            0
10687        }
10688    }
10689
10690    impl fidl::encoding::ValueTypeMarker for PlayStatus {
10691        type Borrowed<'a> = &'a Self;
10692        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10693            value
10694        }
10695    }
10696
10697    unsafe impl fidl::encoding::TypeMarker for PlayStatus {
10698        type Owned = Self;
10699
10700        #[inline(always)]
10701        fn inline_align(_context: fidl::encoding::Context) -> usize {
10702            8
10703        }
10704
10705        #[inline(always)]
10706        fn inline_size(_context: fidl::encoding::Context) -> usize {
10707            16
10708        }
10709    }
10710
10711    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PlayStatus, D>
10712        for &PlayStatus
10713    {
10714        unsafe fn encode(
10715            self,
10716            encoder: &mut fidl::encoding::Encoder<'_, D>,
10717            offset: usize,
10718            mut depth: fidl::encoding::Depth,
10719        ) -> fidl::Result<()> {
10720            encoder.debug_check_bounds::<PlayStatus>(offset);
10721            // Vector header
10722            let max_ordinal: u64 = self.max_ordinal_present();
10723            encoder.write_num(max_ordinal, offset);
10724            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10725            // Calling encoder.out_of_line_offset(0) is not allowed.
10726            if max_ordinal == 0 {
10727                return Ok(());
10728            }
10729            depth.increment()?;
10730            let envelope_size = 8;
10731            let bytes_len = max_ordinal as usize * envelope_size;
10732            #[allow(unused_variables)]
10733            let offset = encoder.out_of_line_offset(bytes_len);
10734            let mut _prev_end_offset: usize = 0;
10735            if 1 > max_ordinal {
10736                return Ok(());
10737            }
10738
10739            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10740            // are envelope_size bytes.
10741            let cur_offset: usize = (1 - 1) * envelope_size;
10742
10743            // Zero reserved fields.
10744            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10745
10746            // Safety:
10747            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10748            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10749            //   envelope_size bytes, there is always sufficient room.
10750            fidl::encoding::encode_in_envelope_optional::<u32, D>(
10751                self.song_length.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
10752                encoder,
10753                offset + cur_offset,
10754                depth,
10755            )?;
10756
10757            _prev_end_offset = cur_offset + envelope_size;
10758            if 2 > max_ordinal {
10759                return Ok(());
10760            }
10761
10762            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10763            // are envelope_size bytes.
10764            let cur_offset: usize = (2 - 1) * envelope_size;
10765
10766            // Zero reserved fields.
10767            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10768
10769            // Safety:
10770            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10771            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10772            //   envelope_size bytes, there is always sufficient room.
10773            fidl::encoding::encode_in_envelope_optional::<u32, D>(
10774                self.song_position.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
10775                encoder,
10776                offset + cur_offset,
10777                depth,
10778            )?;
10779
10780            _prev_end_offset = cur_offset + envelope_size;
10781            if 3 > max_ordinal {
10782                return Ok(());
10783            }
10784
10785            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10786            // are envelope_size bytes.
10787            let cur_offset: usize = (3 - 1) * envelope_size;
10788
10789            // Zero reserved fields.
10790            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10791
10792            // Safety:
10793            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10794            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10795            //   envelope_size bytes, there is always sufficient room.
10796            fidl::encoding::encode_in_envelope_optional::<PlaybackStatus, D>(
10797                self.playback_status
10798                    .as_ref()
10799                    .map(<PlaybackStatus as fidl::encoding::ValueTypeMarker>::borrow),
10800                encoder,
10801                offset + cur_offset,
10802                depth,
10803            )?;
10804
10805            _prev_end_offset = cur_offset + envelope_size;
10806
10807            Ok(())
10808        }
10809    }
10810
10811    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PlayStatus {
10812        #[inline(always)]
10813        fn new_empty() -> Self {
10814            Self::default()
10815        }
10816
10817        unsafe fn decode(
10818            &mut self,
10819            decoder: &mut fidl::encoding::Decoder<'_, D>,
10820            offset: usize,
10821            mut depth: fidl::encoding::Depth,
10822        ) -> fidl::Result<()> {
10823            decoder.debug_check_bounds::<Self>(offset);
10824            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10825                None => return Err(fidl::Error::NotNullable),
10826                Some(len) => len,
10827            };
10828            // Calling decoder.out_of_line_offset(0) is not allowed.
10829            if len == 0 {
10830                return Ok(());
10831            };
10832            depth.increment()?;
10833            let envelope_size = 8;
10834            let bytes_len = len * envelope_size;
10835            let offset = decoder.out_of_line_offset(bytes_len)?;
10836            // Decode the envelope for each type.
10837            let mut _next_ordinal_to_read = 0;
10838            let mut next_offset = offset;
10839            let end_offset = offset + bytes_len;
10840            _next_ordinal_to_read += 1;
10841            if next_offset >= end_offset {
10842                return Ok(());
10843            }
10844
10845            // Decode unknown envelopes for gaps in ordinals.
10846            while _next_ordinal_to_read < 1 {
10847                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10848                _next_ordinal_to_read += 1;
10849                next_offset += envelope_size;
10850            }
10851
10852            let next_out_of_line = decoder.next_out_of_line();
10853            let handles_before = decoder.remaining_handles();
10854            if let Some((inlined, num_bytes, num_handles)) =
10855                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10856            {
10857                let member_inline_size =
10858                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10859                if inlined != (member_inline_size <= 4) {
10860                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10861                }
10862                let inner_offset;
10863                let mut inner_depth = depth.clone();
10864                if inlined {
10865                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10866                    inner_offset = next_offset;
10867                } else {
10868                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10869                    inner_depth.increment()?;
10870                }
10871                let val_ref = self.song_length.get_or_insert_with(|| fidl::new_empty!(u32, D));
10872                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
10873                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10874                {
10875                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10876                }
10877                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10878                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10879                }
10880            }
10881
10882            next_offset += envelope_size;
10883            _next_ordinal_to_read += 1;
10884            if next_offset >= end_offset {
10885                return Ok(());
10886            }
10887
10888            // Decode unknown envelopes for gaps in ordinals.
10889            while _next_ordinal_to_read < 2 {
10890                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10891                _next_ordinal_to_read += 1;
10892                next_offset += envelope_size;
10893            }
10894
10895            let next_out_of_line = decoder.next_out_of_line();
10896            let handles_before = decoder.remaining_handles();
10897            if let Some((inlined, num_bytes, num_handles)) =
10898                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10899            {
10900                let member_inline_size =
10901                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10902                if inlined != (member_inline_size <= 4) {
10903                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10904                }
10905                let inner_offset;
10906                let mut inner_depth = depth.clone();
10907                if inlined {
10908                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10909                    inner_offset = next_offset;
10910                } else {
10911                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10912                    inner_depth.increment()?;
10913                }
10914                let val_ref = self.song_position.get_or_insert_with(|| fidl::new_empty!(u32, D));
10915                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
10916                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10917                {
10918                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10919                }
10920                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10921                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10922                }
10923            }
10924
10925            next_offset += envelope_size;
10926            _next_ordinal_to_read += 1;
10927            if next_offset >= end_offset {
10928                return Ok(());
10929            }
10930
10931            // Decode unknown envelopes for gaps in ordinals.
10932            while _next_ordinal_to_read < 3 {
10933                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10934                _next_ordinal_to_read += 1;
10935                next_offset += envelope_size;
10936            }
10937
10938            let next_out_of_line = decoder.next_out_of_line();
10939            let handles_before = decoder.remaining_handles();
10940            if let Some((inlined, num_bytes, num_handles)) =
10941                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10942            {
10943                let member_inline_size =
10944                    <PlaybackStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10945                if inlined != (member_inline_size <= 4) {
10946                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10947                }
10948                let inner_offset;
10949                let mut inner_depth = depth.clone();
10950                if inlined {
10951                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10952                    inner_offset = next_offset;
10953                } else {
10954                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10955                    inner_depth.increment()?;
10956                }
10957                let val_ref =
10958                    self.playback_status.get_or_insert_with(|| fidl::new_empty!(PlaybackStatus, D));
10959                fidl::decode!(PlaybackStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
10960                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10961                {
10962                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10963                }
10964                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10965                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10966                }
10967            }
10968
10969            next_offset += envelope_size;
10970
10971            // Decode the remaining unknown envelopes.
10972            while next_offset < end_offset {
10973                _next_ordinal_to_read += 1;
10974                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10975                next_offset += envelope_size;
10976            }
10977
10978            Ok(())
10979        }
10980    }
10981
10982    impl PlayerApplicationSettings {
10983        #[inline(always)]
10984        fn max_ordinal_present(&self) -> u64 {
10985            if let Some(_) = self.custom_settings {
10986                return 5;
10987            }
10988            if let Some(_) = self.scan_mode {
10989                return 4;
10990            }
10991            if let Some(_) = self.shuffle_mode {
10992                return 3;
10993            }
10994            if let Some(_) = self.repeat_status_mode {
10995                return 2;
10996            }
10997            if let Some(_) = self.equalizer {
10998                return 1;
10999            }
11000            0
11001        }
11002    }
11003
11004    impl fidl::encoding::ValueTypeMarker for PlayerApplicationSettings {
11005        type Borrowed<'a> = &'a Self;
11006        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11007            value
11008        }
11009    }
11010
11011    unsafe impl fidl::encoding::TypeMarker for PlayerApplicationSettings {
11012        type Owned = Self;
11013
11014        #[inline(always)]
11015        fn inline_align(_context: fidl::encoding::Context) -> usize {
11016            8
11017        }
11018
11019        #[inline(always)]
11020        fn inline_size(_context: fidl::encoding::Context) -> usize {
11021            16
11022        }
11023    }
11024
11025    unsafe impl<D: fidl::encoding::ResourceDialect>
11026        fidl::encoding::Encode<PlayerApplicationSettings, D> for &PlayerApplicationSettings
11027    {
11028        unsafe fn encode(
11029            self,
11030            encoder: &mut fidl::encoding::Encoder<'_, D>,
11031            offset: usize,
11032            mut depth: fidl::encoding::Depth,
11033        ) -> fidl::Result<()> {
11034            encoder.debug_check_bounds::<PlayerApplicationSettings>(offset);
11035            // Vector header
11036            let max_ordinal: u64 = self.max_ordinal_present();
11037            encoder.write_num(max_ordinal, offset);
11038            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
11039            // Calling encoder.out_of_line_offset(0) is not allowed.
11040            if max_ordinal == 0 {
11041                return Ok(());
11042            }
11043            depth.increment()?;
11044            let envelope_size = 8;
11045            let bytes_len = max_ordinal as usize * envelope_size;
11046            #[allow(unused_variables)]
11047            let offset = encoder.out_of_line_offset(bytes_len);
11048            let mut _prev_end_offset: usize = 0;
11049            if 1 > max_ordinal {
11050                return Ok(());
11051            }
11052
11053            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11054            // are envelope_size bytes.
11055            let cur_offset: usize = (1 - 1) * envelope_size;
11056
11057            // Zero reserved fields.
11058            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11059
11060            // Safety:
11061            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11062            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11063            //   envelope_size bytes, there is always sufficient room.
11064            fidl::encoding::encode_in_envelope_optional::<Equalizer, D>(
11065                self.equalizer.as_ref().map(<Equalizer as fidl::encoding::ValueTypeMarker>::borrow),
11066                encoder,
11067                offset + cur_offset,
11068                depth,
11069            )?;
11070
11071            _prev_end_offset = cur_offset + envelope_size;
11072            if 2 > max_ordinal {
11073                return Ok(());
11074            }
11075
11076            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11077            // are envelope_size bytes.
11078            let cur_offset: usize = (2 - 1) * envelope_size;
11079
11080            // Zero reserved fields.
11081            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11082
11083            // Safety:
11084            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11085            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11086            //   envelope_size bytes, there is always sufficient room.
11087            fidl::encoding::encode_in_envelope_optional::<RepeatStatusMode, D>(
11088                self.repeat_status_mode
11089                    .as_ref()
11090                    .map(<RepeatStatusMode as fidl::encoding::ValueTypeMarker>::borrow),
11091                encoder,
11092                offset + cur_offset,
11093                depth,
11094            )?;
11095
11096            _prev_end_offset = cur_offset + envelope_size;
11097            if 3 > max_ordinal {
11098                return Ok(());
11099            }
11100
11101            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11102            // are envelope_size bytes.
11103            let cur_offset: usize = (3 - 1) * envelope_size;
11104
11105            // Zero reserved fields.
11106            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11107
11108            // Safety:
11109            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11110            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11111            //   envelope_size bytes, there is always sufficient room.
11112            fidl::encoding::encode_in_envelope_optional::<ShuffleMode, D>(
11113                self.shuffle_mode
11114                    .as_ref()
11115                    .map(<ShuffleMode as fidl::encoding::ValueTypeMarker>::borrow),
11116                encoder,
11117                offset + cur_offset,
11118                depth,
11119            )?;
11120
11121            _prev_end_offset = cur_offset + envelope_size;
11122            if 4 > max_ordinal {
11123                return Ok(());
11124            }
11125
11126            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11127            // are envelope_size bytes.
11128            let cur_offset: usize = (4 - 1) * envelope_size;
11129
11130            // Zero reserved fields.
11131            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11132
11133            // Safety:
11134            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11135            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11136            //   envelope_size bytes, there is always sufficient room.
11137            fidl::encoding::encode_in_envelope_optional::<ScanMode, D>(
11138                self.scan_mode.as_ref().map(<ScanMode as fidl::encoding::ValueTypeMarker>::borrow),
11139                encoder,
11140                offset + cur_offset,
11141                depth,
11142            )?;
11143
11144            _prev_end_offset = cur_offset + envelope_size;
11145            if 5 > max_ordinal {
11146                return Ok(());
11147            }
11148
11149            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11150            // are envelope_size bytes.
11151            let cur_offset: usize = (5 - 1) * envelope_size;
11152
11153            // Zero reserved fields.
11154            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11155
11156            // Safety:
11157            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11158            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11159            //   envelope_size bytes, there is always sufficient room.
11160            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<CustomPlayerApplicationSetting, 127>, D>(
11161            self.custom_settings.as_ref().map(<fidl::encoding::Vector<CustomPlayerApplicationSetting, 127> as fidl::encoding::ValueTypeMarker>::borrow),
11162            encoder, offset + cur_offset, depth
11163        )?;
11164
11165            _prev_end_offset = cur_offset + envelope_size;
11166
11167            Ok(())
11168        }
11169    }
11170
11171    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11172        for PlayerApplicationSettings
11173    {
11174        #[inline(always)]
11175        fn new_empty() -> Self {
11176            Self::default()
11177        }
11178
11179        unsafe fn decode(
11180            &mut self,
11181            decoder: &mut fidl::encoding::Decoder<'_, D>,
11182            offset: usize,
11183            mut depth: fidl::encoding::Depth,
11184        ) -> fidl::Result<()> {
11185            decoder.debug_check_bounds::<Self>(offset);
11186            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11187                None => return Err(fidl::Error::NotNullable),
11188                Some(len) => len,
11189            };
11190            // Calling decoder.out_of_line_offset(0) is not allowed.
11191            if len == 0 {
11192                return Ok(());
11193            };
11194            depth.increment()?;
11195            let envelope_size = 8;
11196            let bytes_len = len * envelope_size;
11197            let offset = decoder.out_of_line_offset(bytes_len)?;
11198            // Decode the envelope for each type.
11199            let mut _next_ordinal_to_read = 0;
11200            let mut next_offset = offset;
11201            let end_offset = offset + bytes_len;
11202            _next_ordinal_to_read += 1;
11203            if next_offset >= end_offset {
11204                return Ok(());
11205            }
11206
11207            // Decode unknown envelopes for gaps in ordinals.
11208            while _next_ordinal_to_read < 1 {
11209                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11210                _next_ordinal_to_read += 1;
11211                next_offset += envelope_size;
11212            }
11213
11214            let next_out_of_line = decoder.next_out_of_line();
11215            let handles_before = decoder.remaining_handles();
11216            if let Some((inlined, num_bytes, num_handles)) =
11217                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11218            {
11219                let member_inline_size =
11220                    <Equalizer as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11221                if inlined != (member_inline_size <= 4) {
11222                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11223                }
11224                let inner_offset;
11225                let mut inner_depth = depth.clone();
11226                if inlined {
11227                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11228                    inner_offset = next_offset;
11229                } else {
11230                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11231                    inner_depth.increment()?;
11232                }
11233                let val_ref = self.equalizer.get_or_insert_with(|| fidl::new_empty!(Equalizer, D));
11234                fidl::decode!(Equalizer, D, val_ref, decoder, inner_offset, inner_depth)?;
11235                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11236                {
11237                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11238                }
11239                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11240                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11241                }
11242            }
11243
11244            next_offset += envelope_size;
11245            _next_ordinal_to_read += 1;
11246            if next_offset >= end_offset {
11247                return Ok(());
11248            }
11249
11250            // Decode unknown envelopes for gaps in ordinals.
11251            while _next_ordinal_to_read < 2 {
11252                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11253                _next_ordinal_to_read += 1;
11254                next_offset += envelope_size;
11255            }
11256
11257            let next_out_of_line = decoder.next_out_of_line();
11258            let handles_before = decoder.remaining_handles();
11259            if let Some((inlined, num_bytes, num_handles)) =
11260                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11261            {
11262                let member_inline_size =
11263                    <RepeatStatusMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11264                if inlined != (member_inline_size <= 4) {
11265                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11266                }
11267                let inner_offset;
11268                let mut inner_depth = depth.clone();
11269                if inlined {
11270                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11271                    inner_offset = next_offset;
11272                } else {
11273                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11274                    inner_depth.increment()?;
11275                }
11276                let val_ref = self
11277                    .repeat_status_mode
11278                    .get_or_insert_with(|| fidl::new_empty!(RepeatStatusMode, D));
11279                fidl::decode!(RepeatStatusMode, D, val_ref, decoder, inner_offset, inner_depth)?;
11280                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11281                {
11282                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11283                }
11284                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11285                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11286                }
11287            }
11288
11289            next_offset += envelope_size;
11290            _next_ordinal_to_read += 1;
11291            if next_offset >= end_offset {
11292                return Ok(());
11293            }
11294
11295            // Decode unknown envelopes for gaps in ordinals.
11296            while _next_ordinal_to_read < 3 {
11297                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11298                _next_ordinal_to_read += 1;
11299                next_offset += envelope_size;
11300            }
11301
11302            let next_out_of_line = decoder.next_out_of_line();
11303            let handles_before = decoder.remaining_handles();
11304            if let Some((inlined, num_bytes, num_handles)) =
11305                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11306            {
11307                let member_inline_size =
11308                    <ShuffleMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11309                if inlined != (member_inline_size <= 4) {
11310                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11311                }
11312                let inner_offset;
11313                let mut inner_depth = depth.clone();
11314                if inlined {
11315                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11316                    inner_offset = next_offset;
11317                } else {
11318                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11319                    inner_depth.increment()?;
11320                }
11321                let val_ref =
11322                    self.shuffle_mode.get_or_insert_with(|| fidl::new_empty!(ShuffleMode, D));
11323                fidl::decode!(ShuffleMode, D, val_ref, decoder, inner_offset, inner_depth)?;
11324                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11325                {
11326                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11327                }
11328                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11329                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11330                }
11331            }
11332
11333            next_offset += envelope_size;
11334            _next_ordinal_to_read += 1;
11335            if next_offset >= end_offset {
11336                return Ok(());
11337            }
11338
11339            // Decode unknown envelopes for gaps in ordinals.
11340            while _next_ordinal_to_read < 4 {
11341                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11342                _next_ordinal_to_read += 1;
11343                next_offset += envelope_size;
11344            }
11345
11346            let next_out_of_line = decoder.next_out_of_line();
11347            let handles_before = decoder.remaining_handles();
11348            if let Some((inlined, num_bytes, num_handles)) =
11349                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11350            {
11351                let member_inline_size =
11352                    <ScanMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11353                if inlined != (member_inline_size <= 4) {
11354                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11355                }
11356                let inner_offset;
11357                let mut inner_depth = depth.clone();
11358                if inlined {
11359                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11360                    inner_offset = next_offset;
11361                } else {
11362                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11363                    inner_depth.increment()?;
11364                }
11365                let val_ref = self.scan_mode.get_or_insert_with(|| fidl::new_empty!(ScanMode, D));
11366                fidl::decode!(ScanMode, D, val_ref, decoder, inner_offset, inner_depth)?;
11367                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11368                {
11369                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11370                }
11371                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11372                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11373                }
11374            }
11375
11376            next_offset += envelope_size;
11377            _next_ordinal_to_read += 1;
11378            if next_offset >= end_offset {
11379                return Ok(());
11380            }
11381
11382            // Decode unknown envelopes for gaps in ordinals.
11383            while _next_ordinal_to_read < 5 {
11384                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11385                _next_ordinal_to_read += 1;
11386                next_offset += envelope_size;
11387            }
11388
11389            let next_out_of_line = decoder.next_out_of_line();
11390            let handles_before = decoder.remaining_handles();
11391            if let Some((inlined, num_bytes, num_handles)) =
11392                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11393            {
11394                let member_inline_size = <fidl::encoding::Vector<
11395                    CustomPlayerApplicationSetting,
11396                    127,
11397                > as fidl::encoding::TypeMarker>::inline_size(
11398                    decoder.context
11399                );
11400                if inlined != (member_inline_size <= 4) {
11401                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11402                }
11403                let inner_offset;
11404                let mut inner_depth = depth.clone();
11405                if inlined {
11406                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11407                    inner_offset = next_offset;
11408                } else {
11409                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11410                    inner_depth.increment()?;
11411                }
11412                let val_ref =
11413                self.custom_settings.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<CustomPlayerApplicationSetting, 127>, D));
11414                fidl::decode!(fidl::encoding::Vector<CustomPlayerApplicationSetting, 127>, D, val_ref, decoder, inner_offset, inner_depth)?;
11415                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11416                {
11417                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11418                }
11419                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11420                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11421                }
11422            }
11423
11424            next_offset += envelope_size;
11425
11426            // Decode the remaining unknown envelopes.
11427            while next_offset < end_offset {
11428                _next_ordinal_to_read += 1;
11429                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11430                next_offset += envelope_size;
11431            }
11432
11433            Ok(())
11434        }
11435    }
11436
11437    impl fidl::encoding::ValueTypeMarker for AttributeRequestOption {
11438        type Borrowed<'a> = &'a Self;
11439        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11440            value
11441        }
11442    }
11443
11444    unsafe impl fidl::encoding::TypeMarker for AttributeRequestOption {
11445        type Owned = Self;
11446
11447        #[inline(always)]
11448        fn inline_align(_context: fidl::encoding::Context) -> usize {
11449            8
11450        }
11451
11452        #[inline(always)]
11453        fn inline_size(_context: fidl::encoding::Context) -> usize {
11454            16
11455        }
11456    }
11457
11458    unsafe impl<D: fidl::encoding::ResourceDialect>
11459        fidl::encoding::Encode<AttributeRequestOption, D> for &AttributeRequestOption
11460    {
11461        #[inline]
11462        unsafe fn encode(
11463            self,
11464            encoder: &mut fidl::encoding::Encoder<'_, D>,
11465            offset: usize,
11466            _depth: fidl::encoding::Depth,
11467        ) -> fidl::Result<()> {
11468            encoder.debug_check_bounds::<AttributeRequestOption>(offset);
11469            encoder.write_num::<u64>(self.ordinal(), offset);
11470            match self {
11471            AttributeRequestOption::GetAll(ref val) => {
11472                fidl::encoding::encode_in_envelope::<bool, D>(
11473                    <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
11474                    encoder, offset + 8, _depth
11475                )
11476            }
11477            AttributeRequestOption::AttributeList(ref val) => {
11478                fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<MediaAttributeId, 8>, D>(
11479                    <fidl::encoding::Vector<MediaAttributeId, 8> as fidl::encoding::ValueTypeMarker>::borrow(val),
11480                    encoder, offset + 8, _depth
11481                )
11482            }
11483        }
11484        }
11485    }
11486
11487    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11488        for AttributeRequestOption
11489    {
11490        #[inline(always)]
11491        fn new_empty() -> Self {
11492            Self::GetAll(fidl::new_empty!(bool, D))
11493        }
11494
11495        #[inline]
11496        unsafe fn decode(
11497            &mut self,
11498            decoder: &mut fidl::encoding::Decoder<'_, D>,
11499            offset: usize,
11500            mut depth: fidl::encoding::Depth,
11501        ) -> fidl::Result<()> {
11502            decoder.debug_check_bounds::<Self>(offset);
11503            #[allow(unused_variables)]
11504            let next_out_of_line = decoder.next_out_of_line();
11505            let handles_before = decoder.remaining_handles();
11506            let (ordinal, inlined, num_bytes, num_handles) =
11507                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
11508
11509            let member_inline_size = match ordinal {
11510            1 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11511            2 => <fidl::encoding::Vector<MediaAttributeId, 8> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11512            _ => return Err(fidl::Error::UnknownUnionTag),
11513        };
11514
11515            if inlined != (member_inline_size <= 4) {
11516                return Err(fidl::Error::InvalidInlineBitInEnvelope);
11517            }
11518            let _inner_offset;
11519            if inlined {
11520                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
11521                _inner_offset = offset + 8;
11522            } else {
11523                depth.increment()?;
11524                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11525            }
11526            match ordinal {
11527                1 => {
11528                    #[allow(irrefutable_let_patterns)]
11529                    if let AttributeRequestOption::GetAll(_) = self {
11530                        // Do nothing, read the value into the object
11531                    } else {
11532                        // Initialize `self` to the right variant
11533                        *self = AttributeRequestOption::GetAll(fidl::new_empty!(bool, D));
11534                    }
11535                    #[allow(irrefutable_let_patterns)]
11536                    if let AttributeRequestOption::GetAll(ref mut val) = self {
11537                        fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
11538                    } else {
11539                        unreachable!()
11540                    }
11541                }
11542                2 => {
11543                    #[allow(irrefutable_let_patterns)]
11544                    if let AttributeRequestOption::AttributeList(_) = self {
11545                        // Do nothing, read the value into the object
11546                    } else {
11547                        // Initialize `self` to the right variant
11548                        *self = AttributeRequestOption::AttributeList(
11549                            fidl::new_empty!(fidl::encoding::Vector<MediaAttributeId, 8>, D),
11550                        );
11551                    }
11552                    #[allow(irrefutable_let_patterns)]
11553                    if let AttributeRequestOption::AttributeList(ref mut val) = self {
11554                        fidl::decode!(fidl::encoding::Vector<MediaAttributeId, 8>, D, val, decoder, _inner_offset, depth)?;
11555                    } else {
11556                        unreachable!()
11557                    }
11558                }
11559                ordinal => panic!("unexpected ordinal {:?}", ordinal),
11560            }
11561            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
11562                return Err(fidl::Error::InvalidNumBytesInEnvelope);
11563            }
11564            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11565                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11566            }
11567            Ok(())
11568        }
11569    }
11570
11571    impl fidl::encoding::ValueTypeMarker for FileSystemItem {
11572        type Borrowed<'a> = &'a Self;
11573        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11574            value
11575        }
11576    }
11577
11578    unsafe impl fidl::encoding::TypeMarker for FileSystemItem {
11579        type Owned = Self;
11580
11581        #[inline(always)]
11582        fn inline_align(_context: fidl::encoding::Context) -> usize {
11583            8
11584        }
11585
11586        #[inline(always)]
11587        fn inline_size(_context: fidl::encoding::Context) -> usize {
11588            16
11589        }
11590    }
11591
11592    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileSystemItem, D>
11593        for &FileSystemItem
11594    {
11595        #[inline]
11596        unsafe fn encode(
11597            self,
11598            encoder: &mut fidl::encoding::Encoder<'_, D>,
11599            offset: usize,
11600            _depth: fidl::encoding::Depth,
11601        ) -> fidl::Result<()> {
11602            encoder.debug_check_bounds::<FileSystemItem>(offset);
11603            encoder.write_num::<u64>(self.ordinal(), offset);
11604            match self {
11605                FileSystemItem::Folder(ref val) => {
11606                    fidl::encoding::encode_in_envelope::<FolderItem, D>(
11607                        <FolderItem as fidl::encoding::ValueTypeMarker>::borrow(val),
11608                        encoder,
11609                        offset + 8,
11610                        _depth,
11611                    )
11612                }
11613                FileSystemItem::MediaElement(ref val) => {
11614                    fidl::encoding::encode_in_envelope::<MediaElementItem, D>(
11615                        <MediaElementItem as fidl::encoding::ValueTypeMarker>::borrow(val),
11616                        encoder,
11617                        offset + 8,
11618                        _depth,
11619                    )
11620                }
11621            }
11622        }
11623    }
11624
11625    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileSystemItem {
11626        #[inline(always)]
11627        fn new_empty() -> Self {
11628            Self::Folder(fidl::new_empty!(FolderItem, D))
11629        }
11630
11631        #[inline]
11632        unsafe fn decode(
11633            &mut self,
11634            decoder: &mut fidl::encoding::Decoder<'_, D>,
11635            offset: usize,
11636            mut depth: fidl::encoding::Depth,
11637        ) -> fidl::Result<()> {
11638            decoder.debug_check_bounds::<Self>(offset);
11639            #[allow(unused_variables)]
11640            let next_out_of_line = decoder.next_out_of_line();
11641            let handles_before = decoder.remaining_handles();
11642            let (ordinal, inlined, num_bytes, num_handles) =
11643                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
11644
11645            let member_inline_size = match ordinal {
11646                1 => <FolderItem as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11647                2 => <MediaElementItem as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11648                _ => return Err(fidl::Error::UnknownUnionTag),
11649            };
11650
11651            if inlined != (member_inline_size <= 4) {
11652                return Err(fidl::Error::InvalidInlineBitInEnvelope);
11653            }
11654            let _inner_offset;
11655            if inlined {
11656                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
11657                _inner_offset = offset + 8;
11658            } else {
11659                depth.increment()?;
11660                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11661            }
11662            match ordinal {
11663                1 => {
11664                    #[allow(irrefutable_let_patterns)]
11665                    if let FileSystemItem::Folder(_) = self {
11666                        // Do nothing, read the value into the object
11667                    } else {
11668                        // Initialize `self` to the right variant
11669                        *self = FileSystemItem::Folder(fidl::new_empty!(FolderItem, D));
11670                    }
11671                    #[allow(irrefutable_let_patterns)]
11672                    if let FileSystemItem::Folder(ref mut val) = self {
11673                        fidl::decode!(FolderItem, D, val, decoder, _inner_offset, depth)?;
11674                    } else {
11675                        unreachable!()
11676                    }
11677                }
11678                2 => {
11679                    #[allow(irrefutable_let_patterns)]
11680                    if let FileSystemItem::MediaElement(_) = self {
11681                        // Do nothing, read the value into the object
11682                    } else {
11683                        // Initialize `self` to the right variant
11684                        *self = FileSystemItem::MediaElement(fidl::new_empty!(MediaElementItem, D));
11685                    }
11686                    #[allow(irrefutable_let_patterns)]
11687                    if let FileSystemItem::MediaElement(ref mut val) = self {
11688                        fidl::decode!(MediaElementItem, D, val, decoder, _inner_offset, depth)?;
11689                    } else {
11690                        unreachable!()
11691                    }
11692                }
11693                ordinal => panic!("unexpected ordinal {:?}", ordinal),
11694            }
11695            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
11696                return Err(fidl::Error::InvalidNumBytesInEnvelope);
11697            }
11698            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11699                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11700            }
11701            Ok(())
11702        }
11703    }
11704
11705    impl fidl::encoding::ValueTypeMarker for Path {
11706        type Borrowed<'a> = &'a Self;
11707        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11708            value
11709        }
11710    }
11711
11712    unsafe impl fidl::encoding::TypeMarker for Path {
11713        type Owned = Self;
11714
11715        #[inline(always)]
11716        fn inline_align(_context: fidl::encoding::Context) -> usize {
11717            8
11718        }
11719
11720        #[inline(always)]
11721        fn inline_size(_context: fidl::encoding::Context) -> usize {
11722            16
11723        }
11724    }
11725
11726    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Path, D> for &Path {
11727        #[inline]
11728        unsafe fn encode(
11729            self,
11730            encoder: &mut fidl::encoding::Encoder<'_, D>,
11731            offset: usize,
11732            _depth: fidl::encoding::Depth,
11733        ) -> fidl::Result<()> {
11734            encoder.debug_check_bounds::<Path>(offset);
11735            encoder.write_num::<u64>(self.ordinal(), offset);
11736            match self {
11737                Path::Parent(ref val) => fidl::encoding::encode_in_envelope::<Parent, D>(
11738                    <Parent as fidl::encoding::ValueTypeMarker>::borrow(val),
11739                    encoder,
11740                    offset + 8,
11741                    _depth,
11742                ),
11743                Path::ChildFolderUid(ref val) => fidl::encoding::encode_in_envelope::<u64, D>(
11744                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
11745                    encoder,
11746                    offset + 8,
11747                    _depth,
11748                ),
11749                Path::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
11750            }
11751        }
11752    }
11753
11754    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Path {
11755        #[inline(always)]
11756        fn new_empty() -> Self {
11757            Self::__SourceBreaking { unknown_ordinal: 0 }
11758        }
11759
11760        #[inline]
11761        unsafe fn decode(
11762            &mut self,
11763            decoder: &mut fidl::encoding::Decoder<'_, D>,
11764            offset: usize,
11765            mut depth: fidl::encoding::Depth,
11766        ) -> fidl::Result<()> {
11767            decoder.debug_check_bounds::<Self>(offset);
11768            #[allow(unused_variables)]
11769            let next_out_of_line = decoder.next_out_of_line();
11770            let handles_before = decoder.remaining_handles();
11771            let (ordinal, inlined, num_bytes, num_handles) =
11772                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
11773
11774            let member_inline_size = match ordinal {
11775                1 => <Parent as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11776                2 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11777                0 => return Err(fidl::Error::UnknownUnionTag),
11778                _ => num_bytes as usize,
11779            };
11780
11781            if inlined != (member_inline_size <= 4) {
11782                return Err(fidl::Error::InvalidInlineBitInEnvelope);
11783            }
11784            let _inner_offset;
11785            if inlined {
11786                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
11787                _inner_offset = offset + 8;
11788            } else {
11789                depth.increment()?;
11790                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11791            }
11792            match ordinal {
11793                1 => {
11794                    #[allow(irrefutable_let_patterns)]
11795                    if let Path::Parent(_) = self {
11796                        // Do nothing, read the value into the object
11797                    } else {
11798                        // Initialize `self` to the right variant
11799                        *self = Path::Parent(fidl::new_empty!(Parent, D));
11800                    }
11801                    #[allow(irrefutable_let_patterns)]
11802                    if let Path::Parent(ref mut val) = self {
11803                        fidl::decode!(Parent, D, val, decoder, _inner_offset, depth)?;
11804                    } else {
11805                        unreachable!()
11806                    }
11807                }
11808                2 => {
11809                    #[allow(irrefutable_let_patterns)]
11810                    if let Path::ChildFolderUid(_) = self {
11811                        // Do nothing, read the value into the object
11812                    } else {
11813                        // Initialize `self` to the right variant
11814                        *self = Path::ChildFolderUid(fidl::new_empty!(u64, D));
11815                    }
11816                    #[allow(irrefutable_let_patterns)]
11817                    if let Path::ChildFolderUid(ref mut val) = self {
11818                        fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
11819                    } else {
11820                        unreachable!()
11821                    }
11822                }
11823                #[allow(deprecated)]
11824                ordinal => {
11825                    for _ in 0..num_handles {
11826                        decoder.drop_next_handle()?;
11827                    }
11828                    *self = Path::__SourceBreaking { unknown_ordinal: ordinal };
11829                }
11830            }
11831            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
11832                return Err(fidl::Error::InvalidNumBytesInEnvelope);
11833            }
11834            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11835                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11836            }
11837            Ok(())
11838        }
11839    }
11840}