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