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<fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D>,
4559    > fidl::encoding::Encode<ControllerGetPlayerApplicationSettingsRequest, D> for (T0,)
4560    {
4561        #[inline]
4562        unsafe fn encode(
4563            self,
4564            encoder: &mut fidl::encoding::Encoder<'_, D>,
4565            offset: usize,
4566            depth: fidl::encoding::Depth,
4567        ) -> fidl::Result<()> {
4568            encoder.debug_check_bounds::<ControllerGetPlayerApplicationSettingsRequest>(offset);
4569            // Zero out padding regions. There's no need to apply masks
4570            // because the unmasked parts will be overwritten by fields.
4571            // Write the fields.
4572            self.0.encode(encoder, offset + 0, depth)?;
4573            Ok(())
4574        }
4575    }
4576
4577    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4578        for ControllerGetPlayerApplicationSettingsRequest
4579    {
4580        #[inline(always)]
4581        fn new_empty() -> Self {
4582            Self {
4583                attribute_ids: fidl::new_empty!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D),
4584            }
4585        }
4586
4587        #[inline]
4588        unsafe fn decode(
4589            &mut self,
4590            decoder: &mut fidl::encoding::Decoder<'_, D>,
4591            offset: usize,
4592            _depth: fidl::encoding::Depth,
4593        ) -> fidl::Result<()> {
4594            decoder.debug_check_bounds::<Self>(offset);
4595            // Verify that padding bytes are zero.
4596            fidl::decode!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D, &mut self.attribute_ids, decoder, offset + 0, _depth)?;
4597            Ok(())
4598        }
4599    }
4600
4601    impl fidl::encoding::ValueTypeMarker for ControllerInformBatteryStatusRequest {
4602        type Borrowed<'a> = &'a Self;
4603        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4604            value
4605        }
4606    }
4607
4608    unsafe impl fidl::encoding::TypeMarker for ControllerInformBatteryStatusRequest {
4609        type Owned = Self;
4610
4611        #[inline(always)]
4612        fn inline_align(_context: fidl::encoding::Context) -> usize {
4613            1
4614        }
4615
4616        #[inline(always)]
4617        fn inline_size(_context: fidl::encoding::Context) -> usize {
4618            1
4619        }
4620    }
4621
4622    unsafe impl<D: fidl::encoding::ResourceDialect>
4623        fidl::encoding::Encode<ControllerInformBatteryStatusRequest, D>
4624        for &ControllerInformBatteryStatusRequest
4625    {
4626        #[inline]
4627        unsafe fn encode(
4628            self,
4629            encoder: &mut fidl::encoding::Encoder<'_, D>,
4630            offset: usize,
4631            _depth: fidl::encoding::Depth,
4632        ) -> fidl::Result<()> {
4633            encoder.debug_check_bounds::<ControllerInformBatteryStatusRequest>(offset);
4634            // Delegate to tuple encoding.
4635            fidl::encoding::Encode::<ControllerInformBatteryStatusRequest, D>::encode(
4636                (<BatteryStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.battery_status),),
4637                encoder,
4638                offset,
4639                _depth,
4640            )
4641        }
4642    }
4643    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<BatteryStatus, D>>
4644        fidl::encoding::Encode<ControllerInformBatteryStatusRequest, D> for (T0,)
4645    {
4646        #[inline]
4647        unsafe fn encode(
4648            self,
4649            encoder: &mut fidl::encoding::Encoder<'_, D>,
4650            offset: usize,
4651            depth: fidl::encoding::Depth,
4652        ) -> fidl::Result<()> {
4653            encoder.debug_check_bounds::<ControllerInformBatteryStatusRequest>(offset);
4654            // Zero out padding regions. There's no need to apply masks
4655            // because the unmasked parts will be overwritten by fields.
4656            // Write the fields.
4657            self.0.encode(encoder, offset + 0, depth)?;
4658            Ok(())
4659        }
4660    }
4661
4662    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4663        for ControllerInformBatteryStatusRequest
4664    {
4665        #[inline(always)]
4666        fn new_empty() -> Self {
4667            Self { battery_status: fidl::new_empty!(BatteryStatus, D) }
4668        }
4669
4670        #[inline]
4671        unsafe fn decode(
4672            &mut self,
4673            decoder: &mut fidl::encoding::Decoder<'_, D>,
4674            offset: usize,
4675            _depth: fidl::encoding::Depth,
4676        ) -> fidl::Result<()> {
4677            decoder.debug_check_bounds::<Self>(offset);
4678            // Verify that padding bytes are zero.
4679            fidl::decode!(BatteryStatus, D, &mut self.battery_status, decoder, offset + 0, _depth)?;
4680            Ok(())
4681        }
4682    }
4683
4684    impl fidl::encoding::ValueTypeMarker for ControllerOnNotificationRequest {
4685        type Borrowed<'a> = &'a Self;
4686        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4687            value
4688        }
4689    }
4690
4691    unsafe impl fidl::encoding::TypeMarker for ControllerOnNotificationRequest {
4692        type Owned = Self;
4693
4694        #[inline(always)]
4695        fn inline_align(_context: fidl::encoding::Context) -> usize {
4696            8
4697        }
4698
4699        #[inline(always)]
4700        fn inline_size(_context: fidl::encoding::Context) -> usize {
4701            24
4702        }
4703    }
4704
4705    unsafe impl<D: fidl::encoding::ResourceDialect>
4706        fidl::encoding::Encode<ControllerOnNotificationRequest, D>
4707        for &ControllerOnNotificationRequest
4708    {
4709        #[inline]
4710        unsafe fn encode(
4711            self,
4712            encoder: &mut fidl::encoding::Encoder<'_, D>,
4713            offset: usize,
4714            _depth: fidl::encoding::Depth,
4715        ) -> fidl::Result<()> {
4716            encoder.debug_check_bounds::<ControllerOnNotificationRequest>(offset);
4717            // Delegate to tuple encoding.
4718            fidl::encoding::Encode::<ControllerOnNotificationRequest, D>::encode(
4719                (
4720                    <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp),
4721                    <Notification as fidl::encoding::ValueTypeMarker>::borrow(&self.notification),
4722                ),
4723                encoder,
4724                offset,
4725                _depth,
4726            )
4727        }
4728    }
4729    unsafe impl<
4730        D: fidl::encoding::ResourceDialect,
4731        T0: fidl::encoding::Encode<i64, D>,
4732        T1: fidl::encoding::Encode<Notification, D>,
4733    > fidl::encoding::Encode<ControllerOnNotificationRequest, D> for (T0, T1)
4734    {
4735        #[inline]
4736        unsafe fn encode(
4737            self,
4738            encoder: &mut fidl::encoding::Encoder<'_, D>,
4739            offset: usize,
4740            depth: fidl::encoding::Depth,
4741        ) -> fidl::Result<()> {
4742            encoder.debug_check_bounds::<ControllerOnNotificationRequest>(offset);
4743            // Zero out padding regions. There's no need to apply masks
4744            // because the unmasked parts will be overwritten by fields.
4745            // Write the fields.
4746            self.0.encode(encoder, offset + 0, depth)?;
4747            self.1.encode(encoder, offset + 8, depth)?;
4748            Ok(())
4749        }
4750    }
4751
4752    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4753        for ControllerOnNotificationRequest
4754    {
4755        #[inline(always)]
4756        fn new_empty() -> Self {
4757            Self {
4758                timestamp: fidl::new_empty!(i64, D),
4759                notification: fidl::new_empty!(Notification, D),
4760            }
4761        }
4762
4763        #[inline]
4764        unsafe fn decode(
4765            &mut self,
4766            decoder: &mut fidl::encoding::Decoder<'_, D>,
4767            offset: usize,
4768            _depth: fidl::encoding::Depth,
4769        ) -> fidl::Result<()> {
4770            decoder.debug_check_bounds::<Self>(offset);
4771            // Verify that padding bytes are zero.
4772            fidl::decode!(i64, D, &mut self.timestamp, decoder, offset + 0, _depth)?;
4773            fidl::decode!(Notification, D, &mut self.notification, decoder, offset + 8, _depth)?;
4774            Ok(())
4775        }
4776    }
4777
4778    impl fidl::encoding::ValueTypeMarker for ControllerSendCommandRequest {
4779        type Borrowed<'a> = &'a Self;
4780        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4781            value
4782        }
4783    }
4784
4785    unsafe impl fidl::encoding::TypeMarker for ControllerSendCommandRequest {
4786        type Owned = Self;
4787
4788        #[inline(always)]
4789        fn inline_align(_context: fidl::encoding::Context) -> usize {
4790            1
4791        }
4792
4793        #[inline(always)]
4794        fn inline_size(_context: fidl::encoding::Context) -> usize {
4795            1
4796        }
4797    }
4798
4799    unsafe impl<D: fidl::encoding::ResourceDialect>
4800        fidl::encoding::Encode<ControllerSendCommandRequest, D> for &ControllerSendCommandRequest
4801    {
4802        #[inline]
4803        unsafe fn encode(
4804            self,
4805            encoder: &mut fidl::encoding::Encoder<'_, D>,
4806            offset: usize,
4807            _depth: fidl::encoding::Depth,
4808        ) -> fidl::Result<()> {
4809            encoder.debug_check_bounds::<ControllerSendCommandRequest>(offset);
4810            // Delegate to tuple encoding.
4811            fidl::encoding::Encode::<ControllerSendCommandRequest, D>::encode(
4812                (<AvcPanelCommand as fidl::encoding::ValueTypeMarker>::borrow(&self.command),),
4813                encoder,
4814                offset,
4815                _depth,
4816            )
4817        }
4818    }
4819    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AvcPanelCommand, D>>
4820        fidl::encoding::Encode<ControllerSendCommandRequest, D> for (T0,)
4821    {
4822        #[inline]
4823        unsafe fn encode(
4824            self,
4825            encoder: &mut fidl::encoding::Encoder<'_, D>,
4826            offset: usize,
4827            depth: fidl::encoding::Depth,
4828        ) -> fidl::Result<()> {
4829            encoder.debug_check_bounds::<ControllerSendCommandRequest>(offset);
4830            // Zero out padding regions. There's no need to apply masks
4831            // because the unmasked parts will be overwritten by fields.
4832            // Write the fields.
4833            self.0.encode(encoder, offset + 0, depth)?;
4834            Ok(())
4835        }
4836    }
4837
4838    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4839        for ControllerSendCommandRequest
4840    {
4841        #[inline(always)]
4842        fn new_empty() -> Self {
4843            Self { command: fidl::new_empty!(AvcPanelCommand, D) }
4844        }
4845
4846        #[inline]
4847        unsafe fn decode(
4848            &mut self,
4849            decoder: &mut fidl::encoding::Decoder<'_, D>,
4850            offset: usize,
4851            _depth: fidl::encoding::Depth,
4852        ) -> fidl::Result<()> {
4853            decoder.debug_check_bounds::<Self>(offset);
4854            // Verify that padding bytes are zero.
4855            fidl::decode!(AvcPanelCommand, D, &mut self.command, decoder, offset + 0, _depth)?;
4856            Ok(())
4857        }
4858    }
4859
4860    impl fidl::encoding::ValueTypeMarker for ControllerSetAbsoluteVolumeRequest {
4861        type Borrowed<'a> = &'a Self;
4862        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4863            value
4864        }
4865    }
4866
4867    unsafe impl fidl::encoding::TypeMarker for ControllerSetAbsoluteVolumeRequest {
4868        type Owned = Self;
4869
4870        #[inline(always)]
4871        fn inline_align(_context: fidl::encoding::Context) -> usize {
4872            1
4873        }
4874
4875        #[inline(always)]
4876        fn inline_size(_context: fidl::encoding::Context) -> usize {
4877            1
4878        }
4879        #[inline(always)]
4880        fn encode_is_copy() -> bool {
4881            true
4882        }
4883
4884        #[inline(always)]
4885        fn decode_is_copy() -> bool {
4886            true
4887        }
4888    }
4889
4890    unsafe impl<D: fidl::encoding::ResourceDialect>
4891        fidl::encoding::Encode<ControllerSetAbsoluteVolumeRequest, D>
4892        for &ControllerSetAbsoluteVolumeRequest
4893    {
4894        #[inline]
4895        unsafe fn encode(
4896            self,
4897            encoder: &mut fidl::encoding::Encoder<'_, D>,
4898            offset: usize,
4899            _depth: fidl::encoding::Depth,
4900        ) -> fidl::Result<()> {
4901            encoder.debug_check_bounds::<ControllerSetAbsoluteVolumeRequest>(offset);
4902            unsafe {
4903                // Copy the object into the buffer.
4904                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
4905                (buf_ptr as *mut ControllerSetAbsoluteVolumeRequest)
4906                    .write_unaligned((self as *const ControllerSetAbsoluteVolumeRequest).read());
4907                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
4908                // done second because the memcpy will write garbage to these bytes.
4909            }
4910            Ok(())
4911        }
4912    }
4913    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
4914        fidl::encoding::Encode<ControllerSetAbsoluteVolumeRequest, D> for (T0,)
4915    {
4916        #[inline]
4917        unsafe fn encode(
4918            self,
4919            encoder: &mut fidl::encoding::Encoder<'_, D>,
4920            offset: usize,
4921            depth: fidl::encoding::Depth,
4922        ) -> fidl::Result<()> {
4923            encoder.debug_check_bounds::<ControllerSetAbsoluteVolumeRequest>(offset);
4924            // Zero out padding regions. There's no need to apply masks
4925            // because the unmasked parts will be overwritten by fields.
4926            // Write the fields.
4927            self.0.encode(encoder, offset + 0, depth)?;
4928            Ok(())
4929        }
4930    }
4931
4932    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
4933        for ControllerSetAbsoluteVolumeRequest
4934    {
4935        #[inline(always)]
4936        fn new_empty() -> Self {
4937            Self { requested_volume: fidl::new_empty!(u8, D) }
4938        }
4939
4940        #[inline]
4941        unsafe fn decode(
4942            &mut self,
4943            decoder: &mut fidl::encoding::Decoder<'_, D>,
4944            offset: usize,
4945            _depth: fidl::encoding::Depth,
4946        ) -> fidl::Result<()> {
4947            decoder.debug_check_bounds::<Self>(offset);
4948            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
4949            // Verify that padding bytes are zero.
4950            // Copy from the buffer into the object.
4951            unsafe {
4952                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
4953            }
4954            Ok(())
4955        }
4956    }
4957
4958    impl fidl::encoding::ValueTypeMarker for ControllerSetAddressedPlayerRequest {
4959        type Borrowed<'a> = &'a Self;
4960        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4961            value
4962        }
4963    }
4964
4965    unsafe impl fidl::encoding::TypeMarker for ControllerSetAddressedPlayerRequest {
4966        type Owned = Self;
4967
4968        #[inline(always)]
4969        fn inline_align(_context: fidl::encoding::Context) -> usize {
4970            2
4971        }
4972
4973        #[inline(always)]
4974        fn inline_size(_context: fidl::encoding::Context) -> usize {
4975            2
4976        }
4977        #[inline(always)]
4978        fn encode_is_copy() -> bool {
4979            true
4980        }
4981
4982        #[inline(always)]
4983        fn decode_is_copy() -> bool {
4984            true
4985        }
4986    }
4987
4988    unsafe impl<D: fidl::encoding::ResourceDialect>
4989        fidl::encoding::Encode<ControllerSetAddressedPlayerRequest, D>
4990        for &ControllerSetAddressedPlayerRequest
4991    {
4992        #[inline]
4993        unsafe fn encode(
4994            self,
4995            encoder: &mut fidl::encoding::Encoder<'_, D>,
4996            offset: usize,
4997            _depth: fidl::encoding::Depth,
4998        ) -> fidl::Result<()> {
4999            encoder.debug_check_bounds::<ControllerSetAddressedPlayerRequest>(offset);
5000            unsafe {
5001                // Copy the object into the buffer.
5002                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5003                (buf_ptr as *mut ControllerSetAddressedPlayerRequest)
5004                    .write_unaligned((self as *const ControllerSetAddressedPlayerRequest).read());
5005                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5006                // done second because the memcpy will write garbage to these bytes.
5007            }
5008            Ok(())
5009        }
5010    }
5011    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
5012        fidl::encoding::Encode<ControllerSetAddressedPlayerRequest, D> for (T0,)
5013    {
5014        #[inline]
5015        unsafe fn encode(
5016            self,
5017            encoder: &mut fidl::encoding::Encoder<'_, D>,
5018            offset: usize,
5019            depth: fidl::encoding::Depth,
5020        ) -> fidl::Result<()> {
5021            encoder.debug_check_bounds::<ControllerSetAddressedPlayerRequest>(offset);
5022            // Zero out padding regions. There's no need to apply masks
5023            // because the unmasked parts will be overwritten by fields.
5024            // Write the fields.
5025            self.0.encode(encoder, offset + 0, depth)?;
5026            Ok(())
5027        }
5028    }
5029
5030    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5031        for ControllerSetAddressedPlayerRequest
5032    {
5033        #[inline(always)]
5034        fn new_empty() -> Self {
5035            Self { player_id: fidl::new_empty!(u16, D) }
5036        }
5037
5038        #[inline]
5039        unsafe fn decode(
5040            &mut self,
5041            decoder: &mut fidl::encoding::Decoder<'_, D>,
5042            offset: usize,
5043            _depth: fidl::encoding::Depth,
5044        ) -> fidl::Result<()> {
5045            decoder.debug_check_bounds::<Self>(offset);
5046            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5047            // Verify that padding bytes are zero.
5048            // Copy from the buffer into the object.
5049            unsafe {
5050                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
5051            }
5052            Ok(())
5053        }
5054    }
5055
5056    impl fidl::encoding::ValueTypeMarker for ControllerSetNotificationFilterRequest {
5057        type Borrowed<'a> = &'a Self;
5058        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5059            value
5060        }
5061    }
5062
5063    unsafe impl fidl::encoding::TypeMarker for ControllerSetNotificationFilterRequest {
5064        type Owned = Self;
5065
5066        #[inline(always)]
5067        fn inline_align(_context: fidl::encoding::Context) -> usize {
5068            4
5069        }
5070
5071        #[inline(always)]
5072        fn inline_size(_context: fidl::encoding::Context) -> usize {
5073            8
5074        }
5075    }
5076
5077    unsafe impl<D: fidl::encoding::ResourceDialect>
5078        fidl::encoding::Encode<ControllerSetNotificationFilterRequest, D>
5079        for &ControllerSetNotificationFilterRequest
5080    {
5081        #[inline]
5082        unsafe fn encode(
5083            self,
5084            encoder: &mut fidl::encoding::Encoder<'_, D>,
5085            offset: usize,
5086            _depth: fidl::encoding::Depth,
5087        ) -> fidl::Result<()> {
5088            encoder.debug_check_bounds::<ControllerSetNotificationFilterRequest>(offset);
5089            // Delegate to tuple encoding.
5090            fidl::encoding::Encode::<ControllerSetNotificationFilterRequest, D>::encode(
5091                (
5092                    <Notifications as fidl::encoding::ValueTypeMarker>::borrow(&self.notifications),
5093                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(
5094                        &self.position_change_interval,
5095                    ),
5096                ),
5097                encoder,
5098                offset,
5099                _depth,
5100            )
5101        }
5102    }
5103    unsafe impl<
5104        D: fidl::encoding::ResourceDialect,
5105        T0: fidl::encoding::Encode<Notifications, D>,
5106        T1: fidl::encoding::Encode<u32, D>,
5107    > fidl::encoding::Encode<ControllerSetNotificationFilterRequest, D> for (T0, T1)
5108    {
5109        #[inline]
5110        unsafe fn encode(
5111            self,
5112            encoder: &mut fidl::encoding::Encoder<'_, D>,
5113            offset: usize,
5114            depth: fidl::encoding::Depth,
5115        ) -> fidl::Result<()> {
5116            encoder.debug_check_bounds::<ControllerSetNotificationFilterRequest>(offset);
5117            // Zero out padding regions. There's no need to apply masks
5118            // because the unmasked parts will be overwritten by fields.
5119            // Write the fields.
5120            self.0.encode(encoder, offset + 0, depth)?;
5121            self.1.encode(encoder, offset + 4, depth)?;
5122            Ok(())
5123        }
5124    }
5125
5126    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5127        for ControllerSetNotificationFilterRequest
5128    {
5129        #[inline(always)]
5130        fn new_empty() -> Self {
5131            Self {
5132                notifications: fidl::new_empty!(Notifications, D),
5133                position_change_interval: fidl::new_empty!(u32, D),
5134            }
5135        }
5136
5137        #[inline]
5138        unsafe fn decode(
5139            &mut self,
5140            decoder: &mut fidl::encoding::Decoder<'_, D>,
5141            offset: usize,
5142            _depth: fidl::encoding::Depth,
5143        ) -> fidl::Result<()> {
5144            decoder.debug_check_bounds::<Self>(offset);
5145            // Verify that padding bytes are zero.
5146            fidl::decode!(Notifications, D, &mut self.notifications, decoder, offset + 0, _depth)?;
5147            fidl::decode!(u32, D, &mut self.position_change_interval, decoder, offset + 4, _depth)?;
5148            Ok(())
5149        }
5150    }
5151
5152    impl fidl::encoding::ValueTypeMarker for ControllerSetPlayerApplicationSettingsRequest {
5153        type Borrowed<'a> = &'a Self;
5154        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5155            value
5156        }
5157    }
5158
5159    unsafe impl fidl::encoding::TypeMarker for ControllerSetPlayerApplicationSettingsRequest {
5160        type Owned = Self;
5161
5162        #[inline(always)]
5163        fn inline_align(_context: fidl::encoding::Context) -> usize {
5164            8
5165        }
5166
5167        #[inline(always)]
5168        fn inline_size(_context: fidl::encoding::Context) -> usize {
5169            16
5170        }
5171    }
5172
5173    unsafe impl<D: fidl::encoding::ResourceDialect>
5174        fidl::encoding::Encode<ControllerSetPlayerApplicationSettingsRequest, D>
5175        for &ControllerSetPlayerApplicationSettingsRequest
5176    {
5177        #[inline]
5178        unsafe fn encode(
5179            self,
5180            encoder: &mut fidl::encoding::Encoder<'_, D>,
5181            offset: usize,
5182            _depth: fidl::encoding::Depth,
5183        ) -> fidl::Result<()> {
5184            encoder.debug_check_bounds::<ControllerSetPlayerApplicationSettingsRequest>(offset);
5185            // Delegate to tuple encoding.
5186            fidl::encoding::Encode::<ControllerSetPlayerApplicationSettingsRequest, D>::encode(
5187                (<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
5188                    &self.requested_settings,
5189                ),),
5190                encoder,
5191                offset,
5192                _depth,
5193            )
5194        }
5195    }
5196    unsafe impl<
5197        D: fidl::encoding::ResourceDialect,
5198        T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
5199    > fidl::encoding::Encode<ControllerSetPlayerApplicationSettingsRequest, D> for (T0,)
5200    {
5201        #[inline]
5202        unsafe fn encode(
5203            self,
5204            encoder: &mut fidl::encoding::Encoder<'_, D>,
5205            offset: usize,
5206            depth: fidl::encoding::Depth,
5207        ) -> fidl::Result<()> {
5208            encoder.debug_check_bounds::<ControllerSetPlayerApplicationSettingsRequest>(offset);
5209            // Zero out padding regions. There's no need to apply masks
5210            // because the unmasked parts will be overwritten by fields.
5211            // Write the fields.
5212            self.0.encode(encoder, offset + 0, depth)?;
5213            Ok(())
5214        }
5215    }
5216
5217    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5218        for ControllerSetPlayerApplicationSettingsRequest
5219    {
5220        #[inline(always)]
5221        fn new_empty() -> Self {
5222            Self { requested_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
5223        }
5224
5225        #[inline]
5226        unsafe fn decode(
5227            &mut self,
5228            decoder: &mut fidl::encoding::Decoder<'_, D>,
5229            offset: usize,
5230            _depth: fidl::encoding::Depth,
5231        ) -> fidl::Result<()> {
5232            decoder.debug_check_bounds::<Self>(offset);
5233            // Verify that padding bytes are zero.
5234            fidl::decode!(
5235                PlayerApplicationSettings,
5236                D,
5237                &mut self.requested_settings,
5238                decoder,
5239                offset + 0,
5240                _depth
5241            )?;
5242            Ok(())
5243        }
5244    }
5245
5246    impl fidl::encoding::ValueTypeMarker for ControllerGetMediaAttributesResponse {
5247        type Borrowed<'a> = &'a Self;
5248        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5249            value
5250        }
5251    }
5252
5253    unsafe impl fidl::encoding::TypeMarker for ControllerGetMediaAttributesResponse {
5254        type Owned = Self;
5255
5256        #[inline(always)]
5257        fn inline_align(_context: fidl::encoding::Context) -> usize {
5258            8
5259        }
5260
5261        #[inline(always)]
5262        fn inline_size(_context: fidl::encoding::Context) -> usize {
5263            16
5264        }
5265    }
5266
5267    unsafe impl<D: fidl::encoding::ResourceDialect>
5268        fidl::encoding::Encode<ControllerGetMediaAttributesResponse, D>
5269        for &ControllerGetMediaAttributesResponse
5270    {
5271        #[inline]
5272        unsafe fn encode(
5273            self,
5274            encoder: &mut fidl::encoding::Encoder<'_, D>,
5275            offset: usize,
5276            _depth: fidl::encoding::Depth,
5277        ) -> fidl::Result<()> {
5278            encoder.debug_check_bounds::<ControllerGetMediaAttributesResponse>(offset);
5279            // Delegate to tuple encoding.
5280            fidl::encoding::Encode::<ControllerGetMediaAttributesResponse, D>::encode(
5281                (<MediaAttributes as fidl::encoding::ValueTypeMarker>::borrow(&self.attributes),),
5282                encoder,
5283                offset,
5284                _depth,
5285            )
5286        }
5287    }
5288    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<MediaAttributes, D>>
5289        fidl::encoding::Encode<ControllerGetMediaAttributesResponse, D> for (T0,)
5290    {
5291        #[inline]
5292        unsafe fn encode(
5293            self,
5294            encoder: &mut fidl::encoding::Encoder<'_, D>,
5295            offset: usize,
5296            depth: fidl::encoding::Depth,
5297        ) -> fidl::Result<()> {
5298            encoder.debug_check_bounds::<ControllerGetMediaAttributesResponse>(offset);
5299            // Zero out padding regions. There's no need to apply masks
5300            // because the unmasked parts will be overwritten by fields.
5301            // Write the fields.
5302            self.0.encode(encoder, offset + 0, depth)?;
5303            Ok(())
5304        }
5305    }
5306
5307    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5308        for ControllerGetMediaAttributesResponse
5309    {
5310        #[inline(always)]
5311        fn new_empty() -> Self {
5312            Self { attributes: fidl::new_empty!(MediaAttributes, D) }
5313        }
5314
5315        #[inline]
5316        unsafe fn decode(
5317            &mut self,
5318            decoder: &mut fidl::encoding::Decoder<'_, D>,
5319            offset: usize,
5320            _depth: fidl::encoding::Depth,
5321        ) -> fidl::Result<()> {
5322            decoder.debug_check_bounds::<Self>(offset);
5323            // Verify that padding bytes are zero.
5324            fidl::decode!(MediaAttributes, D, &mut self.attributes, decoder, offset + 0, _depth)?;
5325            Ok(())
5326        }
5327    }
5328
5329    impl fidl::encoding::ValueTypeMarker for ControllerGetPlayStatusResponse {
5330        type Borrowed<'a> = &'a Self;
5331        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5332            value
5333        }
5334    }
5335
5336    unsafe impl fidl::encoding::TypeMarker for ControllerGetPlayStatusResponse {
5337        type Owned = Self;
5338
5339        #[inline(always)]
5340        fn inline_align(_context: fidl::encoding::Context) -> usize {
5341            8
5342        }
5343
5344        #[inline(always)]
5345        fn inline_size(_context: fidl::encoding::Context) -> usize {
5346            16
5347        }
5348    }
5349
5350    unsafe impl<D: fidl::encoding::ResourceDialect>
5351        fidl::encoding::Encode<ControllerGetPlayStatusResponse, D>
5352        for &ControllerGetPlayStatusResponse
5353    {
5354        #[inline]
5355        unsafe fn encode(
5356            self,
5357            encoder: &mut fidl::encoding::Encoder<'_, D>,
5358            offset: usize,
5359            _depth: fidl::encoding::Depth,
5360        ) -> fidl::Result<()> {
5361            encoder.debug_check_bounds::<ControllerGetPlayStatusResponse>(offset);
5362            // Delegate to tuple encoding.
5363            fidl::encoding::Encode::<ControllerGetPlayStatusResponse, D>::encode(
5364                (<PlayStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.play_status),),
5365                encoder,
5366                offset,
5367                _depth,
5368            )
5369        }
5370    }
5371    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PlayStatus, D>>
5372        fidl::encoding::Encode<ControllerGetPlayStatusResponse, D> for (T0,)
5373    {
5374        #[inline]
5375        unsafe fn encode(
5376            self,
5377            encoder: &mut fidl::encoding::Encoder<'_, D>,
5378            offset: usize,
5379            depth: fidl::encoding::Depth,
5380        ) -> fidl::Result<()> {
5381            encoder.debug_check_bounds::<ControllerGetPlayStatusResponse>(offset);
5382            // Zero out padding regions. There's no need to apply masks
5383            // because the unmasked parts will be overwritten by fields.
5384            // Write the fields.
5385            self.0.encode(encoder, offset + 0, depth)?;
5386            Ok(())
5387        }
5388    }
5389
5390    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5391        for ControllerGetPlayStatusResponse
5392    {
5393        #[inline(always)]
5394        fn new_empty() -> Self {
5395            Self { play_status: fidl::new_empty!(PlayStatus, D) }
5396        }
5397
5398        #[inline]
5399        unsafe fn decode(
5400            &mut self,
5401            decoder: &mut fidl::encoding::Decoder<'_, D>,
5402            offset: usize,
5403            _depth: fidl::encoding::Depth,
5404        ) -> fidl::Result<()> {
5405            decoder.debug_check_bounds::<Self>(offset);
5406            // Verify that padding bytes are zero.
5407            fidl::decode!(PlayStatus, D, &mut self.play_status, decoder, offset + 0, _depth)?;
5408            Ok(())
5409        }
5410    }
5411
5412    impl fidl::encoding::ValueTypeMarker for ControllerGetPlayerApplicationSettingsResponse {
5413        type Borrowed<'a> = &'a Self;
5414        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5415            value
5416        }
5417    }
5418
5419    unsafe impl fidl::encoding::TypeMarker for ControllerGetPlayerApplicationSettingsResponse {
5420        type Owned = Self;
5421
5422        #[inline(always)]
5423        fn inline_align(_context: fidl::encoding::Context) -> usize {
5424            8
5425        }
5426
5427        #[inline(always)]
5428        fn inline_size(_context: fidl::encoding::Context) -> usize {
5429            16
5430        }
5431    }
5432
5433    unsafe impl<D: fidl::encoding::ResourceDialect>
5434        fidl::encoding::Encode<ControllerGetPlayerApplicationSettingsResponse, D>
5435        for &ControllerGetPlayerApplicationSettingsResponse
5436    {
5437        #[inline]
5438        unsafe fn encode(
5439            self,
5440            encoder: &mut fidl::encoding::Encoder<'_, D>,
5441            offset: usize,
5442            _depth: fidl::encoding::Depth,
5443        ) -> fidl::Result<()> {
5444            encoder.debug_check_bounds::<ControllerGetPlayerApplicationSettingsResponse>(offset);
5445            // Delegate to tuple encoding.
5446            fidl::encoding::Encode::<ControllerGetPlayerApplicationSettingsResponse, D>::encode(
5447                (<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
5448                    &self.current_settings,
5449                ),),
5450                encoder,
5451                offset,
5452                _depth,
5453            )
5454        }
5455    }
5456    unsafe impl<
5457        D: fidl::encoding::ResourceDialect,
5458        T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
5459    > fidl::encoding::Encode<ControllerGetPlayerApplicationSettingsResponse, D> for (T0,)
5460    {
5461        #[inline]
5462        unsafe fn encode(
5463            self,
5464            encoder: &mut fidl::encoding::Encoder<'_, D>,
5465            offset: usize,
5466            depth: fidl::encoding::Depth,
5467        ) -> fidl::Result<()> {
5468            encoder.debug_check_bounds::<ControllerGetPlayerApplicationSettingsResponse>(offset);
5469            // Zero out padding regions. There's no need to apply masks
5470            // because the unmasked parts will be overwritten by fields.
5471            // Write the fields.
5472            self.0.encode(encoder, offset + 0, depth)?;
5473            Ok(())
5474        }
5475    }
5476
5477    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5478        for ControllerGetPlayerApplicationSettingsResponse
5479    {
5480        #[inline(always)]
5481        fn new_empty() -> Self {
5482            Self { current_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
5483        }
5484
5485        #[inline]
5486        unsafe fn decode(
5487            &mut self,
5488            decoder: &mut fidl::encoding::Decoder<'_, D>,
5489            offset: usize,
5490            _depth: fidl::encoding::Depth,
5491        ) -> fidl::Result<()> {
5492            decoder.debug_check_bounds::<Self>(offset);
5493            // Verify that padding bytes are zero.
5494            fidl::decode!(
5495                PlayerApplicationSettings,
5496                D,
5497                &mut self.current_settings,
5498                decoder,
5499                offset + 0,
5500                _depth
5501            )?;
5502            Ok(())
5503        }
5504    }
5505
5506    impl fidl::encoding::ValueTypeMarker for ControllerSetAbsoluteVolumeResponse {
5507        type Borrowed<'a> = &'a Self;
5508        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5509            value
5510        }
5511    }
5512
5513    unsafe impl fidl::encoding::TypeMarker for ControllerSetAbsoluteVolumeResponse {
5514        type Owned = Self;
5515
5516        #[inline(always)]
5517        fn inline_align(_context: fidl::encoding::Context) -> usize {
5518            1
5519        }
5520
5521        #[inline(always)]
5522        fn inline_size(_context: fidl::encoding::Context) -> usize {
5523            1
5524        }
5525        #[inline(always)]
5526        fn encode_is_copy() -> bool {
5527            true
5528        }
5529
5530        #[inline(always)]
5531        fn decode_is_copy() -> bool {
5532            true
5533        }
5534    }
5535
5536    unsafe impl<D: fidl::encoding::ResourceDialect>
5537        fidl::encoding::Encode<ControllerSetAbsoluteVolumeResponse, D>
5538        for &ControllerSetAbsoluteVolumeResponse
5539    {
5540        #[inline]
5541        unsafe fn encode(
5542            self,
5543            encoder: &mut fidl::encoding::Encoder<'_, D>,
5544            offset: usize,
5545            _depth: fidl::encoding::Depth,
5546        ) -> fidl::Result<()> {
5547            encoder.debug_check_bounds::<ControllerSetAbsoluteVolumeResponse>(offset);
5548            unsafe {
5549                // Copy the object into the buffer.
5550                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
5551                (buf_ptr as *mut ControllerSetAbsoluteVolumeResponse)
5552                    .write_unaligned((self as *const ControllerSetAbsoluteVolumeResponse).read());
5553                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
5554                // done second because the memcpy will write garbage to these bytes.
5555            }
5556            Ok(())
5557        }
5558    }
5559    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
5560        fidl::encoding::Encode<ControllerSetAbsoluteVolumeResponse, D> for (T0,)
5561    {
5562        #[inline]
5563        unsafe fn encode(
5564            self,
5565            encoder: &mut fidl::encoding::Encoder<'_, D>,
5566            offset: usize,
5567            depth: fidl::encoding::Depth,
5568        ) -> fidl::Result<()> {
5569            encoder.debug_check_bounds::<ControllerSetAbsoluteVolumeResponse>(offset);
5570            // Zero out padding regions. There's no need to apply masks
5571            // because the unmasked parts will be overwritten by fields.
5572            // Write the fields.
5573            self.0.encode(encoder, offset + 0, depth)?;
5574            Ok(())
5575        }
5576    }
5577
5578    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5579        for ControllerSetAbsoluteVolumeResponse
5580    {
5581        #[inline(always)]
5582        fn new_empty() -> Self {
5583            Self { set_volume: fidl::new_empty!(u8, D) }
5584        }
5585
5586        #[inline]
5587        unsafe fn decode(
5588            &mut self,
5589            decoder: &mut fidl::encoding::Decoder<'_, D>,
5590            offset: usize,
5591            _depth: fidl::encoding::Depth,
5592        ) -> fidl::Result<()> {
5593            decoder.debug_check_bounds::<Self>(offset);
5594            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
5595            // Verify that padding bytes are zero.
5596            // Copy from the buffer into the object.
5597            unsafe {
5598                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
5599            }
5600            Ok(())
5601        }
5602    }
5603
5604    impl fidl::encoding::ValueTypeMarker for ControllerSetPlayerApplicationSettingsResponse {
5605        type Borrowed<'a> = &'a Self;
5606        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5607            value
5608        }
5609    }
5610
5611    unsafe impl fidl::encoding::TypeMarker for ControllerSetPlayerApplicationSettingsResponse {
5612        type Owned = Self;
5613
5614        #[inline(always)]
5615        fn inline_align(_context: fidl::encoding::Context) -> usize {
5616            8
5617        }
5618
5619        #[inline(always)]
5620        fn inline_size(_context: fidl::encoding::Context) -> usize {
5621            16
5622        }
5623    }
5624
5625    unsafe impl<D: fidl::encoding::ResourceDialect>
5626        fidl::encoding::Encode<ControllerSetPlayerApplicationSettingsResponse, D>
5627        for &ControllerSetPlayerApplicationSettingsResponse
5628    {
5629        #[inline]
5630        unsafe fn encode(
5631            self,
5632            encoder: &mut fidl::encoding::Encoder<'_, D>,
5633            offset: usize,
5634            _depth: fidl::encoding::Depth,
5635        ) -> fidl::Result<()> {
5636            encoder.debug_check_bounds::<ControllerSetPlayerApplicationSettingsResponse>(offset);
5637            // Delegate to tuple encoding.
5638            fidl::encoding::Encode::<ControllerSetPlayerApplicationSettingsResponse, D>::encode(
5639                (<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
5640                    &self.set_settings,
5641                ),),
5642                encoder,
5643                offset,
5644                _depth,
5645            )
5646        }
5647    }
5648    unsafe impl<
5649        D: fidl::encoding::ResourceDialect,
5650        T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
5651    > fidl::encoding::Encode<ControllerSetPlayerApplicationSettingsResponse, D> for (T0,)
5652    {
5653        #[inline]
5654        unsafe fn encode(
5655            self,
5656            encoder: &mut fidl::encoding::Encoder<'_, D>,
5657            offset: usize,
5658            depth: fidl::encoding::Depth,
5659        ) -> fidl::Result<()> {
5660            encoder.debug_check_bounds::<ControllerSetPlayerApplicationSettingsResponse>(offset);
5661            // Zero out padding regions. There's no need to apply masks
5662            // because the unmasked parts will be overwritten by fields.
5663            // Write the fields.
5664            self.0.encode(encoder, offset + 0, depth)?;
5665            Ok(())
5666        }
5667    }
5668
5669    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5670        for ControllerSetPlayerApplicationSettingsResponse
5671    {
5672        #[inline(always)]
5673        fn new_empty() -> Self {
5674            Self { set_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
5675        }
5676
5677        #[inline]
5678        unsafe fn decode(
5679            &mut self,
5680            decoder: &mut fidl::encoding::Decoder<'_, D>,
5681            offset: usize,
5682            _depth: fidl::encoding::Depth,
5683        ) -> fidl::Result<()> {
5684            decoder.debug_check_bounds::<Self>(offset);
5685            // Verify that padding bytes are zero.
5686            fidl::decode!(
5687                PlayerApplicationSettings,
5688                D,
5689                &mut self.set_settings,
5690                decoder,
5691                offset + 0,
5692                _depth
5693            )?;
5694            Ok(())
5695        }
5696    }
5697
5698    impl fidl::encoding::ValueTypeMarker for CustomAttributeValue {
5699        type Borrowed<'a> = &'a Self;
5700        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5701            value
5702        }
5703    }
5704
5705    unsafe impl fidl::encoding::TypeMarker for CustomAttributeValue {
5706        type Owned = Self;
5707
5708        #[inline(always)]
5709        fn inline_align(_context: fidl::encoding::Context) -> usize {
5710            8
5711        }
5712
5713        #[inline(always)]
5714        fn inline_size(_context: fidl::encoding::Context) -> usize {
5715            24
5716        }
5717    }
5718
5719    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CustomAttributeValue, D>
5720        for &CustomAttributeValue
5721    {
5722        #[inline]
5723        unsafe fn encode(
5724            self,
5725            encoder: &mut fidl::encoding::Encoder<'_, D>,
5726            offset: usize,
5727            _depth: fidl::encoding::Depth,
5728        ) -> fidl::Result<()> {
5729            encoder.debug_check_bounds::<CustomAttributeValue>(offset);
5730            // Delegate to tuple encoding.
5731            fidl::encoding::Encode::<CustomAttributeValue, D>::encode(
5732                (
5733                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
5734                        &self.description,
5735                    ),
5736                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
5737                ),
5738                encoder,
5739                offset,
5740                _depth,
5741            )
5742        }
5743    }
5744    unsafe impl<
5745        D: fidl::encoding::ResourceDialect,
5746        T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
5747        T1: fidl::encoding::Encode<u8, D>,
5748    > fidl::encoding::Encode<CustomAttributeValue, D> for (T0, T1)
5749    {
5750        #[inline]
5751        unsafe fn encode(
5752            self,
5753            encoder: &mut fidl::encoding::Encoder<'_, D>,
5754            offset: usize,
5755            depth: fidl::encoding::Depth,
5756        ) -> fidl::Result<()> {
5757            encoder.debug_check_bounds::<CustomAttributeValue>(offset);
5758            // Zero out padding regions. There's no need to apply masks
5759            // because the unmasked parts will be overwritten by fields.
5760            unsafe {
5761                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
5762                (ptr as *mut u64).write_unaligned(0);
5763            }
5764            // Write the fields.
5765            self.0.encode(encoder, offset + 0, depth)?;
5766            self.1.encode(encoder, offset + 16, depth)?;
5767            Ok(())
5768        }
5769    }
5770
5771    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CustomAttributeValue {
5772        #[inline(always)]
5773        fn new_empty() -> Self {
5774            Self {
5775                description: fidl::new_empty!(fidl::encoding::BoundedString<255>, D),
5776                value: fidl::new_empty!(u8, D),
5777            }
5778        }
5779
5780        #[inline]
5781        unsafe fn decode(
5782            &mut self,
5783            decoder: &mut fidl::encoding::Decoder<'_, D>,
5784            offset: usize,
5785            _depth: fidl::encoding::Depth,
5786        ) -> fidl::Result<()> {
5787            decoder.debug_check_bounds::<Self>(offset);
5788            // Verify that padding bytes are zero.
5789            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
5790            let padval = unsafe { (ptr as *const u64).read_unaligned() };
5791            let mask = 0xffffffffffffff00u64;
5792            let maskedval = padval & mask;
5793            if maskedval != 0 {
5794                return Err(fidl::Error::NonZeroPadding {
5795                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
5796                });
5797            }
5798            fidl::decode!(
5799                fidl::encoding::BoundedString<255>,
5800                D,
5801                &mut self.description,
5802                decoder,
5803                offset + 0,
5804                _depth
5805            )?;
5806            fidl::decode!(u8, D, &mut self.value, decoder, offset + 16, _depth)?;
5807            Ok(())
5808        }
5809    }
5810
5811    impl fidl::encoding::ValueTypeMarker for Parent {
5812        type Borrowed<'a> = &'a Self;
5813        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5814            value
5815        }
5816    }
5817
5818    unsafe impl fidl::encoding::TypeMarker for Parent {
5819        type Owned = Self;
5820
5821        #[inline(always)]
5822        fn inline_align(_context: fidl::encoding::Context) -> usize {
5823            1
5824        }
5825
5826        #[inline(always)]
5827        fn inline_size(_context: fidl::encoding::Context) -> usize {
5828            1
5829        }
5830    }
5831
5832    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Parent, D> for &Parent {
5833        #[inline]
5834        unsafe fn encode(
5835            self,
5836            encoder: &mut fidl::encoding::Encoder<'_, D>,
5837            offset: usize,
5838            _depth: fidl::encoding::Depth,
5839        ) -> fidl::Result<()> {
5840            encoder.debug_check_bounds::<Parent>(offset);
5841            encoder.write_num(0u8, offset);
5842            Ok(())
5843        }
5844    }
5845
5846    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Parent {
5847        #[inline(always)]
5848        fn new_empty() -> Self {
5849            Self
5850        }
5851
5852        #[inline]
5853        unsafe fn decode(
5854            &mut self,
5855            decoder: &mut fidl::encoding::Decoder<'_, D>,
5856            offset: usize,
5857            _depth: fidl::encoding::Depth,
5858        ) -> fidl::Result<()> {
5859            decoder.debug_check_bounds::<Self>(offset);
5860            match decoder.read_num::<u8>(offset) {
5861                0 => Ok(()),
5862                _ => Err(fidl::Error::Invalid),
5863            }
5864        }
5865    }
5866
5867    impl fidl::encoding::ValueTypeMarker for TargetHandlerGetNotificationRequest {
5868        type Borrowed<'a> = &'a Self;
5869        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5870            value
5871        }
5872    }
5873
5874    unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetNotificationRequest {
5875        type Owned = Self;
5876
5877        #[inline(always)]
5878        fn inline_align(_context: fidl::encoding::Context) -> usize {
5879            1
5880        }
5881
5882        #[inline(always)]
5883        fn inline_size(_context: fidl::encoding::Context) -> usize {
5884            1
5885        }
5886    }
5887
5888    unsafe impl<D: fidl::encoding::ResourceDialect>
5889        fidl::encoding::Encode<TargetHandlerGetNotificationRequest, D>
5890        for &TargetHandlerGetNotificationRequest
5891    {
5892        #[inline]
5893        unsafe fn encode(
5894            self,
5895            encoder: &mut fidl::encoding::Encoder<'_, D>,
5896            offset: usize,
5897            _depth: fidl::encoding::Depth,
5898        ) -> fidl::Result<()> {
5899            encoder.debug_check_bounds::<TargetHandlerGetNotificationRequest>(offset);
5900            // Delegate to tuple encoding.
5901            fidl::encoding::Encode::<TargetHandlerGetNotificationRequest, D>::encode(
5902                (<NotificationEvent as fidl::encoding::ValueTypeMarker>::borrow(&self.event_id),),
5903                encoder,
5904                offset,
5905                _depth,
5906            )
5907        }
5908    }
5909    unsafe impl<
5910        D: fidl::encoding::ResourceDialect,
5911        T0: fidl::encoding::Encode<NotificationEvent, D>,
5912    > fidl::encoding::Encode<TargetHandlerGetNotificationRequest, D> for (T0,)
5913    {
5914        #[inline]
5915        unsafe fn encode(
5916            self,
5917            encoder: &mut fidl::encoding::Encoder<'_, D>,
5918            offset: usize,
5919            depth: fidl::encoding::Depth,
5920        ) -> fidl::Result<()> {
5921            encoder.debug_check_bounds::<TargetHandlerGetNotificationRequest>(offset);
5922            // Zero out padding regions. There's no need to apply masks
5923            // because the unmasked parts will be overwritten by fields.
5924            // Write the fields.
5925            self.0.encode(encoder, offset + 0, depth)?;
5926            Ok(())
5927        }
5928    }
5929
5930    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
5931        for TargetHandlerGetNotificationRequest
5932    {
5933        #[inline(always)]
5934        fn new_empty() -> Self {
5935            Self { event_id: fidl::new_empty!(NotificationEvent, D) }
5936        }
5937
5938        #[inline]
5939        unsafe fn decode(
5940            &mut self,
5941            decoder: &mut fidl::encoding::Decoder<'_, D>,
5942            offset: usize,
5943            _depth: fidl::encoding::Depth,
5944        ) -> fidl::Result<()> {
5945            decoder.debug_check_bounds::<Self>(offset);
5946            // Verify that padding bytes are zero.
5947            fidl::decode!(NotificationEvent, D, &mut self.event_id, decoder, offset + 0, _depth)?;
5948            Ok(())
5949        }
5950    }
5951
5952    impl fidl::encoding::ValueTypeMarker for TargetHandlerGetPlayerApplicationSettingsRequest {
5953        type Borrowed<'a> = &'a Self;
5954        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5955            value
5956        }
5957    }
5958
5959    unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetPlayerApplicationSettingsRequest {
5960        type Owned = Self;
5961
5962        #[inline(always)]
5963        fn inline_align(_context: fidl::encoding::Context) -> usize {
5964            8
5965        }
5966
5967        #[inline(always)]
5968        fn inline_size(_context: fidl::encoding::Context) -> usize {
5969            16
5970        }
5971    }
5972
5973    unsafe impl<D: fidl::encoding::ResourceDialect>
5974        fidl::encoding::Encode<TargetHandlerGetPlayerApplicationSettingsRequest, D>
5975        for &TargetHandlerGetPlayerApplicationSettingsRequest
5976    {
5977        #[inline]
5978        unsafe fn encode(
5979            self,
5980            encoder: &mut fidl::encoding::Encoder<'_, D>,
5981            offset: usize,
5982            _depth: fidl::encoding::Depth,
5983        ) -> fidl::Result<()> {
5984            encoder.debug_check_bounds::<TargetHandlerGetPlayerApplicationSettingsRequest>(offset);
5985            // Delegate to tuple encoding.
5986            fidl::encoding::Encode::<TargetHandlerGetPlayerApplicationSettingsRequest, D>::encode(
5987                (
5988                    <fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131> as fidl::encoding::ValueTypeMarker>::borrow(&self.attribute_ids),
5989                ),
5990                encoder, offset, _depth
5991            )
5992        }
5993    }
5994    unsafe impl<
5995        D: fidl::encoding::ResourceDialect,
5996        T0: fidl::encoding::Encode<fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D>,
5997    > fidl::encoding::Encode<TargetHandlerGetPlayerApplicationSettingsRequest, D> for (T0,)
5998    {
5999        #[inline]
6000        unsafe fn encode(
6001            self,
6002            encoder: &mut fidl::encoding::Encoder<'_, D>,
6003            offset: usize,
6004            depth: fidl::encoding::Depth,
6005        ) -> fidl::Result<()> {
6006            encoder.debug_check_bounds::<TargetHandlerGetPlayerApplicationSettingsRequest>(offset);
6007            // Zero out padding regions. There's no need to apply masks
6008            // because the unmasked parts will be overwritten by fields.
6009            // Write the fields.
6010            self.0.encode(encoder, offset + 0, depth)?;
6011            Ok(())
6012        }
6013    }
6014
6015    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6016        for TargetHandlerGetPlayerApplicationSettingsRequest
6017    {
6018        #[inline(always)]
6019        fn new_empty() -> Self {
6020            Self {
6021                attribute_ids: fidl::new_empty!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D),
6022            }
6023        }
6024
6025        #[inline]
6026        unsafe fn decode(
6027            &mut self,
6028            decoder: &mut fidl::encoding::Decoder<'_, D>,
6029            offset: usize,
6030            _depth: fidl::encoding::Depth,
6031        ) -> fidl::Result<()> {
6032            decoder.debug_check_bounds::<Self>(offset);
6033            // Verify that padding bytes are zero.
6034            fidl::decode!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D, &mut self.attribute_ids, decoder, offset + 0, _depth)?;
6035            Ok(())
6036        }
6037    }
6038
6039    impl fidl::encoding::ValueTypeMarker for TargetHandlerSendCommandRequest {
6040        type Borrowed<'a> = &'a Self;
6041        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6042            value
6043        }
6044    }
6045
6046    unsafe impl fidl::encoding::TypeMarker for TargetHandlerSendCommandRequest {
6047        type Owned = Self;
6048
6049        #[inline(always)]
6050        fn inline_align(_context: fidl::encoding::Context) -> usize {
6051            1
6052        }
6053
6054        #[inline(always)]
6055        fn inline_size(_context: fidl::encoding::Context) -> usize {
6056            2
6057        }
6058    }
6059
6060    unsafe impl<D: fidl::encoding::ResourceDialect>
6061        fidl::encoding::Encode<TargetHandlerSendCommandRequest, D>
6062        for &TargetHandlerSendCommandRequest
6063    {
6064        #[inline]
6065        unsafe fn encode(
6066            self,
6067            encoder: &mut fidl::encoding::Encoder<'_, D>,
6068            offset: usize,
6069            _depth: fidl::encoding::Depth,
6070        ) -> fidl::Result<()> {
6071            encoder.debug_check_bounds::<TargetHandlerSendCommandRequest>(offset);
6072            // Delegate to tuple encoding.
6073            fidl::encoding::Encode::<TargetHandlerSendCommandRequest, D>::encode(
6074                (
6075                    <AvcPanelCommand as fidl::encoding::ValueTypeMarker>::borrow(&self.command),
6076                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.pressed),
6077                ),
6078                encoder,
6079                offset,
6080                _depth,
6081            )
6082        }
6083    }
6084    unsafe impl<
6085        D: fidl::encoding::ResourceDialect,
6086        T0: fidl::encoding::Encode<AvcPanelCommand, D>,
6087        T1: fidl::encoding::Encode<bool, D>,
6088    > fidl::encoding::Encode<TargetHandlerSendCommandRequest, D> for (T0, T1)
6089    {
6090        #[inline]
6091        unsafe fn encode(
6092            self,
6093            encoder: &mut fidl::encoding::Encoder<'_, D>,
6094            offset: usize,
6095            depth: fidl::encoding::Depth,
6096        ) -> fidl::Result<()> {
6097            encoder.debug_check_bounds::<TargetHandlerSendCommandRequest>(offset);
6098            // Zero out padding regions. There's no need to apply masks
6099            // because the unmasked parts will be overwritten by fields.
6100            // Write the fields.
6101            self.0.encode(encoder, offset + 0, depth)?;
6102            self.1.encode(encoder, offset + 1, depth)?;
6103            Ok(())
6104        }
6105    }
6106
6107    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6108        for TargetHandlerSendCommandRequest
6109    {
6110        #[inline(always)]
6111        fn new_empty() -> Self {
6112            Self {
6113                command: fidl::new_empty!(AvcPanelCommand, D),
6114                pressed: fidl::new_empty!(bool, D),
6115            }
6116        }
6117
6118        #[inline]
6119        unsafe fn decode(
6120            &mut self,
6121            decoder: &mut fidl::encoding::Decoder<'_, D>,
6122            offset: usize,
6123            _depth: fidl::encoding::Depth,
6124        ) -> fidl::Result<()> {
6125            decoder.debug_check_bounds::<Self>(offset);
6126            // Verify that padding bytes are zero.
6127            fidl::decode!(AvcPanelCommand, D, &mut self.command, decoder, offset + 0, _depth)?;
6128            fidl::decode!(bool, D, &mut self.pressed, decoder, offset + 1, _depth)?;
6129            Ok(())
6130        }
6131    }
6132
6133    impl fidl::encoding::ValueTypeMarker for TargetHandlerSetAddressedPlayerRequest {
6134        type Borrowed<'a> = &'a Self;
6135        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6136            value
6137        }
6138    }
6139
6140    unsafe impl fidl::encoding::TypeMarker for TargetHandlerSetAddressedPlayerRequest {
6141        type Owned = Self;
6142
6143        #[inline(always)]
6144        fn inline_align(_context: fidl::encoding::Context) -> usize {
6145            2
6146        }
6147
6148        #[inline(always)]
6149        fn inline_size(_context: fidl::encoding::Context) -> usize {
6150            2
6151        }
6152        #[inline(always)]
6153        fn encode_is_copy() -> bool {
6154            true
6155        }
6156
6157        #[inline(always)]
6158        fn decode_is_copy() -> bool {
6159            true
6160        }
6161    }
6162
6163    unsafe impl<D: fidl::encoding::ResourceDialect>
6164        fidl::encoding::Encode<TargetHandlerSetAddressedPlayerRequest, D>
6165        for &TargetHandlerSetAddressedPlayerRequest
6166    {
6167        #[inline]
6168        unsafe fn encode(
6169            self,
6170            encoder: &mut fidl::encoding::Encoder<'_, D>,
6171            offset: usize,
6172            _depth: fidl::encoding::Depth,
6173        ) -> fidl::Result<()> {
6174            encoder.debug_check_bounds::<TargetHandlerSetAddressedPlayerRequest>(offset);
6175            unsafe {
6176                // Copy the object into the buffer.
6177                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
6178                (buf_ptr as *mut TargetHandlerSetAddressedPlayerRequest).write_unaligned(
6179                    (self as *const TargetHandlerSetAddressedPlayerRequest).read(),
6180                );
6181                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
6182                // done second because the memcpy will write garbage to these bytes.
6183            }
6184            Ok(())
6185        }
6186    }
6187    unsafe impl<
6188        D: fidl::encoding::ResourceDialect,
6189        T0: fidl::encoding::Encode<AddressedPlayerId, D>,
6190    > fidl::encoding::Encode<TargetHandlerSetAddressedPlayerRequest, D> for (T0,)
6191    {
6192        #[inline]
6193        unsafe fn encode(
6194            self,
6195            encoder: &mut fidl::encoding::Encoder<'_, D>,
6196            offset: usize,
6197            depth: fidl::encoding::Depth,
6198        ) -> fidl::Result<()> {
6199            encoder.debug_check_bounds::<TargetHandlerSetAddressedPlayerRequest>(offset);
6200            // Zero out padding regions. There's no need to apply masks
6201            // because the unmasked parts will be overwritten by fields.
6202            // Write the fields.
6203            self.0.encode(encoder, offset + 0, depth)?;
6204            Ok(())
6205        }
6206    }
6207
6208    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6209        for TargetHandlerSetAddressedPlayerRequest
6210    {
6211        #[inline(always)]
6212        fn new_empty() -> Self {
6213            Self { player_id: fidl::new_empty!(AddressedPlayerId, D) }
6214        }
6215
6216        #[inline]
6217        unsafe fn decode(
6218            &mut self,
6219            decoder: &mut fidl::encoding::Decoder<'_, D>,
6220            offset: usize,
6221            _depth: fidl::encoding::Depth,
6222        ) -> fidl::Result<()> {
6223            decoder.debug_check_bounds::<Self>(offset);
6224            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
6225            // Verify that padding bytes are zero.
6226            // Copy from the buffer into the object.
6227            unsafe {
6228                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
6229            }
6230            Ok(())
6231        }
6232    }
6233
6234    impl fidl::encoding::ValueTypeMarker for TargetHandlerSetPlayerApplicationSettingsRequest {
6235        type Borrowed<'a> = &'a Self;
6236        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6237            value
6238        }
6239    }
6240
6241    unsafe impl fidl::encoding::TypeMarker for TargetHandlerSetPlayerApplicationSettingsRequest {
6242        type Owned = Self;
6243
6244        #[inline(always)]
6245        fn inline_align(_context: fidl::encoding::Context) -> usize {
6246            8
6247        }
6248
6249        #[inline(always)]
6250        fn inline_size(_context: fidl::encoding::Context) -> usize {
6251            16
6252        }
6253    }
6254
6255    unsafe impl<D: fidl::encoding::ResourceDialect>
6256        fidl::encoding::Encode<TargetHandlerSetPlayerApplicationSettingsRequest, D>
6257        for &TargetHandlerSetPlayerApplicationSettingsRequest
6258    {
6259        #[inline]
6260        unsafe fn encode(
6261            self,
6262            encoder: &mut fidl::encoding::Encoder<'_, D>,
6263            offset: usize,
6264            _depth: fidl::encoding::Depth,
6265        ) -> fidl::Result<()> {
6266            encoder.debug_check_bounds::<TargetHandlerSetPlayerApplicationSettingsRequest>(offset);
6267            // Delegate to tuple encoding.
6268            fidl::encoding::Encode::<TargetHandlerSetPlayerApplicationSettingsRequest, D>::encode(
6269                (<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
6270                    &self.requested_settings,
6271                ),),
6272                encoder,
6273                offset,
6274                _depth,
6275            )
6276        }
6277    }
6278    unsafe impl<
6279        D: fidl::encoding::ResourceDialect,
6280        T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
6281    > fidl::encoding::Encode<TargetHandlerSetPlayerApplicationSettingsRequest, D> for (T0,)
6282    {
6283        #[inline]
6284        unsafe fn encode(
6285            self,
6286            encoder: &mut fidl::encoding::Encoder<'_, D>,
6287            offset: usize,
6288            depth: fidl::encoding::Depth,
6289        ) -> fidl::Result<()> {
6290            encoder.debug_check_bounds::<TargetHandlerSetPlayerApplicationSettingsRequest>(offset);
6291            // Zero out padding regions. There's no need to apply masks
6292            // because the unmasked parts will be overwritten by fields.
6293            // Write the fields.
6294            self.0.encode(encoder, offset + 0, depth)?;
6295            Ok(())
6296        }
6297    }
6298
6299    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6300        for TargetHandlerSetPlayerApplicationSettingsRequest
6301    {
6302        #[inline(always)]
6303        fn new_empty() -> Self {
6304            Self { requested_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
6305        }
6306
6307        #[inline]
6308        unsafe fn decode(
6309            &mut self,
6310            decoder: &mut fidl::encoding::Decoder<'_, D>,
6311            offset: usize,
6312            _depth: fidl::encoding::Depth,
6313        ) -> fidl::Result<()> {
6314            decoder.debug_check_bounds::<Self>(offset);
6315            // Verify that padding bytes are zero.
6316            fidl::decode!(
6317                PlayerApplicationSettings,
6318                D,
6319                &mut self.requested_settings,
6320                decoder,
6321                offset + 0,
6322                _depth
6323            )?;
6324            Ok(())
6325        }
6326    }
6327
6328    impl fidl::encoding::ValueTypeMarker for TargetHandlerWatchNotificationRequest {
6329        type Borrowed<'a> = &'a Self;
6330        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6331            value
6332        }
6333    }
6334
6335    unsafe impl fidl::encoding::TypeMarker for TargetHandlerWatchNotificationRequest {
6336        type Owned = Self;
6337
6338        #[inline(always)]
6339        fn inline_align(_context: fidl::encoding::Context) -> usize {
6340            8
6341        }
6342
6343        #[inline(always)]
6344        fn inline_size(_context: fidl::encoding::Context) -> usize {
6345            32
6346        }
6347    }
6348
6349    unsafe impl<D: fidl::encoding::ResourceDialect>
6350        fidl::encoding::Encode<TargetHandlerWatchNotificationRequest, D>
6351        for &TargetHandlerWatchNotificationRequest
6352    {
6353        #[inline]
6354        unsafe fn encode(
6355            self,
6356            encoder: &mut fidl::encoding::Encoder<'_, D>,
6357            offset: usize,
6358            _depth: fidl::encoding::Depth,
6359        ) -> fidl::Result<()> {
6360            encoder.debug_check_bounds::<TargetHandlerWatchNotificationRequest>(offset);
6361            // Delegate to tuple encoding.
6362            fidl::encoding::Encode::<TargetHandlerWatchNotificationRequest, D>::encode(
6363                (
6364                    <NotificationEvent as fidl::encoding::ValueTypeMarker>::borrow(&self.event_id),
6365                    <Notification as fidl::encoding::ValueTypeMarker>::borrow(&self.current),
6366                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.pos_change_interval),
6367                ),
6368                encoder,
6369                offset,
6370                _depth,
6371            )
6372        }
6373    }
6374    unsafe impl<
6375        D: fidl::encoding::ResourceDialect,
6376        T0: fidl::encoding::Encode<NotificationEvent, D>,
6377        T1: fidl::encoding::Encode<Notification, D>,
6378        T2: fidl::encoding::Encode<u32, D>,
6379    > fidl::encoding::Encode<TargetHandlerWatchNotificationRequest, D> for (T0, T1, T2)
6380    {
6381        #[inline]
6382        unsafe fn encode(
6383            self,
6384            encoder: &mut fidl::encoding::Encoder<'_, D>,
6385            offset: usize,
6386            depth: fidl::encoding::Depth,
6387        ) -> fidl::Result<()> {
6388            encoder.debug_check_bounds::<TargetHandlerWatchNotificationRequest>(offset);
6389            // Zero out padding regions. There's no need to apply masks
6390            // because the unmasked parts will be overwritten by fields.
6391            unsafe {
6392                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
6393                (ptr as *mut u64).write_unaligned(0);
6394            }
6395            unsafe {
6396                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
6397                (ptr as *mut u64).write_unaligned(0);
6398            }
6399            // Write the fields.
6400            self.0.encode(encoder, offset + 0, depth)?;
6401            self.1.encode(encoder, offset + 8, depth)?;
6402            self.2.encode(encoder, offset + 24, depth)?;
6403            Ok(())
6404        }
6405    }
6406
6407    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6408        for TargetHandlerWatchNotificationRequest
6409    {
6410        #[inline(always)]
6411        fn new_empty() -> Self {
6412            Self {
6413                event_id: fidl::new_empty!(NotificationEvent, D),
6414                current: fidl::new_empty!(Notification, D),
6415                pos_change_interval: fidl::new_empty!(u32, D),
6416            }
6417        }
6418
6419        #[inline]
6420        unsafe fn decode(
6421            &mut self,
6422            decoder: &mut fidl::encoding::Decoder<'_, D>,
6423            offset: usize,
6424            _depth: fidl::encoding::Depth,
6425        ) -> fidl::Result<()> {
6426            decoder.debug_check_bounds::<Self>(offset);
6427            // Verify that padding bytes are zero.
6428            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
6429            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6430            let mask = 0xffffffffffffff00u64;
6431            let maskedval = padval & mask;
6432            if maskedval != 0 {
6433                return Err(fidl::Error::NonZeroPadding {
6434                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
6435                });
6436            }
6437            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
6438            let padval = unsafe { (ptr as *const u64).read_unaligned() };
6439            let mask = 0xffffffff00000000u64;
6440            let maskedval = padval & mask;
6441            if maskedval != 0 {
6442                return Err(fidl::Error::NonZeroPadding {
6443                    padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
6444                });
6445            }
6446            fidl::decode!(NotificationEvent, D, &mut self.event_id, decoder, offset + 0, _depth)?;
6447            fidl::decode!(Notification, D, &mut self.current, decoder, offset + 8, _depth)?;
6448            fidl::decode!(u32, D, &mut self.pos_change_interval, decoder, offset + 24, _depth)?;
6449            Ok(())
6450        }
6451    }
6452
6453    impl fidl::encoding::ValueTypeMarker for TargetHandlerGetEventsSupportedResponse {
6454        type Borrowed<'a> = &'a Self;
6455        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6456            value
6457        }
6458    }
6459
6460    unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetEventsSupportedResponse {
6461        type Owned = Self;
6462
6463        #[inline(always)]
6464        fn inline_align(_context: fidl::encoding::Context) -> usize {
6465            8
6466        }
6467
6468        #[inline(always)]
6469        fn inline_size(_context: fidl::encoding::Context) -> usize {
6470            16
6471        }
6472    }
6473
6474    unsafe impl<D: fidl::encoding::ResourceDialect>
6475        fidl::encoding::Encode<TargetHandlerGetEventsSupportedResponse, D>
6476        for &TargetHandlerGetEventsSupportedResponse
6477    {
6478        #[inline]
6479        unsafe fn encode(
6480            self,
6481            encoder: &mut fidl::encoding::Encoder<'_, D>,
6482            offset: usize,
6483            _depth: fidl::encoding::Depth,
6484        ) -> fidl::Result<()> {
6485            encoder.debug_check_bounds::<TargetHandlerGetEventsSupportedResponse>(offset);
6486            // Delegate to tuple encoding.
6487            fidl::encoding::Encode::<TargetHandlerGetEventsSupportedResponse, D>::encode(
6488                (
6489                    <fidl::encoding::Vector<NotificationEvent, 255> as fidl::encoding::ValueTypeMarker>::borrow(&self.notification_ids),
6490                ),
6491                encoder, offset, _depth
6492            )
6493        }
6494    }
6495    unsafe impl<
6496        D: fidl::encoding::ResourceDialect,
6497        T0: fidl::encoding::Encode<fidl::encoding::Vector<NotificationEvent, 255>, D>,
6498    > fidl::encoding::Encode<TargetHandlerGetEventsSupportedResponse, D> for (T0,)
6499    {
6500        #[inline]
6501        unsafe fn encode(
6502            self,
6503            encoder: &mut fidl::encoding::Encoder<'_, D>,
6504            offset: usize,
6505            depth: fidl::encoding::Depth,
6506        ) -> fidl::Result<()> {
6507            encoder.debug_check_bounds::<TargetHandlerGetEventsSupportedResponse>(offset);
6508            // Zero out padding regions. There's no need to apply masks
6509            // because the unmasked parts will be overwritten by fields.
6510            // Write the fields.
6511            self.0.encode(encoder, offset + 0, depth)?;
6512            Ok(())
6513        }
6514    }
6515
6516    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6517        for TargetHandlerGetEventsSupportedResponse
6518    {
6519        #[inline(always)]
6520        fn new_empty() -> Self {
6521            Self {
6522                notification_ids: fidl::new_empty!(fidl::encoding::Vector<NotificationEvent, 255>, D),
6523            }
6524        }
6525
6526        #[inline]
6527        unsafe fn decode(
6528            &mut self,
6529            decoder: &mut fidl::encoding::Decoder<'_, D>,
6530            offset: usize,
6531            _depth: fidl::encoding::Depth,
6532        ) -> fidl::Result<()> {
6533            decoder.debug_check_bounds::<Self>(offset);
6534            // Verify that padding bytes are zero.
6535            fidl::decode!(fidl::encoding::Vector<NotificationEvent, 255>, D, &mut self.notification_ids, decoder, offset + 0, _depth)?;
6536            Ok(())
6537        }
6538    }
6539
6540    impl fidl::encoding::ValueTypeMarker for TargetHandlerGetMediaAttributesResponse {
6541        type Borrowed<'a> = &'a Self;
6542        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6543            value
6544        }
6545    }
6546
6547    unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetMediaAttributesResponse {
6548        type Owned = Self;
6549
6550        #[inline(always)]
6551        fn inline_align(_context: fidl::encoding::Context) -> usize {
6552            8
6553        }
6554
6555        #[inline(always)]
6556        fn inline_size(_context: fidl::encoding::Context) -> usize {
6557            16
6558        }
6559    }
6560
6561    unsafe impl<D: fidl::encoding::ResourceDialect>
6562        fidl::encoding::Encode<TargetHandlerGetMediaAttributesResponse, D>
6563        for &TargetHandlerGetMediaAttributesResponse
6564    {
6565        #[inline]
6566        unsafe fn encode(
6567            self,
6568            encoder: &mut fidl::encoding::Encoder<'_, D>,
6569            offset: usize,
6570            _depth: fidl::encoding::Depth,
6571        ) -> fidl::Result<()> {
6572            encoder.debug_check_bounds::<TargetHandlerGetMediaAttributesResponse>(offset);
6573            // Delegate to tuple encoding.
6574            fidl::encoding::Encode::<TargetHandlerGetMediaAttributesResponse, D>::encode(
6575                (<MediaAttributes as fidl::encoding::ValueTypeMarker>::borrow(&self.attributes),),
6576                encoder,
6577                offset,
6578                _depth,
6579            )
6580        }
6581    }
6582    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<MediaAttributes, D>>
6583        fidl::encoding::Encode<TargetHandlerGetMediaAttributesResponse, D> for (T0,)
6584    {
6585        #[inline]
6586        unsafe fn encode(
6587            self,
6588            encoder: &mut fidl::encoding::Encoder<'_, D>,
6589            offset: usize,
6590            depth: fidl::encoding::Depth,
6591        ) -> fidl::Result<()> {
6592            encoder.debug_check_bounds::<TargetHandlerGetMediaAttributesResponse>(offset);
6593            // Zero out padding regions. There's no need to apply masks
6594            // because the unmasked parts will be overwritten by fields.
6595            // Write the fields.
6596            self.0.encode(encoder, offset + 0, depth)?;
6597            Ok(())
6598        }
6599    }
6600
6601    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6602        for TargetHandlerGetMediaAttributesResponse
6603    {
6604        #[inline(always)]
6605        fn new_empty() -> Self {
6606            Self { attributes: fidl::new_empty!(MediaAttributes, D) }
6607        }
6608
6609        #[inline]
6610        unsafe fn decode(
6611            &mut self,
6612            decoder: &mut fidl::encoding::Decoder<'_, D>,
6613            offset: usize,
6614            _depth: fidl::encoding::Depth,
6615        ) -> fidl::Result<()> {
6616            decoder.debug_check_bounds::<Self>(offset);
6617            // Verify that padding bytes are zero.
6618            fidl::decode!(MediaAttributes, D, &mut self.attributes, decoder, offset + 0, _depth)?;
6619            Ok(())
6620        }
6621    }
6622
6623    impl fidl::encoding::ValueTypeMarker for TargetHandlerGetMediaPlayerItemsResponse {
6624        type Borrowed<'a> = &'a Self;
6625        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6626            value
6627        }
6628    }
6629
6630    unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetMediaPlayerItemsResponse {
6631        type Owned = Self;
6632
6633        #[inline(always)]
6634        fn inline_align(_context: fidl::encoding::Context) -> usize {
6635            8
6636        }
6637
6638        #[inline(always)]
6639        fn inline_size(_context: fidl::encoding::Context) -> usize {
6640            16
6641        }
6642    }
6643
6644    unsafe impl<D: fidl::encoding::ResourceDialect>
6645        fidl::encoding::Encode<TargetHandlerGetMediaPlayerItemsResponse, D>
6646        for &TargetHandlerGetMediaPlayerItemsResponse
6647    {
6648        #[inline]
6649        unsafe fn encode(
6650            self,
6651            encoder: &mut fidl::encoding::Encoder<'_, D>,
6652            offset: usize,
6653            _depth: fidl::encoding::Depth,
6654        ) -> fidl::Result<()> {
6655            encoder.debug_check_bounds::<TargetHandlerGetMediaPlayerItemsResponse>(offset);
6656            // Delegate to tuple encoding.
6657            fidl::encoding::Encode::<TargetHandlerGetMediaPlayerItemsResponse, D>::encode(
6658                (
6659                    <fidl::encoding::Vector<MediaPlayerItem, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
6660                ),
6661                encoder, offset, _depth
6662            )
6663        }
6664    }
6665    unsafe impl<
6666        D: fidl::encoding::ResourceDialect,
6667        T0: fidl::encoding::Encode<fidl::encoding::Vector<MediaPlayerItem, 16>, D>,
6668    > fidl::encoding::Encode<TargetHandlerGetMediaPlayerItemsResponse, D> for (T0,)
6669    {
6670        #[inline]
6671        unsafe fn encode(
6672            self,
6673            encoder: &mut fidl::encoding::Encoder<'_, D>,
6674            offset: usize,
6675            depth: fidl::encoding::Depth,
6676        ) -> fidl::Result<()> {
6677            encoder.debug_check_bounds::<TargetHandlerGetMediaPlayerItemsResponse>(offset);
6678            // Zero out padding regions. There's no need to apply masks
6679            // because the unmasked parts will be overwritten by fields.
6680            // Write the fields.
6681            self.0.encode(encoder, offset + 0, depth)?;
6682            Ok(())
6683        }
6684    }
6685
6686    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6687        for TargetHandlerGetMediaPlayerItemsResponse
6688    {
6689        #[inline(always)]
6690        fn new_empty() -> Self {
6691            Self { items: fidl::new_empty!(fidl::encoding::Vector<MediaPlayerItem, 16>, D) }
6692        }
6693
6694        #[inline]
6695        unsafe fn decode(
6696            &mut self,
6697            decoder: &mut fidl::encoding::Decoder<'_, D>,
6698            offset: usize,
6699            _depth: fidl::encoding::Depth,
6700        ) -> fidl::Result<()> {
6701            decoder.debug_check_bounds::<Self>(offset);
6702            // Verify that padding bytes are zero.
6703            fidl::decode!(fidl::encoding::Vector<MediaPlayerItem, 16>, D, &mut self.items, decoder, offset + 0, _depth)?;
6704            Ok(())
6705        }
6706    }
6707
6708    impl fidl::encoding::ValueTypeMarker for TargetHandlerGetNotificationResponse {
6709        type Borrowed<'a> = &'a Self;
6710        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6711            value
6712        }
6713    }
6714
6715    unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetNotificationResponse {
6716        type Owned = Self;
6717
6718        #[inline(always)]
6719        fn inline_align(_context: fidl::encoding::Context) -> usize {
6720            8
6721        }
6722
6723        #[inline(always)]
6724        fn inline_size(_context: fidl::encoding::Context) -> usize {
6725            16
6726        }
6727    }
6728
6729    unsafe impl<D: fidl::encoding::ResourceDialect>
6730        fidl::encoding::Encode<TargetHandlerGetNotificationResponse, D>
6731        for &TargetHandlerGetNotificationResponse
6732    {
6733        #[inline]
6734        unsafe fn encode(
6735            self,
6736            encoder: &mut fidl::encoding::Encoder<'_, D>,
6737            offset: usize,
6738            _depth: fidl::encoding::Depth,
6739        ) -> fidl::Result<()> {
6740            encoder.debug_check_bounds::<TargetHandlerGetNotificationResponse>(offset);
6741            // Delegate to tuple encoding.
6742            fidl::encoding::Encode::<TargetHandlerGetNotificationResponse, D>::encode(
6743                (<Notification as fidl::encoding::ValueTypeMarker>::borrow(&self.current_value),),
6744                encoder,
6745                offset,
6746                _depth,
6747            )
6748        }
6749    }
6750    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Notification, D>>
6751        fidl::encoding::Encode<TargetHandlerGetNotificationResponse, D> for (T0,)
6752    {
6753        #[inline]
6754        unsafe fn encode(
6755            self,
6756            encoder: &mut fidl::encoding::Encoder<'_, D>,
6757            offset: usize,
6758            depth: fidl::encoding::Depth,
6759        ) -> fidl::Result<()> {
6760            encoder.debug_check_bounds::<TargetHandlerGetNotificationResponse>(offset);
6761            // Zero out padding regions. There's no need to apply masks
6762            // because the unmasked parts will be overwritten by fields.
6763            // Write the fields.
6764            self.0.encode(encoder, offset + 0, depth)?;
6765            Ok(())
6766        }
6767    }
6768
6769    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6770        for TargetHandlerGetNotificationResponse
6771    {
6772        #[inline(always)]
6773        fn new_empty() -> Self {
6774            Self { current_value: fidl::new_empty!(Notification, D) }
6775        }
6776
6777        #[inline]
6778        unsafe fn decode(
6779            &mut self,
6780            decoder: &mut fidl::encoding::Decoder<'_, D>,
6781            offset: usize,
6782            _depth: fidl::encoding::Depth,
6783        ) -> fidl::Result<()> {
6784            decoder.debug_check_bounds::<Self>(offset);
6785            // Verify that padding bytes are zero.
6786            fidl::decode!(Notification, D, &mut self.current_value, decoder, offset + 0, _depth)?;
6787            Ok(())
6788        }
6789    }
6790
6791    impl fidl::encoding::ValueTypeMarker for TargetHandlerGetPlayStatusResponse {
6792        type Borrowed<'a> = &'a Self;
6793        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6794            value
6795        }
6796    }
6797
6798    unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetPlayStatusResponse {
6799        type Owned = Self;
6800
6801        #[inline(always)]
6802        fn inline_align(_context: fidl::encoding::Context) -> usize {
6803            8
6804        }
6805
6806        #[inline(always)]
6807        fn inline_size(_context: fidl::encoding::Context) -> usize {
6808            16
6809        }
6810    }
6811
6812    unsafe impl<D: fidl::encoding::ResourceDialect>
6813        fidl::encoding::Encode<TargetHandlerGetPlayStatusResponse, D>
6814        for &TargetHandlerGetPlayStatusResponse
6815    {
6816        #[inline]
6817        unsafe fn encode(
6818            self,
6819            encoder: &mut fidl::encoding::Encoder<'_, D>,
6820            offset: usize,
6821            _depth: fidl::encoding::Depth,
6822        ) -> fidl::Result<()> {
6823            encoder.debug_check_bounds::<TargetHandlerGetPlayStatusResponse>(offset);
6824            // Delegate to tuple encoding.
6825            fidl::encoding::Encode::<TargetHandlerGetPlayStatusResponse, D>::encode(
6826                (<PlayStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.play_status),),
6827                encoder,
6828                offset,
6829                _depth,
6830            )
6831        }
6832    }
6833    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PlayStatus, D>>
6834        fidl::encoding::Encode<TargetHandlerGetPlayStatusResponse, D> for (T0,)
6835    {
6836        #[inline]
6837        unsafe fn encode(
6838            self,
6839            encoder: &mut fidl::encoding::Encoder<'_, D>,
6840            offset: usize,
6841            depth: fidl::encoding::Depth,
6842        ) -> fidl::Result<()> {
6843            encoder.debug_check_bounds::<TargetHandlerGetPlayStatusResponse>(offset);
6844            // Zero out padding regions. There's no need to apply masks
6845            // because the unmasked parts will be overwritten by fields.
6846            // Write the fields.
6847            self.0.encode(encoder, offset + 0, depth)?;
6848            Ok(())
6849        }
6850    }
6851
6852    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6853        for TargetHandlerGetPlayStatusResponse
6854    {
6855        #[inline(always)]
6856        fn new_empty() -> Self {
6857            Self { play_status: fidl::new_empty!(PlayStatus, D) }
6858        }
6859
6860        #[inline]
6861        unsafe fn decode(
6862            &mut self,
6863            decoder: &mut fidl::encoding::Decoder<'_, D>,
6864            offset: usize,
6865            _depth: fidl::encoding::Depth,
6866        ) -> fidl::Result<()> {
6867            decoder.debug_check_bounds::<Self>(offset);
6868            // Verify that padding bytes are zero.
6869            fidl::decode!(PlayStatus, D, &mut self.play_status, decoder, offset + 0, _depth)?;
6870            Ok(())
6871        }
6872    }
6873
6874    impl fidl::encoding::ValueTypeMarker for TargetHandlerGetPlayerApplicationSettingsResponse {
6875        type Borrowed<'a> = &'a Self;
6876        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6877            value
6878        }
6879    }
6880
6881    unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetPlayerApplicationSettingsResponse {
6882        type Owned = Self;
6883
6884        #[inline(always)]
6885        fn inline_align(_context: fidl::encoding::Context) -> usize {
6886            8
6887        }
6888
6889        #[inline(always)]
6890        fn inline_size(_context: fidl::encoding::Context) -> usize {
6891            16
6892        }
6893    }
6894
6895    unsafe impl<D: fidl::encoding::ResourceDialect>
6896        fidl::encoding::Encode<TargetHandlerGetPlayerApplicationSettingsResponse, D>
6897        for &TargetHandlerGetPlayerApplicationSettingsResponse
6898    {
6899        #[inline]
6900        unsafe fn encode(
6901            self,
6902            encoder: &mut fidl::encoding::Encoder<'_, D>,
6903            offset: usize,
6904            _depth: fidl::encoding::Depth,
6905        ) -> fidl::Result<()> {
6906            encoder.debug_check_bounds::<TargetHandlerGetPlayerApplicationSettingsResponse>(offset);
6907            // Delegate to tuple encoding.
6908            fidl::encoding::Encode::<TargetHandlerGetPlayerApplicationSettingsResponse, D>::encode(
6909                (<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
6910                    &self.current_settings,
6911                ),),
6912                encoder,
6913                offset,
6914                _depth,
6915            )
6916        }
6917    }
6918    unsafe impl<
6919        D: fidl::encoding::ResourceDialect,
6920        T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
6921    > fidl::encoding::Encode<TargetHandlerGetPlayerApplicationSettingsResponse, D> for (T0,)
6922    {
6923        #[inline]
6924        unsafe fn encode(
6925            self,
6926            encoder: &mut fidl::encoding::Encoder<'_, D>,
6927            offset: usize,
6928            depth: fidl::encoding::Depth,
6929        ) -> fidl::Result<()> {
6930            encoder.debug_check_bounds::<TargetHandlerGetPlayerApplicationSettingsResponse>(offset);
6931            // Zero out padding regions. There's no need to apply masks
6932            // because the unmasked parts will be overwritten by fields.
6933            // Write the fields.
6934            self.0.encode(encoder, offset + 0, depth)?;
6935            Ok(())
6936        }
6937    }
6938
6939    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6940        for TargetHandlerGetPlayerApplicationSettingsResponse
6941    {
6942        #[inline(always)]
6943        fn new_empty() -> Self {
6944            Self { current_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
6945        }
6946
6947        #[inline]
6948        unsafe fn decode(
6949            &mut self,
6950            decoder: &mut fidl::encoding::Decoder<'_, D>,
6951            offset: usize,
6952            _depth: fidl::encoding::Depth,
6953        ) -> fidl::Result<()> {
6954            decoder.debug_check_bounds::<Self>(offset);
6955            // Verify that padding bytes are zero.
6956            fidl::decode!(
6957                PlayerApplicationSettings,
6958                D,
6959                &mut self.current_settings,
6960                decoder,
6961                offset + 0,
6962                _depth
6963            )?;
6964            Ok(())
6965        }
6966    }
6967
6968    impl fidl::encoding::ValueTypeMarker
6969        for TargetHandlerListPlayerApplicationSettingAttributesResponse
6970    {
6971        type Borrowed<'a> = &'a Self;
6972        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6973            value
6974        }
6975    }
6976
6977    unsafe impl fidl::encoding::TypeMarker
6978        for TargetHandlerListPlayerApplicationSettingAttributesResponse
6979    {
6980        type Owned = Self;
6981
6982        #[inline(always)]
6983        fn inline_align(_context: fidl::encoding::Context) -> usize {
6984            8
6985        }
6986
6987        #[inline(always)]
6988        fn inline_size(_context: fidl::encoding::Context) -> usize {
6989            16
6990        }
6991    }
6992
6993    unsafe impl<D: fidl::encoding::ResourceDialect>
6994        fidl::encoding::Encode<TargetHandlerListPlayerApplicationSettingAttributesResponse, D>
6995        for &TargetHandlerListPlayerApplicationSettingAttributesResponse
6996    {
6997        #[inline]
6998        unsafe fn encode(
6999            self,
7000            encoder: &mut fidl::encoding::Encoder<'_, D>,
7001            offset: usize,
7002            _depth: fidl::encoding::Depth,
7003        ) -> fidl::Result<()> {
7004            encoder
7005                .debug_check_bounds::<TargetHandlerListPlayerApplicationSettingAttributesResponse>(
7006                    offset,
7007                );
7008            // Delegate to tuple encoding.
7009            fidl::encoding::Encode::<TargetHandlerListPlayerApplicationSettingAttributesResponse, D>::encode(
7010                (
7011                    <fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131> as fidl::encoding::ValueTypeMarker>::borrow(&self.attributes),
7012                ),
7013                encoder, offset, _depth
7014            )
7015        }
7016    }
7017    unsafe impl<
7018        D: fidl::encoding::ResourceDialect,
7019        T0: fidl::encoding::Encode<fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D>,
7020    > fidl::encoding::Encode<TargetHandlerListPlayerApplicationSettingAttributesResponse, D>
7021        for (T0,)
7022    {
7023        #[inline]
7024        unsafe fn encode(
7025            self,
7026            encoder: &mut fidl::encoding::Encoder<'_, D>,
7027            offset: usize,
7028            depth: fidl::encoding::Depth,
7029        ) -> fidl::Result<()> {
7030            encoder
7031                .debug_check_bounds::<TargetHandlerListPlayerApplicationSettingAttributesResponse>(
7032                    offset,
7033                );
7034            // Zero out padding regions. There's no need to apply masks
7035            // because the unmasked parts will be overwritten by fields.
7036            // Write the fields.
7037            self.0.encode(encoder, offset + 0, depth)?;
7038            Ok(())
7039        }
7040    }
7041
7042    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7043        for TargetHandlerListPlayerApplicationSettingAttributesResponse
7044    {
7045        #[inline(always)]
7046        fn new_empty() -> Self {
7047            Self {
7048                attributes: fidl::new_empty!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D),
7049            }
7050        }
7051
7052        #[inline]
7053        unsafe fn decode(
7054            &mut self,
7055            decoder: &mut fidl::encoding::Decoder<'_, D>,
7056            offset: usize,
7057            _depth: fidl::encoding::Depth,
7058        ) -> fidl::Result<()> {
7059            decoder.debug_check_bounds::<Self>(offset);
7060            // Verify that padding bytes are zero.
7061            fidl::decode!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D, &mut self.attributes, decoder, offset + 0, _depth)?;
7062            Ok(())
7063        }
7064    }
7065
7066    impl fidl::encoding::ValueTypeMarker for TargetHandlerSetPlayerApplicationSettingsResponse {
7067        type Borrowed<'a> = &'a Self;
7068        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7069            value
7070        }
7071    }
7072
7073    unsafe impl fidl::encoding::TypeMarker for TargetHandlerSetPlayerApplicationSettingsResponse {
7074        type Owned = Self;
7075
7076        #[inline(always)]
7077        fn inline_align(_context: fidl::encoding::Context) -> usize {
7078            8
7079        }
7080
7081        #[inline(always)]
7082        fn inline_size(_context: fidl::encoding::Context) -> usize {
7083            16
7084        }
7085    }
7086
7087    unsafe impl<D: fidl::encoding::ResourceDialect>
7088        fidl::encoding::Encode<TargetHandlerSetPlayerApplicationSettingsResponse, D>
7089        for &TargetHandlerSetPlayerApplicationSettingsResponse
7090    {
7091        #[inline]
7092        unsafe fn encode(
7093            self,
7094            encoder: &mut fidl::encoding::Encoder<'_, D>,
7095            offset: usize,
7096            _depth: fidl::encoding::Depth,
7097        ) -> fidl::Result<()> {
7098            encoder.debug_check_bounds::<TargetHandlerSetPlayerApplicationSettingsResponse>(offset);
7099            // Delegate to tuple encoding.
7100            fidl::encoding::Encode::<TargetHandlerSetPlayerApplicationSettingsResponse, D>::encode(
7101                (<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
7102                    &self.set_settings,
7103                ),),
7104                encoder,
7105                offset,
7106                _depth,
7107            )
7108        }
7109    }
7110    unsafe impl<
7111        D: fidl::encoding::ResourceDialect,
7112        T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
7113    > fidl::encoding::Encode<TargetHandlerSetPlayerApplicationSettingsResponse, D> for (T0,)
7114    {
7115        #[inline]
7116        unsafe fn encode(
7117            self,
7118            encoder: &mut fidl::encoding::Encoder<'_, D>,
7119            offset: usize,
7120            depth: fidl::encoding::Depth,
7121        ) -> fidl::Result<()> {
7122            encoder.debug_check_bounds::<TargetHandlerSetPlayerApplicationSettingsResponse>(offset);
7123            // Zero out padding regions. There's no need to apply masks
7124            // because the unmasked parts will be overwritten by fields.
7125            // Write the fields.
7126            self.0.encode(encoder, offset + 0, depth)?;
7127            Ok(())
7128        }
7129    }
7130
7131    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7132        for TargetHandlerSetPlayerApplicationSettingsResponse
7133    {
7134        #[inline(always)]
7135        fn new_empty() -> Self {
7136            Self { set_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
7137        }
7138
7139        #[inline]
7140        unsafe fn decode(
7141            &mut self,
7142            decoder: &mut fidl::encoding::Decoder<'_, D>,
7143            offset: usize,
7144            _depth: fidl::encoding::Depth,
7145        ) -> fidl::Result<()> {
7146            decoder.debug_check_bounds::<Self>(offset);
7147            // Verify that padding bytes are zero.
7148            fidl::decode!(
7149                PlayerApplicationSettings,
7150                D,
7151                &mut self.set_settings,
7152                decoder,
7153                offset + 0,
7154                _depth
7155            )?;
7156            Ok(())
7157        }
7158    }
7159
7160    impl fidl::encoding::ValueTypeMarker for TargetHandlerWatchNotificationResponse {
7161        type Borrowed<'a> = &'a Self;
7162        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7163            value
7164        }
7165    }
7166
7167    unsafe impl fidl::encoding::TypeMarker for TargetHandlerWatchNotificationResponse {
7168        type Owned = Self;
7169
7170        #[inline(always)]
7171        fn inline_align(_context: fidl::encoding::Context) -> usize {
7172            8
7173        }
7174
7175        #[inline(always)]
7176        fn inline_size(_context: fidl::encoding::Context) -> usize {
7177            16
7178        }
7179    }
7180
7181    unsafe impl<D: fidl::encoding::ResourceDialect>
7182        fidl::encoding::Encode<TargetHandlerWatchNotificationResponse, D>
7183        for &TargetHandlerWatchNotificationResponse
7184    {
7185        #[inline]
7186        unsafe fn encode(
7187            self,
7188            encoder: &mut fidl::encoding::Encoder<'_, D>,
7189            offset: usize,
7190            _depth: fidl::encoding::Depth,
7191        ) -> fidl::Result<()> {
7192            encoder.debug_check_bounds::<TargetHandlerWatchNotificationResponse>(offset);
7193            // Delegate to tuple encoding.
7194            fidl::encoding::Encode::<TargetHandlerWatchNotificationResponse, D>::encode(
7195                (<Notification as fidl::encoding::ValueTypeMarker>::borrow(&self.new_value),),
7196                encoder,
7197                offset,
7198                _depth,
7199            )
7200        }
7201    }
7202    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Notification, D>>
7203        fidl::encoding::Encode<TargetHandlerWatchNotificationResponse, D> for (T0,)
7204    {
7205        #[inline]
7206        unsafe fn encode(
7207            self,
7208            encoder: &mut fidl::encoding::Encoder<'_, D>,
7209            offset: usize,
7210            depth: fidl::encoding::Depth,
7211        ) -> fidl::Result<()> {
7212            encoder.debug_check_bounds::<TargetHandlerWatchNotificationResponse>(offset);
7213            // Zero out padding regions. There's no need to apply masks
7214            // because the unmasked parts will be overwritten by fields.
7215            // Write the fields.
7216            self.0.encode(encoder, offset + 0, depth)?;
7217            Ok(())
7218        }
7219    }
7220
7221    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7222        for TargetHandlerWatchNotificationResponse
7223    {
7224        #[inline(always)]
7225        fn new_empty() -> Self {
7226            Self { new_value: fidl::new_empty!(Notification, D) }
7227        }
7228
7229        #[inline]
7230        unsafe fn decode(
7231            &mut self,
7232            decoder: &mut fidl::encoding::Decoder<'_, D>,
7233            offset: usize,
7234            _depth: fidl::encoding::Depth,
7235        ) -> fidl::Result<()> {
7236            decoder.debug_check_bounds::<Self>(offset);
7237            // Verify that padding bytes are zero.
7238            fidl::decode!(Notification, D, &mut self.new_value, decoder, offset + 0, _depth)?;
7239            Ok(())
7240        }
7241    }
7242
7243    impl CustomPlayerApplicationSetting {
7244        #[inline(always)]
7245        fn max_ordinal_present(&self) -> u64 {
7246            if let Some(_) = self.current_value {
7247                return 4;
7248            }
7249            if let Some(_) = self.possible_values {
7250                return 3;
7251            }
7252            if let Some(_) = self.attribute_name {
7253                return 2;
7254            }
7255            if let Some(_) = self.attribute_id {
7256                return 1;
7257            }
7258            0
7259        }
7260    }
7261
7262    impl fidl::encoding::ValueTypeMarker for CustomPlayerApplicationSetting {
7263        type Borrowed<'a> = &'a Self;
7264        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7265            value
7266        }
7267    }
7268
7269    unsafe impl fidl::encoding::TypeMarker for CustomPlayerApplicationSetting {
7270        type Owned = Self;
7271
7272        #[inline(always)]
7273        fn inline_align(_context: fidl::encoding::Context) -> usize {
7274            8
7275        }
7276
7277        #[inline(always)]
7278        fn inline_size(_context: fidl::encoding::Context) -> usize {
7279            16
7280        }
7281    }
7282
7283    unsafe impl<D: fidl::encoding::ResourceDialect>
7284        fidl::encoding::Encode<CustomPlayerApplicationSetting, D>
7285        for &CustomPlayerApplicationSetting
7286    {
7287        unsafe fn encode(
7288            self,
7289            encoder: &mut fidl::encoding::Encoder<'_, D>,
7290            offset: usize,
7291            mut depth: fidl::encoding::Depth,
7292        ) -> fidl::Result<()> {
7293            encoder.debug_check_bounds::<CustomPlayerApplicationSetting>(offset);
7294            // Vector header
7295            let max_ordinal: u64 = self.max_ordinal_present();
7296            encoder.write_num(max_ordinal, offset);
7297            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7298            // Calling encoder.out_of_line_offset(0) is not allowed.
7299            if max_ordinal == 0 {
7300                return Ok(());
7301            }
7302            depth.increment()?;
7303            let envelope_size = 8;
7304            let bytes_len = max_ordinal as usize * envelope_size;
7305            #[allow(unused_variables)]
7306            let offset = encoder.out_of_line_offset(bytes_len);
7307            let mut _prev_end_offset: usize = 0;
7308            if 1 > max_ordinal {
7309                return Ok(());
7310            }
7311
7312            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7313            // are envelope_size bytes.
7314            let cur_offset: usize = (1 - 1) * envelope_size;
7315
7316            // Zero reserved fields.
7317            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7318
7319            // Safety:
7320            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7321            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7322            //   envelope_size bytes, there is always sufficient room.
7323            fidl::encoding::encode_in_envelope_optional::<u8, D>(
7324                self.attribute_id.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
7325                encoder,
7326                offset + cur_offset,
7327                depth,
7328            )?;
7329
7330            _prev_end_offset = cur_offset + envelope_size;
7331            if 2 > max_ordinal {
7332                return Ok(());
7333            }
7334
7335            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7336            // are envelope_size bytes.
7337            let cur_offset: usize = (2 - 1) * envelope_size;
7338
7339            // Zero reserved fields.
7340            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7341
7342            // Safety:
7343            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7344            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7345            //   envelope_size bytes, there is always sufficient room.
7346            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
7347                self.attribute_name.as_ref().map(
7348                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
7349                ),
7350                encoder,
7351                offset + cur_offset,
7352                depth,
7353            )?;
7354
7355            _prev_end_offset = cur_offset + envelope_size;
7356            if 3 > max_ordinal {
7357                return Ok(());
7358            }
7359
7360            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7361            // are envelope_size bytes.
7362            let cur_offset: usize = (3 - 1) * envelope_size;
7363
7364            // Zero reserved fields.
7365            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7366
7367            // Safety:
7368            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7369            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7370            //   envelope_size bytes, there is always sufficient room.
7371            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<CustomAttributeValue, 255>, D>(
7372            self.possible_values.as_ref().map(<fidl::encoding::Vector<CustomAttributeValue, 255> as fidl::encoding::ValueTypeMarker>::borrow),
7373            encoder, offset + cur_offset, depth
7374        )?;
7375
7376            _prev_end_offset = cur_offset + envelope_size;
7377            if 4 > max_ordinal {
7378                return Ok(());
7379            }
7380
7381            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7382            // are envelope_size bytes.
7383            let cur_offset: usize = (4 - 1) * envelope_size;
7384
7385            // Zero reserved fields.
7386            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7387
7388            // Safety:
7389            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7390            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7391            //   envelope_size bytes, there is always sufficient room.
7392            fidl::encoding::encode_in_envelope_optional::<u8, D>(
7393                self.current_value.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
7394                encoder,
7395                offset + cur_offset,
7396                depth,
7397            )?;
7398
7399            _prev_end_offset = cur_offset + envelope_size;
7400
7401            Ok(())
7402        }
7403    }
7404
7405    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7406        for CustomPlayerApplicationSetting
7407    {
7408        #[inline(always)]
7409        fn new_empty() -> Self {
7410            Self::default()
7411        }
7412
7413        unsafe fn decode(
7414            &mut self,
7415            decoder: &mut fidl::encoding::Decoder<'_, D>,
7416            offset: usize,
7417            mut depth: fidl::encoding::Depth,
7418        ) -> fidl::Result<()> {
7419            decoder.debug_check_bounds::<Self>(offset);
7420            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7421                None => return Err(fidl::Error::NotNullable),
7422                Some(len) => len,
7423            };
7424            // Calling decoder.out_of_line_offset(0) is not allowed.
7425            if len == 0 {
7426                return Ok(());
7427            };
7428            depth.increment()?;
7429            let envelope_size = 8;
7430            let bytes_len = len * envelope_size;
7431            let offset = decoder.out_of_line_offset(bytes_len)?;
7432            // Decode the envelope for each type.
7433            let mut _next_ordinal_to_read = 0;
7434            let mut next_offset = offset;
7435            let end_offset = offset + bytes_len;
7436            _next_ordinal_to_read += 1;
7437            if next_offset >= end_offset {
7438                return Ok(());
7439            }
7440
7441            // Decode unknown envelopes for gaps in ordinals.
7442            while _next_ordinal_to_read < 1 {
7443                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7444                _next_ordinal_to_read += 1;
7445                next_offset += envelope_size;
7446            }
7447
7448            let next_out_of_line = decoder.next_out_of_line();
7449            let handles_before = decoder.remaining_handles();
7450            if let Some((inlined, num_bytes, num_handles)) =
7451                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7452            {
7453                let member_inline_size =
7454                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7455                if inlined != (member_inline_size <= 4) {
7456                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7457                }
7458                let inner_offset;
7459                let mut inner_depth = depth.clone();
7460                if inlined {
7461                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7462                    inner_offset = next_offset;
7463                } else {
7464                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7465                    inner_depth.increment()?;
7466                }
7467                let val_ref = self.attribute_id.get_or_insert_with(|| fidl::new_empty!(u8, D));
7468                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
7469                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7470                {
7471                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7472                }
7473                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7474                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7475                }
7476            }
7477
7478            next_offset += envelope_size;
7479            _next_ordinal_to_read += 1;
7480            if next_offset >= end_offset {
7481                return Ok(());
7482            }
7483
7484            // Decode unknown envelopes for gaps in ordinals.
7485            while _next_ordinal_to_read < 2 {
7486                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7487                _next_ordinal_to_read += 1;
7488                next_offset += envelope_size;
7489            }
7490
7491            let next_out_of_line = decoder.next_out_of_line();
7492            let handles_before = decoder.remaining_handles();
7493            if let Some((inlined, num_bytes, num_handles)) =
7494                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7495            {
7496                let member_inline_size =
7497                    <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
7498                        decoder.context,
7499                    );
7500                if inlined != (member_inline_size <= 4) {
7501                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7502                }
7503                let inner_offset;
7504                let mut inner_depth = depth.clone();
7505                if inlined {
7506                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7507                    inner_offset = next_offset;
7508                } else {
7509                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7510                    inner_depth.increment()?;
7511                }
7512                let val_ref = self
7513                    .attribute_name
7514                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
7515                fidl::decode!(
7516                    fidl::encoding::BoundedString<255>,
7517                    D,
7518                    val_ref,
7519                    decoder,
7520                    inner_offset,
7521                    inner_depth
7522                )?;
7523                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7524                {
7525                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7526                }
7527                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7528                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7529                }
7530            }
7531
7532            next_offset += envelope_size;
7533            _next_ordinal_to_read += 1;
7534            if next_offset >= end_offset {
7535                return Ok(());
7536            }
7537
7538            // Decode unknown envelopes for gaps in ordinals.
7539            while _next_ordinal_to_read < 3 {
7540                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7541                _next_ordinal_to_read += 1;
7542                next_offset += envelope_size;
7543            }
7544
7545            let next_out_of_line = decoder.next_out_of_line();
7546            let handles_before = decoder.remaining_handles();
7547            if let Some((inlined, num_bytes, num_handles)) =
7548                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7549            {
7550                let member_inline_size = <fidl::encoding::Vector<CustomAttributeValue, 255> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7551                if inlined != (member_inline_size <= 4) {
7552                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7553                }
7554                let inner_offset;
7555                let mut inner_depth = depth.clone();
7556                if inlined {
7557                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7558                    inner_offset = next_offset;
7559                } else {
7560                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7561                    inner_depth.increment()?;
7562                }
7563                let val_ref = self.possible_values.get_or_insert_with(
7564                    || fidl::new_empty!(fidl::encoding::Vector<CustomAttributeValue, 255>, D),
7565                );
7566                fidl::decode!(fidl::encoding::Vector<CustomAttributeValue, 255>, D, val_ref, decoder, inner_offset, inner_depth)?;
7567                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7568                {
7569                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7570                }
7571                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7572                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7573                }
7574            }
7575
7576            next_offset += envelope_size;
7577            _next_ordinal_to_read += 1;
7578            if next_offset >= end_offset {
7579                return Ok(());
7580            }
7581
7582            // Decode unknown envelopes for gaps in ordinals.
7583            while _next_ordinal_to_read < 4 {
7584                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7585                _next_ordinal_to_read += 1;
7586                next_offset += envelope_size;
7587            }
7588
7589            let next_out_of_line = decoder.next_out_of_line();
7590            let handles_before = decoder.remaining_handles();
7591            if let Some((inlined, num_bytes, num_handles)) =
7592                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7593            {
7594                let member_inline_size =
7595                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7596                if inlined != (member_inline_size <= 4) {
7597                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7598                }
7599                let inner_offset;
7600                let mut inner_depth = depth.clone();
7601                if inlined {
7602                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7603                    inner_offset = next_offset;
7604                } else {
7605                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7606                    inner_depth.increment()?;
7607                }
7608                let val_ref = self.current_value.get_or_insert_with(|| fidl::new_empty!(u8, D));
7609                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
7610                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7611                {
7612                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7613                }
7614                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7615                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7616                }
7617            }
7618
7619            next_offset += envelope_size;
7620
7621            // Decode the remaining unknown envelopes.
7622            while next_offset < end_offset {
7623                _next_ordinal_to_read += 1;
7624                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7625                next_offset += envelope_size;
7626            }
7627
7628            Ok(())
7629        }
7630    }
7631
7632    impl FolderItem {
7633        #[inline(always)]
7634        fn max_ordinal_present(&self) -> u64 {
7635            if let Some(_) = self.displayable_name {
7636                return 4;
7637            }
7638            if let Some(_) = self.is_playable {
7639                return 3;
7640            }
7641            if let Some(_) = self.folder_type {
7642                return 2;
7643            }
7644            if let Some(_) = self.folder_uid {
7645                return 1;
7646            }
7647            0
7648        }
7649    }
7650
7651    impl fidl::encoding::ValueTypeMarker for FolderItem {
7652        type Borrowed<'a> = &'a Self;
7653        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7654            value
7655        }
7656    }
7657
7658    unsafe impl fidl::encoding::TypeMarker for FolderItem {
7659        type Owned = Self;
7660
7661        #[inline(always)]
7662        fn inline_align(_context: fidl::encoding::Context) -> usize {
7663            8
7664        }
7665
7666        #[inline(always)]
7667        fn inline_size(_context: fidl::encoding::Context) -> usize {
7668            16
7669        }
7670    }
7671
7672    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FolderItem, D>
7673        for &FolderItem
7674    {
7675        unsafe fn encode(
7676            self,
7677            encoder: &mut fidl::encoding::Encoder<'_, D>,
7678            offset: usize,
7679            mut depth: fidl::encoding::Depth,
7680        ) -> fidl::Result<()> {
7681            encoder.debug_check_bounds::<FolderItem>(offset);
7682            // Vector header
7683            let max_ordinal: u64 = self.max_ordinal_present();
7684            encoder.write_num(max_ordinal, offset);
7685            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7686            // Calling encoder.out_of_line_offset(0) is not allowed.
7687            if max_ordinal == 0 {
7688                return Ok(());
7689            }
7690            depth.increment()?;
7691            let envelope_size = 8;
7692            let bytes_len = max_ordinal as usize * envelope_size;
7693            #[allow(unused_variables)]
7694            let offset = encoder.out_of_line_offset(bytes_len);
7695            let mut _prev_end_offset: usize = 0;
7696            if 1 > max_ordinal {
7697                return Ok(());
7698            }
7699
7700            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7701            // are envelope_size bytes.
7702            let cur_offset: usize = (1 - 1) * envelope_size;
7703
7704            // Zero reserved fields.
7705            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7706
7707            // Safety:
7708            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7709            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7710            //   envelope_size bytes, there is always sufficient room.
7711            fidl::encoding::encode_in_envelope_optional::<u64, D>(
7712                self.folder_uid.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7713                encoder,
7714                offset + cur_offset,
7715                depth,
7716            )?;
7717
7718            _prev_end_offset = cur_offset + envelope_size;
7719            if 2 > max_ordinal {
7720                return Ok(());
7721            }
7722
7723            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7724            // are envelope_size bytes.
7725            let cur_offset: usize = (2 - 1) * envelope_size;
7726
7727            // Zero reserved fields.
7728            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7729
7730            // Safety:
7731            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7732            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7733            //   envelope_size bytes, there is always sufficient room.
7734            fidl::encoding::encode_in_envelope_optional::<FolderType, D>(
7735                self.folder_type
7736                    .as_ref()
7737                    .map(<FolderType as fidl::encoding::ValueTypeMarker>::borrow),
7738                encoder,
7739                offset + cur_offset,
7740                depth,
7741            )?;
7742
7743            _prev_end_offset = cur_offset + envelope_size;
7744            if 3 > max_ordinal {
7745                return Ok(());
7746            }
7747
7748            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7749            // are envelope_size bytes.
7750            let cur_offset: usize = (3 - 1) * envelope_size;
7751
7752            // Zero reserved fields.
7753            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7754
7755            // Safety:
7756            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7757            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7758            //   envelope_size bytes, there is always sufficient room.
7759            fidl::encoding::encode_in_envelope_optional::<bool, D>(
7760                self.is_playable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
7761                encoder,
7762                offset + cur_offset,
7763                depth,
7764            )?;
7765
7766            _prev_end_offset = cur_offset + envelope_size;
7767            if 4 > max_ordinal {
7768                return Ok(());
7769            }
7770
7771            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7772            // are envelope_size bytes.
7773            let cur_offset: usize = (4 - 1) * envelope_size;
7774
7775            // Zero reserved fields.
7776            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7777
7778            // Safety:
7779            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7780            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7781            //   envelope_size bytes, there is always sufficient room.
7782            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
7783                self.displayable_name.as_ref().map(
7784                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
7785                ),
7786                encoder,
7787                offset + cur_offset,
7788                depth,
7789            )?;
7790
7791            _prev_end_offset = cur_offset + envelope_size;
7792
7793            Ok(())
7794        }
7795    }
7796
7797    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FolderItem {
7798        #[inline(always)]
7799        fn new_empty() -> Self {
7800            Self::default()
7801        }
7802
7803        unsafe fn decode(
7804            &mut self,
7805            decoder: &mut fidl::encoding::Decoder<'_, D>,
7806            offset: usize,
7807            mut depth: fidl::encoding::Depth,
7808        ) -> fidl::Result<()> {
7809            decoder.debug_check_bounds::<Self>(offset);
7810            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7811                None => return Err(fidl::Error::NotNullable),
7812                Some(len) => len,
7813            };
7814            // Calling decoder.out_of_line_offset(0) is not allowed.
7815            if len == 0 {
7816                return Ok(());
7817            };
7818            depth.increment()?;
7819            let envelope_size = 8;
7820            let bytes_len = len * envelope_size;
7821            let offset = decoder.out_of_line_offset(bytes_len)?;
7822            // Decode the envelope for each type.
7823            let mut _next_ordinal_to_read = 0;
7824            let mut next_offset = offset;
7825            let end_offset = offset + bytes_len;
7826            _next_ordinal_to_read += 1;
7827            if next_offset >= end_offset {
7828                return Ok(());
7829            }
7830
7831            // Decode unknown envelopes for gaps in ordinals.
7832            while _next_ordinal_to_read < 1 {
7833                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7834                _next_ordinal_to_read += 1;
7835                next_offset += envelope_size;
7836            }
7837
7838            let next_out_of_line = decoder.next_out_of_line();
7839            let handles_before = decoder.remaining_handles();
7840            if let Some((inlined, num_bytes, num_handles)) =
7841                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7842            {
7843                let member_inline_size =
7844                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7845                if inlined != (member_inline_size <= 4) {
7846                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7847                }
7848                let inner_offset;
7849                let mut inner_depth = depth.clone();
7850                if inlined {
7851                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7852                    inner_offset = next_offset;
7853                } else {
7854                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7855                    inner_depth.increment()?;
7856                }
7857                let val_ref = self.folder_uid.get_or_insert_with(|| fidl::new_empty!(u64, D));
7858                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
7859                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7860                {
7861                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7862                }
7863                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7864                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7865                }
7866            }
7867
7868            next_offset += envelope_size;
7869            _next_ordinal_to_read += 1;
7870            if next_offset >= end_offset {
7871                return Ok(());
7872            }
7873
7874            // Decode unknown envelopes for gaps in ordinals.
7875            while _next_ordinal_to_read < 2 {
7876                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7877                _next_ordinal_to_read += 1;
7878                next_offset += envelope_size;
7879            }
7880
7881            let next_out_of_line = decoder.next_out_of_line();
7882            let handles_before = decoder.remaining_handles();
7883            if let Some((inlined, num_bytes, num_handles)) =
7884                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7885            {
7886                let member_inline_size =
7887                    <FolderType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7888                if inlined != (member_inline_size <= 4) {
7889                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7890                }
7891                let inner_offset;
7892                let mut inner_depth = depth.clone();
7893                if inlined {
7894                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7895                    inner_offset = next_offset;
7896                } else {
7897                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7898                    inner_depth.increment()?;
7899                }
7900                let val_ref =
7901                    self.folder_type.get_or_insert_with(|| fidl::new_empty!(FolderType, D));
7902                fidl::decode!(FolderType, D, val_ref, decoder, inner_offset, inner_depth)?;
7903                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7904                {
7905                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7906                }
7907                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7908                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7909                }
7910            }
7911
7912            next_offset += envelope_size;
7913            _next_ordinal_to_read += 1;
7914            if next_offset >= end_offset {
7915                return Ok(());
7916            }
7917
7918            // Decode unknown envelopes for gaps in ordinals.
7919            while _next_ordinal_to_read < 3 {
7920                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7921                _next_ordinal_to_read += 1;
7922                next_offset += envelope_size;
7923            }
7924
7925            let next_out_of_line = decoder.next_out_of_line();
7926            let handles_before = decoder.remaining_handles();
7927            if let Some((inlined, num_bytes, num_handles)) =
7928                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7929            {
7930                let member_inline_size =
7931                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7932                if inlined != (member_inline_size <= 4) {
7933                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7934                }
7935                let inner_offset;
7936                let mut inner_depth = depth.clone();
7937                if inlined {
7938                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7939                    inner_offset = next_offset;
7940                } else {
7941                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7942                    inner_depth.increment()?;
7943                }
7944                let val_ref = self.is_playable.get_or_insert_with(|| fidl::new_empty!(bool, D));
7945                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
7946                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7947                {
7948                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7949                }
7950                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7951                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7952                }
7953            }
7954
7955            next_offset += envelope_size;
7956            _next_ordinal_to_read += 1;
7957            if next_offset >= end_offset {
7958                return Ok(());
7959            }
7960
7961            // Decode unknown envelopes for gaps in ordinals.
7962            while _next_ordinal_to_read < 4 {
7963                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7964                _next_ordinal_to_read += 1;
7965                next_offset += envelope_size;
7966            }
7967
7968            let next_out_of_line = decoder.next_out_of_line();
7969            let handles_before = decoder.remaining_handles();
7970            if let Some((inlined, num_bytes, num_handles)) =
7971                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7972            {
7973                let member_inline_size =
7974                    <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
7975                        decoder.context,
7976                    );
7977                if inlined != (member_inline_size <= 4) {
7978                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7979                }
7980                let inner_offset;
7981                let mut inner_depth = depth.clone();
7982                if inlined {
7983                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7984                    inner_offset = next_offset;
7985                } else {
7986                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7987                    inner_depth.increment()?;
7988                }
7989                let val_ref = self
7990                    .displayable_name
7991                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
7992                fidl::decode!(
7993                    fidl::encoding::BoundedString<255>,
7994                    D,
7995                    val_ref,
7996                    decoder,
7997                    inner_offset,
7998                    inner_depth
7999                )?;
8000                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8001                {
8002                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8003                }
8004                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8005                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8006                }
8007            }
8008
8009            next_offset += envelope_size;
8010
8011            // Decode the remaining unknown envelopes.
8012            while next_offset < end_offset {
8013                _next_ordinal_to_read += 1;
8014                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8015                next_offset += envelope_size;
8016            }
8017
8018            Ok(())
8019        }
8020    }
8021
8022    impl MediaAttributes {
8023        #[inline(always)]
8024        fn max_ordinal_present(&self) -> u64 {
8025            if let Some(_) = self.playing_time {
8026                return 7;
8027            }
8028            if let Some(_) = self.genre {
8029                return 6;
8030            }
8031            if let Some(_) = self.total_number_of_tracks {
8032                return 5;
8033            }
8034            if let Some(_) = self.track_number {
8035                return 4;
8036            }
8037            if let Some(_) = self.album_name {
8038                return 3;
8039            }
8040            if let Some(_) = self.artist_name {
8041                return 2;
8042            }
8043            if let Some(_) = self.title {
8044                return 1;
8045            }
8046            0
8047        }
8048    }
8049
8050    impl fidl::encoding::ValueTypeMarker for MediaAttributes {
8051        type Borrowed<'a> = &'a Self;
8052        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8053            value
8054        }
8055    }
8056
8057    unsafe impl fidl::encoding::TypeMarker for MediaAttributes {
8058        type Owned = Self;
8059
8060        #[inline(always)]
8061        fn inline_align(_context: fidl::encoding::Context) -> usize {
8062            8
8063        }
8064
8065        #[inline(always)]
8066        fn inline_size(_context: fidl::encoding::Context) -> usize {
8067            16
8068        }
8069    }
8070
8071    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MediaAttributes, D>
8072        for &MediaAttributes
8073    {
8074        unsafe fn encode(
8075            self,
8076            encoder: &mut fidl::encoding::Encoder<'_, D>,
8077            offset: usize,
8078            mut depth: fidl::encoding::Depth,
8079        ) -> fidl::Result<()> {
8080            encoder.debug_check_bounds::<MediaAttributes>(offset);
8081            // Vector header
8082            let max_ordinal: u64 = self.max_ordinal_present();
8083            encoder.write_num(max_ordinal, offset);
8084            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8085            // Calling encoder.out_of_line_offset(0) is not allowed.
8086            if max_ordinal == 0 {
8087                return Ok(());
8088            }
8089            depth.increment()?;
8090            let envelope_size = 8;
8091            let bytes_len = max_ordinal as usize * envelope_size;
8092            #[allow(unused_variables)]
8093            let offset = encoder.out_of_line_offset(bytes_len);
8094            let mut _prev_end_offset: usize = 0;
8095            if 1 > max_ordinal {
8096                return Ok(());
8097            }
8098
8099            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8100            // are envelope_size bytes.
8101            let cur_offset: usize = (1 - 1) * envelope_size;
8102
8103            // Zero reserved fields.
8104            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8105
8106            // Safety:
8107            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8108            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8109            //   envelope_size bytes, there is always sufficient room.
8110            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
8111            self.title.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
8112            encoder, offset + cur_offset, depth
8113        )?;
8114
8115            _prev_end_offset = cur_offset + envelope_size;
8116            if 2 > max_ordinal {
8117                return Ok(());
8118            }
8119
8120            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8121            // are envelope_size bytes.
8122            let cur_offset: usize = (2 - 1) * envelope_size;
8123
8124            // Zero reserved fields.
8125            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8126
8127            // Safety:
8128            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8129            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8130            //   envelope_size bytes, there is always sufficient room.
8131            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
8132            self.artist_name.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
8133            encoder, offset + cur_offset, depth
8134        )?;
8135
8136            _prev_end_offset = cur_offset + envelope_size;
8137            if 3 > max_ordinal {
8138                return Ok(());
8139            }
8140
8141            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8142            // are envelope_size bytes.
8143            let cur_offset: usize = (3 - 1) * envelope_size;
8144
8145            // Zero reserved fields.
8146            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8147
8148            // Safety:
8149            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8150            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8151            //   envelope_size bytes, there is always sufficient room.
8152            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
8153            self.album_name.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
8154            encoder, offset + cur_offset, depth
8155        )?;
8156
8157            _prev_end_offset = cur_offset + envelope_size;
8158            if 4 > max_ordinal {
8159                return Ok(());
8160            }
8161
8162            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8163            // are envelope_size bytes.
8164            let cur_offset: usize = (4 - 1) * envelope_size;
8165
8166            // Zero reserved fields.
8167            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8168
8169            // Safety:
8170            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8171            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8172            //   envelope_size bytes, there is always sufficient room.
8173            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
8174            self.track_number.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
8175            encoder, offset + cur_offset, depth
8176        )?;
8177
8178            _prev_end_offset = cur_offset + envelope_size;
8179            if 5 > max_ordinal {
8180                return Ok(());
8181            }
8182
8183            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8184            // are envelope_size bytes.
8185            let cur_offset: usize = (5 - 1) * envelope_size;
8186
8187            // Zero reserved fields.
8188            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8189
8190            // Safety:
8191            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8192            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8193            //   envelope_size bytes, there is always sufficient room.
8194            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
8195            self.total_number_of_tracks.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
8196            encoder, offset + cur_offset, depth
8197        )?;
8198
8199            _prev_end_offset = cur_offset + envelope_size;
8200            if 6 > max_ordinal {
8201                return Ok(());
8202            }
8203
8204            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8205            // are envelope_size bytes.
8206            let cur_offset: usize = (6 - 1) * envelope_size;
8207
8208            // Zero reserved fields.
8209            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8210
8211            // Safety:
8212            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8213            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8214            //   envelope_size bytes, there is always sufficient room.
8215            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
8216            self.genre.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
8217            encoder, offset + cur_offset, depth
8218        )?;
8219
8220            _prev_end_offset = cur_offset + envelope_size;
8221            if 7 > max_ordinal {
8222                return Ok(());
8223            }
8224
8225            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8226            // are envelope_size bytes.
8227            let cur_offset: usize = (7 - 1) * envelope_size;
8228
8229            // Zero reserved fields.
8230            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8231
8232            // Safety:
8233            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8234            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8235            //   envelope_size bytes, there is always sufficient room.
8236            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
8237            self.playing_time.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
8238            encoder, offset + cur_offset, depth
8239        )?;
8240
8241            _prev_end_offset = cur_offset + envelope_size;
8242
8243            Ok(())
8244        }
8245    }
8246
8247    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MediaAttributes {
8248        #[inline(always)]
8249        fn new_empty() -> Self {
8250            Self::default()
8251        }
8252
8253        unsafe fn decode(
8254            &mut self,
8255            decoder: &mut fidl::encoding::Decoder<'_, D>,
8256            offset: usize,
8257            mut depth: fidl::encoding::Depth,
8258        ) -> fidl::Result<()> {
8259            decoder.debug_check_bounds::<Self>(offset);
8260            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8261                None => return Err(fidl::Error::NotNullable),
8262                Some(len) => len,
8263            };
8264            // Calling decoder.out_of_line_offset(0) is not allowed.
8265            if len == 0 {
8266                return Ok(());
8267            };
8268            depth.increment()?;
8269            let envelope_size = 8;
8270            let bytes_len = len * envelope_size;
8271            let offset = decoder.out_of_line_offset(bytes_len)?;
8272            // Decode the envelope for each type.
8273            let mut _next_ordinal_to_read = 0;
8274            let mut next_offset = offset;
8275            let end_offset = offset + bytes_len;
8276            _next_ordinal_to_read += 1;
8277            if next_offset >= end_offset {
8278                return Ok(());
8279            }
8280
8281            // Decode unknown envelopes for gaps in ordinals.
8282            while _next_ordinal_to_read < 1 {
8283                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8284                _next_ordinal_to_read += 1;
8285                next_offset += envelope_size;
8286            }
8287
8288            let next_out_of_line = decoder.next_out_of_line();
8289            let handles_before = decoder.remaining_handles();
8290            if let Some((inlined, num_bytes, num_handles)) =
8291                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8292            {
8293                let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8294                if inlined != (member_inline_size <= 4) {
8295                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8296                }
8297                let inner_offset;
8298                let mut inner_depth = depth.clone();
8299                if inlined {
8300                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8301                    inner_offset = next_offset;
8302                } else {
8303                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8304                    inner_depth.increment()?;
8305                }
8306                let val_ref = self.title.get_or_insert_with(|| {
8307                    fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
8308                });
8309                fidl::decode!(
8310                    fidl::encoding::BoundedString<65535>,
8311                    D,
8312                    val_ref,
8313                    decoder,
8314                    inner_offset,
8315                    inner_depth
8316                )?;
8317                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8318                {
8319                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8320                }
8321                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8322                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8323                }
8324            }
8325
8326            next_offset += envelope_size;
8327            _next_ordinal_to_read += 1;
8328            if next_offset >= end_offset {
8329                return Ok(());
8330            }
8331
8332            // Decode unknown envelopes for gaps in ordinals.
8333            while _next_ordinal_to_read < 2 {
8334                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8335                _next_ordinal_to_read += 1;
8336                next_offset += envelope_size;
8337            }
8338
8339            let next_out_of_line = decoder.next_out_of_line();
8340            let handles_before = decoder.remaining_handles();
8341            if let Some((inlined, num_bytes, num_handles)) =
8342                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8343            {
8344                let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8345                if inlined != (member_inline_size <= 4) {
8346                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8347                }
8348                let inner_offset;
8349                let mut inner_depth = depth.clone();
8350                if inlined {
8351                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8352                    inner_offset = next_offset;
8353                } else {
8354                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8355                    inner_depth.increment()?;
8356                }
8357                let val_ref = self.artist_name.get_or_insert_with(|| {
8358                    fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
8359                });
8360                fidl::decode!(
8361                    fidl::encoding::BoundedString<65535>,
8362                    D,
8363                    val_ref,
8364                    decoder,
8365                    inner_offset,
8366                    inner_depth
8367                )?;
8368                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8369                {
8370                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8371                }
8372                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8373                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8374                }
8375            }
8376
8377            next_offset += envelope_size;
8378            _next_ordinal_to_read += 1;
8379            if next_offset >= end_offset {
8380                return Ok(());
8381            }
8382
8383            // Decode unknown envelopes for gaps in ordinals.
8384            while _next_ordinal_to_read < 3 {
8385                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8386                _next_ordinal_to_read += 1;
8387                next_offset += envelope_size;
8388            }
8389
8390            let next_out_of_line = decoder.next_out_of_line();
8391            let handles_before = decoder.remaining_handles();
8392            if let Some((inlined, num_bytes, num_handles)) =
8393                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8394            {
8395                let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8396                if inlined != (member_inline_size <= 4) {
8397                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8398                }
8399                let inner_offset;
8400                let mut inner_depth = depth.clone();
8401                if inlined {
8402                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8403                    inner_offset = next_offset;
8404                } else {
8405                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8406                    inner_depth.increment()?;
8407                }
8408                let val_ref = self.album_name.get_or_insert_with(|| {
8409                    fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
8410                });
8411                fidl::decode!(
8412                    fidl::encoding::BoundedString<65535>,
8413                    D,
8414                    val_ref,
8415                    decoder,
8416                    inner_offset,
8417                    inner_depth
8418                )?;
8419                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8420                {
8421                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8422                }
8423                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8424                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8425                }
8426            }
8427
8428            next_offset += envelope_size;
8429            _next_ordinal_to_read += 1;
8430            if next_offset >= end_offset {
8431                return Ok(());
8432            }
8433
8434            // Decode unknown envelopes for gaps in ordinals.
8435            while _next_ordinal_to_read < 4 {
8436                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8437                _next_ordinal_to_read += 1;
8438                next_offset += envelope_size;
8439            }
8440
8441            let next_out_of_line = decoder.next_out_of_line();
8442            let handles_before = decoder.remaining_handles();
8443            if let Some((inlined, num_bytes, num_handles)) =
8444                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8445            {
8446                let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8447                if inlined != (member_inline_size <= 4) {
8448                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8449                }
8450                let inner_offset;
8451                let mut inner_depth = depth.clone();
8452                if inlined {
8453                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8454                    inner_offset = next_offset;
8455                } else {
8456                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8457                    inner_depth.increment()?;
8458                }
8459                let val_ref = self.track_number.get_or_insert_with(|| {
8460                    fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
8461                });
8462                fidl::decode!(
8463                    fidl::encoding::BoundedString<65535>,
8464                    D,
8465                    val_ref,
8466                    decoder,
8467                    inner_offset,
8468                    inner_depth
8469                )?;
8470                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8471                {
8472                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8473                }
8474                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8475                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8476                }
8477            }
8478
8479            next_offset += envelope_size;
8480            _next_ordinal_to_read += 1;
8481            if next_offset >= end_offset {
8482                return Ok(());
8483            }
8484
8485            // Decode unknown envelopes for gaps in ordinals.
8486            while _next_ordinal_to_read < 5 {
8487                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8488                _next_ordinal_to_read += 1;
8489                next_offset += envelope_size;
8490            }
8491
8492            let next_out_of_line = decoder.next_out_of_line();
8493            let handles_before = decoder.remaining_handles();
8494            if let Some((inlined, num_bytes, num_handles)) =
8495                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8496            {
8497                let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8498                if inlined != (member_inline_size <= 4) {
8499                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8500                }
8501                let inner_offset;
8502                let mut inner_depth = depth.clone();
8503                if inlined {
8504                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8505                    inner_offset = next_offset;
8506                } else {
8507                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8508                    inner_depth.increment()?;
8509                }
8510                let val_ref = self.total_number_of_tracks.get_or_insert_with(|| {
8511                    fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
8512                });
8513                fidl::decode!(
8514                    fidl::encoding::BoundedString<65535>,
8515                    D,
8516                    val_ref,
8517                    decoder,
8518                    inner_offset,
8519                    inner_depth
8520                )?;
8521                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8522                {
8523                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8524                }
8525                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8526                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8527                }
8528            }
8529
8530            next_offset += envelope_size;
8531            _next_ordinal_to_read += 1;
8532            if next_offset >= end_offset {
8533                return Ok(());
8534            }
8535
8536            // Decode unknown envelopes for gaps in ordinals.
8537            while _next_ordinal_to_read < 6 {
8538                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8539                _next_ordinal_to_read += 1;
8540                next_offset += envelope_size;
8541            }
8542
8543            let next_out_of_line = decoder.next_out_of_line();
8544            let handles_before = decoder.remaining_handles();
8545            if let Some((inlined, num_bytes, num_handles)) =
8546                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8547            {
8548                let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8549                if inlined != (member_inline_size <= 4) {
8550                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8551                }
8552                let inner_offset;
8553                let mut inner_depth = depth.clone();
8554                if inlined {
8555                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8556                    inner_offset = next_offset;
8557                } else {
8558                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8559                    inner_depth.increment()?;
8560                }
8561                let val_ref = self.genre.get_or_insert_with(|| {
8562                    fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
8563                });
8564                fidl::decode!(
8565                    fidl::encoding::BoundedString<65535>,
8566                    D,
8567                    val_ref,
8568                    decoder,
8569                    inner_offset,
8570                    inner_depth
8571                )?;
8572                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8573                {
8574                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8575                }
8576                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8577                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8578                }
8579            }
8580
8581            next_offset += envelope_size;
8582            _next_ordinal_to_read += 1;
8583            if next_offset >= end_offset {
8584                return Ok(());
8585            }
8586
8587            // Decode unknown envelopes for gaps in ordinals.
8588            while _next_ordinal_to_read < 7 {
8589                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8590                _next_ordinal_to_read += 1;
8591                next_offset += envelope_size;
8592            }
8593
8594            let next_out_of_line = decoder.next_out_of_line();
8595            let handles_before = decoder.remaining_handles();
8596            if let Some((inlined, num_bytes, num_handles)) =
8597                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8598            {
8599                let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8600                if inlined != (member_inline_size <= 4) {
8601                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8602                }
8603                let inner_offset;
8604                let mut inner_depth = depth.clone();
8605                if inlined {
8606                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8607                    inner_offset = next_offset;
8608                } else {
8609                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8610                    inner_depth.increment()?;
8611                }
8612                let val_ref = self.playing_time.get_or_insert_with(|| {
8613                    fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
8614                });
8615                fidl::decode!(
8616                    fidl::encoding::BoundedString<65535>,
8617                    D,
8618                    val_ref,
8619                    decoder,
8620                    inner_offset,
8621                    inner_depth
8622                )?;
8623                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8624                {
8625                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8626                }
8627                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8628                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8629                }
8630            }
8631
8632            next_offset += envelope_size;
8633
8634            // Decode the remaining unknown envelopes.
8635            while next_offset < end_offset {
8636                _next_ordinal_to_read += 1;
8637                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8638                next_offset += envelope_size;
8639            }
8640
8641            Ok(())
8642        }
8643    }
8644
8645    impl MediaElementItem {
8646        #[inline(always)]
8647        fn max_ordinal_present(&self) -> u64 {
8648            if let Some(_) = self.attributes {
8649                return 4;
8650            }
8651            if let Some(_) = self.displayable_name {
8652                return 3;
8653            }
8654            if let Some(_) = self.media_type {
8655                return 2;
8656            }
8657            if let Some(_) = self.media_element_uid {
8658                return 1;
8659            }
8660            0
8661        }
8662    }
8663
8664    impl fidl::encoding::ValueTypeMarker for MediaElementItem {
8665        type Borrowed<'a> = &'a Self;
8666        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8667            value
8668        }
8669    }
8670
8671    unsafe impl fidl::encoding::TypeMarker for MediaElementItem {
8672        type Owned = Self;
8673
8674        #[inline(always)]
8675        fn inline_align(_context: fidl::encoding::Context) -> usize {
8676            8
8677        }
8678
8679        #[inline(always)]
8680        fn inline_size(_context: fidl::encoding::Context) -> usize {
8681            16
8682        }
8683    }
8684
8685    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MediaElementItem, D>
8686        for &MediaElementItem
8687    {
8688        unsafe fn encode(
8689            self,
8690            encoder: &mut fidl::encoding::Encoder<'_, D>,
8691            offset: usize,
8692            mut depth: fidl::encoding::Depth,
8693        ) -> fidl::Result<()> {
8694            encoder.debug_check_bounds::<MediaElementItem>(offset);
8695            // Vector header
8696            let max_ordinal: u64 = self.max_ordinal_present();
8697            encoder.write_num(max_ordinal, offset);
8698            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8699            // Calling encoder.out_of_line_offset(0) is not allowed.
8700            if max_ordinal == 0 {
8701                return Ok(());
8702            }
8703            depth.increment()?;
8704            let envelope_size = 8;
8705            let bytes_len = max_ordinal as usize * envelope_size;
8706            #[allow(unused_variables)]
8707            let offset = encoder.out_of_line_offset(bytes_len);
8708            let mut _prev_end_offset: usize = 0;
8709            if 1 > max_ordinal {
8710                return Ok(());
8711            }
8712
8713            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8714            // are envelope_size bytes.
8715            let cur_offset: usize = (1 - 1) * envelope_size;
8716
8717            // Zero reserved fields.
8718            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8719
8720            // Safety:
8721            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8722            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8723            //   envelope_size bytes, there is always sufficient room.
8724            fidl::encoding::encode_in_envelope_optional::<u64, D>(
8725                self.media_element_uid
8726                    .as_ref()
8727                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8728                encoder,
8729                offset + cur_offset,
8730                depth,
8731            )?;
8732
8733            _prev_end_offset = cur_offset + envelope_size;
8734            if 2 > max_ordinal {
8735                return Ok(());
8736            }
8737
8738            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8739            // are envelope_size bytes.
8740            let cur_offset: usize = (2 - 1) * envelope_size;
8741
8742            // Zero reserved fields.
8743            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8744
8745            // Safety:
8746            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8747            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8748            //   envelope_size bytes, there is always sufficient room.
8749            fidl::encoding::encode_in_envelope_optional::<MediaType, D>(
8750                self.media_type
8751                    .as_ref()
8752                    .map(<MediaType as fidl::encoding::ValueTypeMarker>::borrow),
8753                encoder,
8754                offset + cur_offset,
8755                depth,
8756            )?;
8757
8758            _prev_end_offset = cur_offset + envelope_size;
8759            if 3 > max_ordinal {
8760                return Ok(());
8761            }
8762
8763            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8764            // are envelope_size bytes.
8765            let cur_offset: usize = (3 - 1) * envelope_size;
8766
8767            // Zero reserved fields.
8768            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8769
8770            // Safety:
8771            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8772            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8773            //   envelope_size bytes, there is always sufficient room.
8774            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
8775                self.displayable_name.as_ref().map(
8776                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
8777                ),
8778                encoder,
8779                offset + cur_offset,
8780                depth,
8781            )?;
8782
8783            _prev_end_offset = cur_offset + envelope_size;
8784            if 4 > max_ordinal {
8785                return Ok(());
8786            }
8787
8788            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8789            // are envelope_size bytes.
8790            let cur_offset: usize = (4 - 1) * envelope_size;
8791
8792            // Zero reserved fields.
8793            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8794
8795            // Safety:
8796            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8797            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8798            //   envelope_size bytes, there is always sufficient room.
8799            fidl::encoding::encode_in_envelope_optional::<MediaAttributes, D>(
8800                self.attributes
8801                    .as_ref()
8802                    .map(<MediaAttributes as fidl::encoding::ValueTypeMarker>::borrow),
8803                encoder,
8804                offset + cur_offset,
8805                depth,
8806            )?;
8807
8808            _prev_end_offset = cur_offset + envelope_size;
8809
8810            Ok(())
8811        }
8812    }
8813
8814    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MediaElementItem {
8815        #[inline(always)]
8816        fn new_empty() -> Self {
8817            Self::default()
8818        }
8819
8820        unsafe fn decode(
8821            &mut self,
8822            decoder: &mut fidl::encoding::Decoder<'_, D>,
8823            offset: usize,
8824            mut depth: fidl::encoding::Depth,
8825        ) -> fidl::Result<()> {
8826            decoder.debug_check_bounds::<Self>(offset);
8827            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8828                None => return Err(fidl::Error::NotNullable),
8829                Some(len) => len,
8830            };
8831            // Calling decoder.out_of_line_offset(0) is not allowed.
8832            if len == 0 {
8833                return Ok(());
8834            };
8835            depth.increment()?;
8836            let envelope_size = 8;
8837            let bytes_len = len * envelope_size;
8838            let offset = decoder.out_of_line_offset(bytes_len)?;
8839            // Decode the envelope for each type.
8840            let mut _next_ordinal_to_read = 0;
8841            let mut next_offset = offset;
8842            let end_offset = offset + bytes_len;
8843            _next_ordinal_to_read += 1;
8844            if next_offset >= end_offset {
8845                return Ok(());
8846            }
8847
8848            // Decode unknown envelopes for gaps in ordinals.
8849            while _next_ordinal_to_read < 1 {
8850                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8851                _next_ordinal_to_read += 1;
8852                next_offset += envelope_size;
8853            }
8854
8855            let next_out_of_line = decoder.next_out_of_line();
8856            let handles_before = decoder.remaining_handles();
8857            if let Some((inlined, num_bytes, num_handles)) =
8858                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8859            {
8860                let member_inline_size =
8861                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8862                if inlined != (member_inline_size <= 4) {
8863                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8864                }
8865                let inner_offset;
8866                let mut inner_depth = depth.clone();
8867                if inlined {
8868                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8869                    inner_offset = next_offset;
8870                } else {
8871                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8872                    inner_depth.increment()?;
8873                }
8874                let val_ref =
8875                    self.media_element_uid.get_or_insert_with(|| fidl::new_empty!(u64, D));
8876                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
8877                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8878                {
8879                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8880                }
8881                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8882                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8883                }
8884            }
8885
8886            next_offset += envelope_size;
8887            _next_ordinal_to_read += 1;
8888            if next_offset >= end_offset {
8889                return Ok(());
8890            }
8891
8892            // Decode unknown envelopes for gaps in ordinals.
8893            while _next_ordinal_to_read < 2 {
8894                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8895                _next_ordinal_to_read += 1;
8896                next_offset += envelope_size;
8897            }
8898
8899            let next_out_of_line = decoder.next_out_of_line();
8900            let handles_before = decoder.remaining_handles();
8901            if let Some((inlined, num_bytes, num_handles)) =
8902                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8903            {
8904                let member_inline_size =
8905                    <MediaType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8906                if inlined != (member_inline_size <= 4) {
8907                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8908                }
8909                let inner_offset;
8910                let mut inner_depth = depth.clone();
8911                if inlined {
8912                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8913                    inner_offset = next_offset;
8914                } else {
8915                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8916                    inner_depth.increment()?;
8917                }
8918                let val_ref = self.media_type.get_or_insert_with(|| fidl::new_empty!(MediaType, D));
8919                fidl::decode!(MediaType, D, val_ref, decoder, inner_offset, inner_depth)?;
8920                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8921                {
8922                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8923                }
8924                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8925                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8926                }
8927            }
8928
8929            next_offset += envelope_size;
8930            _next_ordinal_to_read += 1;
8931            if next_offset >= end_offset {
8932                return Ok(());
8933            }
8934
8935            // Decode unknown envelopes for gaps in ordinals.
8936            while _next_ordinal_to_read < 3 {
8937                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8938                _next_ordinal_to_read += 1;
8939                next_offset += envelope_size;
8940            }
8941
8942            let next_out_of_line = decoder.next_out_of_line();
8943            let handles_before = decoder.remaining_handles();
8944            if let Some((inlined, num_bytes, num_handles)) =
8945                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8946            {
8947                let member_inline_size =
8948                    <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
8949                        decoder.context,
8950                    );
8951                if inlined != (member_inline_size <= 4) {
8952                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8953                }
8954                let inner_offset;
8955                let mut inner_depth = depth.clone();
8956                if inlined {
8957                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8958                    inner_offset = next_offset;
8959                } else {
8960                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8961                    inner_depth.increment()?;
8962                }
8963                let val_ref = self
8964                    .displayable_name
8965                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
8966                fidl::decode!(
8967                    fidl::encoding::BoundedString<255>,
8968                    D,
8969                    val_ref,
8970                    decoder,
8971                    inner_offset,
8972                    inner_depth
8973                )?;
8974                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8975                {
8976                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8977                }
8978                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8979                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8980                }
8981            }
8982
8983            next_offset += envelope_size;
8984            _next_ordinal_to_read += 1;
8985            if next_offset >= end_offset {
8986                return Ok(());
8987            }
8988
8989            // Decode unknown envelopes for gaps in ordinals.
8990            while _next_ordinal_to_read < 4 {
8991                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8992                _next_ordinal_to_read += 1;
8993                next_offset += envelope_size;
8994            }
8995
8996            let next_out_of_line = decoder.next_out_of_line();
8997            let handles_before = decoder.remaining_handles();
8998            if let Some((inlined, num_bytes, num_handles)) =
8999                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9000            {
9001                let member_inline_size =
9002                    <MediaAttributes as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9003                if inlined != (member_inline_size <= 4) {
9004                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9005                }
9006                let inner_offset;
9007                let mut inner_depth = depth.clone();
9008                if inlined {
9009                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9010                    inner_offset = next_offset;
9011                } else {
9012                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9013                    inner_depth.increment()?;
9014                }
9015                let val_ref =
9016                    self.attributes.get_or_insert_with(|| fidl::new_empty!(MediaAttributes, D));
9017                fidl::decode!(MediaAttributes, D, val_ref, decoder, inner_offset, inner_depth)?;
9018                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9019                {
9020                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9021                }
9022                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9023                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9024                }
9025            }
9026
9027            next_offset += envelope_size;
9028
9029            // Decode the remaining unknown envelopes.
9030            while next_offset < end_offset {
9031                _next_ordinal_to_read += 1;
9032                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9033                next_offset += envelope_size;
9034            }
9035
9036            Ok(())
9037        }
9038    }
9039
9040    impl MediaPlayerItem {
9041        #[inline(always)]
9042        fn max_ordinal_present(&self) -> u64 {
9043            if let Some(_) = self.feature_bits_ext {
9044                return 7;
9045            }
9046            if let Some(_) = self.feature_bits {
9047                return 6;
9048            }
9049            if let Some(_) = self.displayable_name {
9050                return 5;
9051            }
9052            if let Some(_) = self.playback_status {
9053                return 4;
9054            }
9055            if let Some(_) = self.sub_type {
9056                return 3;
9057            }
9058            if let Some(_) = self.major_type {
9059                return 2;
9060            }
9061            if let Some(_) = self.player_id {
9062                return 1;
9063            }
9064            0
9065        }
9066    }
9067
9068    impl fidl::encoding::ValueTypeMarker for MediaPlayerItem {
9069        type Borrowed<'a> = &'a Self;
9070        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9071            value
9072        }
9073    }
9074
9075    unsafe impl fidl::encoding::TypeMarker for MediaPlayerItem {
9076        type Owned = Self;
9077
9078        #[inline(always)]
9079        fn inline_align(_context: fidl::encoding::Context) -> usize {
9080            8
9081        }
9082
9083        #[inline(always)]
9084        fn inline_size(_context: fidl::encoding::Context) -> usize {
9085            16
9086        }
9087    }
9088
9089    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MediaPlayerItem, D>
9090        for &MediaPlayerItem
9091    {
9092        unsafe fn encode(
9093            self,
9094            encoder: &mut fidl::encoding::Encoder<'_, D>,
9095            offset: usize,
9096            mut depth: fidl::encoding::Depth,
9097        ) -> fidl::Result<()> {
9098            encoder.debug_check_bounds::<MediaPlayerItem>(offset);
9099            // Vector header
9100            let max_ordinal: u64 = self.max_ordinal_present();
9101            encoder.write_num(max_ordinal, offset);
9102            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9103            // Calling encoder.out_of_line_offset(0) is not allowed.
9104            if max_ordinal == 0 {
9105                return Ok(());
9106            }
9107            depth.increment()?;
9108            let envelope_size = 8;
9109            let bytes_len = max_ordinal as usize * envelope_size;
9110            #[allow(unused_variables)]
9111            let offset = encoder.out_of_line_offset(bytes_len);
9112            let mut _prev_end_offset: usize = 0;
9113            if 1 > max_ordinal {
9114                return Ok(());
9115            }
9116
9117            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9118            // are envelope_size bytes.
9119            let cur_offset: usize = (1 - 1) * envelope_size;
9120
9121            // Zero reserved fields.
9122            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9123
9124            // Safety:
9125            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9126            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9127            //   envelope_size bytes, there is always sufficient room.
9128            fidl::encoding::encode_in_envelope_optional::<u16, D>(
9129                self.player_id.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
9130                encoder,
9131                offset + cur_offset,
9132                depth,
9133            )?;
9134
9135            _prev_end_offset = cur_offset + envelope_size;
9136            if 2 > max_ordinal {
9137                return Ok(());
9138            }
9139
9140            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9141            // are envelope_size bytes.
9142            let cur_offset: usize = (2 - 1) * envelope_size;
9143
9144            // Zero reserved fields.
9145            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9146
9147            // Safety:
9148            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9149            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9150            //   envelope_size bytes, there is always sufficient room.
9151            fidl::encoding::encode_in_envelope_optional::<MajorPlayerType, D>(
9152                self.major_type
9153                    .as_ref()
9154                    .map(<MajorPlayerType as fidl::encoding::ValueTypeMarker>::borrow),
9155                encoder,
9156                offset + cur_offset,
9157                depth,
9158            )?;
9159
9160            _prev_end_offset = cur_offset + envelope_size;
9161            if 3 > max_ordinal {
9162                return Ok(());
9163            }
9164
9165            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9166            // are envelope_size bytes.
9167            let cur_offset: usize = (3 - 1) * envelope_size;
9168
9169            // Zero reserved fields.
9170            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9171
9172            // Safety:
9173            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9174            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9175            //   envelope_size bytes, there is always sufficient room.
9176            fidl::encoding::encode_in_envelope_optional::<PlayerSubType, D>(
9177                self.sub_type
9178                    .as_ref()
9179                    .map(<PlayerSubType as fidl::encoding::ValueTypeMarker>::borrow),
9180                encoder,
9181                offset + cur_offset,
9182                depth,
9183            )?;
9184
9185            _prev_end_offset = cur_offset + envelope_size;
9186            if 4 > max_ordinal {
9187                return Ok(());
9188            }
9189
9190            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9191            // are envelope_size bytes.
9192            let cur_offset: usize = (4 - 1) * envelope_size;
9193
9194            // Zero reserved fields.
9195            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9196
9197            // Safety:
9198            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9199            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9200            //   envelope_size bytes, there is always sufficient room.
9201            fidl::encoding::encode_in_envelope_optional::<PlaybackStatus, D>(
9202                self.playback_status
9203                    .as_ref()
9204                    .map(<PlaybackStatus as fidl::encoding::ValueTypeMarker>::borrow),
9205                encoder,
9206                offset + cur_offset,
9207                depth,
9208            )?;
9209
9210            _prev_end_offset = cur_offset + envelope_size;
9211            if 5 > max_ordinal {
9212                return Ok(());
9213            }
9214
9215            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9216            // are envelope_size bytes.
9217            let cur_offset: usize = (5 - 1) * envelope_size;
9218
9219            // Zero reserved fields.
9220            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9221
9222            // Safety:
9223            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9224            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9225            //   envelope_size bytes, there is always sufficient room.
9226            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
9227                self.displayable_name.as_ref().map(
9228                    <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
9229                ),
9230                encoder,
9231                offset + cur_offset,
9232                depth,
9233            )?;
9234
9235            _prev_end_offset = cur_offset + envelope_size;
9236            if 6 > max_ordinal {
9237                return Ok(());
9238            }
9239
9240            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9241            // are envelope_size bytes.
9242            let cur_offset: usize = (6 - 1) * envelope_size;
9243
9244            // Zero reserved fields.
9245            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9246
9247            // Safety:
9248            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9249            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9250            //   envelope_size bytes, there is always sufficient room.
9251            fidl::encoding::encode_in_envelope_optional::<PlayerFeatureBits, D>(
9252                self.feature_bits
9253                    .as_ref()
9254                    .map(<PlayerFeatureBits as fidl::encoding::ValueTypeMarker>::borrow),
9255                encoder,
9256                offset + cur_offset,
9257                depth,
9258            )?;
9259
9260            _prev_end_offset = cur_offset + envelope_size;
9261            if 7 > max_ordinal {
9262                return Ok(());
9263            }
9264
9265            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9266            // are envelope_size bytes.
9267            let cur_offset: usize = (7 - 1) * envelope_size;
9268
9269            // Zero reserved fields.
9270            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9271
9272            // Safety:
9273            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9274            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9275            //   envelope_size bytes, there is always sufficient room.
9276            fidl::encoding::encode_in_envelope_optional::<PlayerFeatureBitsExt, D>(
9277                self.feature_bits_ext
9278                    .as_ref()
9279                    .map(<PlayerFeatureBitsExt as fidl::encoding::ValueTypeMarker>::borrow),
9280                encoder,
9281                offset + cur_offset,
9282                depth,
9283            )?;
9284
9285            _prev_end_offset = cur_offset + envelope_size;
9286
9287            Ok(())
9288        }
9289    }
9290
9291    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MediaPlayerItem {
9292        #[inline(always)]
9293        fn new_empty() -> Self {
9294            Self::default()
9295        }
9296
9297        unsafe fn decode(
9298            &mut self,
9299            decoder: &mut fidl::encoding::Decoder<'_, D>,
9300            offset: usize,
9301            mut depth: fidl::encoding::Depth,
9302        ) -> fidl::Result<()> {
9303            decoder.debug_check_bounds::<Self>(offset);
9304            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9305                None => return Err(fidl::Error::NotNullable),
9306                Some(len) => len,
9307            };
9308            // Calling decoder.out_of_line_offset(0) is not allowed.
9309            if len == 0 {
9310                return Ok(());
9311            };
9312            depth.increment()?;
9313            let envelope_size = 8;
9314            let bytes_len = len * envelope_size;
9315            let offset = decoder.out_of_line_offset(bytes_len)?;
9316            // Decode the envelope for each type.
9317            let mut _next_ordinal_to_read = 0;
9318            let mut next_offset = offset;
9319            let end_offset = offset + bytes_len;
9320            _next_ordinal_to_read += 1;
9321            if next_offset >= end_offset {
9322                return Ok(());
9323            }
9324
9325            // Decode unknown envelopes for gaps in ordinals.
9326            while _next_ordinal_to_read < 1 {
9327                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9328                _next_ordinal_to_read += 1;
9329                next_offset += envelope_size;
9330            }
9331
9332            let next_out_of_line = decoder.next_out_of_line();
9333            let handles_before = decoder.remaining_handles();
9334            if let Some((inlined, num_bytes, num_handles)) =
9335                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9336            {
9337                let member_inline_size =
9338                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9339                if inlined != (member_inline_size <= 4) {
9340                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9341                }
9342                let inner_offset;
9343                let mut inner_depth = depth.clone();
9344                if inlined {
9345                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9346                    inner_offset = next_offset;
9347                } else {
9348                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9349                    inner_depth.increment()?;
9350                }
9351                let val_ref = self.player_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
9352                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
9353                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9354                {
9355                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9356                }
9357                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9358                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9359                }
9360            }
9361
9362            next_offset += envelope_size;
9363            _next_ordinal_to_read += 1;
9364            if next_offset >= end_offset {
9365                return Ok(());
9366            }
9367
9368            // Decode unknown envelopes for gaps in ordinals.
9369            while _next_ordinal_to_read < 2 {
9370                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9371                _next_ordinal_to_read += 1;
9372                next_offset += envelope_size;
9373            }
9374
9375            let next_out_of_line = decoder.next_out_of_line();
9376            let handles_before = decoder.remaining_handles();
9377            if let Some((inlined, num_bytes, num_handles)) =
9378                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9379            {
9380                let member_inline_size =
9381                    <MajorPlayerType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9382                if inlined != (member_inline_size <= 4) {
9383                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9384                }
9385                let inner_offset;
9386                let mut inner_depth = depth.clone();
9387                if inlined {
9388                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9389                    inner_offset = next_offset;
9390                } else {
9391                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9392                    inner_depth.increment()?;
9393                }
9394                let val_ref =
9395                    self.major_type.get_or_insert_with(|| fidl::new_empty!(MajorPlayerType, D));
9396                fidl::decode!(MajorPlayerType, D, val_ref, decoder, inner_offset, inner_depth)?;
9397                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9398                {
9399                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9400                }
9401                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9402                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9403                }
9404            }
9405
9406            next_offset += envelope_size;
9407            _next_ordinal_to_read += 1;
9408            if next_offset >= end_offset {
9409                return Ok(());
9410            }
9411
9412            // Decode unknown envelopes for gaps in ordinals.
9413            while _next_ordinal_to_read < 3 {
9414                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9415                _next_ordinal_to_read += 1;
9416                next_offset += envelope_size;
9417            }
9418
9419            let next_out_of_line = decoder.next_out_of_line();
9420            let handles_before = decoder.remaining_handles();
9421            if let Some((inlined, num_bytes, num_handles)) =
9422                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9423            {
9424                let member_inline_size =
9425                    <PlayerSubType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9426                if inlined != (member_inline_size <= 4) {
9427                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9428                }
9429                let inner_offset;
9430                let mut inner_depth = depth.clone();
9431                if inlined {
9432                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9433                    inner_offset = next_offset;
9434                } else {
9435                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9436                    inner_depth.increment()?;
9437                }
9438                let val_ref =
9439                    self.sub_type.get_or_insert_with(|| fidl::new_empty!(PlayerSubType, D));
9440                fidl::decode!(PlayerSubType, D, val_ref, decoder, inner_offset, inner_depth)?;
9441                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9442                {
9443                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9444                }
9445                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9446                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9447                }
9448            }
9449
9450            next_offset += envelope_size;
9451            _next_ordinal_to_read += 1;
9452            if next_offset >= end_offset {
9453                return Ok(());
9454            }
9455
9456            // Decode unknown envelopes for gaps in ordinals.
9457            while _next_ordinal_to_read < 4 {
9458                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9459                _next_ordinal_to_read += 1;
9460                next_offset += envelope_size;
9461            }
9462
9463            let next_out_of_line = decoder.next_out_of_line();
9464            let handles_before = decoder.remaining_handles();
9465            if let Some((inlined, num_bytes, num_handles)) =
9466                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9467            {
9468                let member_inline_size =
9469                    <PlaybackStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9470                if inlined != (member_inline_size <= 4) {
9471                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9472                }
9473                let inner_offset;
9474                let mut inner_depth = depth.clone();
9475                if inlined {
9476                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9477                    inner_offset = next_offset;
9478                } else {
9479                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9480                    inner_depth.increment()?;
9481                }
9482                let val_ref =
9483                    self.playback_status.get_or_insert_with(|| fidl::new_empty!(PlaybackStatus, D));
9484                fidl::decode!(PlaybackStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
9485                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9486                {
9487                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9488                }
9489                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9490                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9491                }
9492            }
9493
9494            next_offset += envelope_size;
9495            _next_ordinal_to_read += 1;
9496            if next_offset >= end_offset {
9497                return Ok(());
9498            }
9499
9500            // Decode unknown envelopes for gaps in ordinals.
9501            while _next_ordinal_to_read < 5 {
9502                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9503                _next_ordinal_to_read += 1;
9504                next_offset += envelope_size;
9505            }
9506
9507            let next_out_of_line = decoder.next_out_of_line();
9508            let handles_before = decoder.remaining_handles();
9509            if let Some((inlined, num_bytes, num_handles)) =
9510                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9511            {
9512                let member_inline_size =
9513                    <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
9514                        decoder.context,
9515                    );
9516                if inlined != (member_inline_size <= 4) {
9517                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9518                }
9519                let inner_offset;
9520                let mut inner_depth = depth.clone();
9521                if inlined {
9522                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9523                    inner_offset = next_offset;
9524                } else {
9525                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9526                    inner_depth.increment()?;
9527                }
9528                let val_ref = self
9529                    .displayable_name
9530                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
9531                fidl::decode!(
9532                    fidl::encoding::BoundedString<255>,
9533                    D,
9534                    val_ref,
9535                    decoder,
9536                    inner_offset,
9537                    inner_depth
9538                )?;
9539                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9540                {
9541                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9542                }
9543                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9544                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9545                }
9546            }
9547
9548            next_offset += envelope_size;
9549            _next_ordinal_to_read += 1;
9550            if next_offset >= end_offset {
9551                return Ok(());
9552            }
9553
9554            // Decode unknown envelopes for gaps in ordinals.
9555            while _next_ordinal_to_read < 6 {
9556                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9557                _next_ordinal_to_read += 1;
9558                next_offset += envelope_size;
9559            }
9560
9561            let next_out_of_line = decoder.next_out_of_line();
9562            let handles_before = decoder.remaining_handles();
9563            if let Some((inlined, num_bytes, num_handles)) =
9564                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9565            {
9566                let member_inline_size =
9567                    <PlayerFeatureBits as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9568                if inlined != (member_inline_size <= 4) {
9569                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9570                }
9571                let inner_offset;
9572                let mut inner_depth = depth.clone();
9573                if inlined {
9574                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9575                    inner_offset = next_offset;
9576                } else {
9577                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9578                    inner_depth.increment()?;
9579                }
9580                let val_ref =
9581                    self.feature_bits.get_or_insert_with(|| fidl::new_empty!(PlayerFeatureBits, D));
9582                fidl::decode!(PlayerFeatureBits, D, val_ref, decoder, inner_offset, inner_depth)?;
9583                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9584                {
9585                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9586                }
9587                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9588                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9589                }
9590            }
9591
9592            next_offset += envelope_size;
9593            _next_ordinal_to_read += 1;
9594            if next_offset >= end_offset {
9595                return Ok(());
9596            }
9597
9598            // Decode unknown envelopes for gaps in ordinals.
9599            while _next_ordinal_to_read < 7 {
9600                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9601                _next_ordinal_to_read += 1;
9602                next_offset += envelope_size;
9603            }
9604
9605            let next_out_of_line = decoder.next_out_of_line();
9606            let handles_before = decoder.remaining_handles();
9607            if let Some((inlined, num_bytes, num_handles)) =
9608                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9609            {
9610                let member_inline_size =
9611                    <PlayerFeatureBitsExt as fidl::encoding::TypeMarker>::inline_size(
9612                        decoder.context,
9613                    );
9614                if inlined != (member_inline_size <= 4) {
9615                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9616                }
9617                let inner_offset;
9618                let mut inner_depth = depth.clone();
9619                if inlined {
9620                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9621                    inner_offset = next_offset;
9622                } else {
9623                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9624                    inner_depth.increment()?;
9625                }
9626                let val_ref = self
9627                    .feature_bits_ext
9628                    .get_or_insert_with(|| fidl::new_empty!(PlayerFeatureBitsExt, D));
9629                fidl::decode!(
9630                    PlayerFeatureBitsExt,
9631                    D,
9632                    val_ref,
9633                    decoder,
9634                    inner_offset,
9635                    inner_depth
9636                )?;
9637                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9638                {
9639                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9640                }
9641                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9642                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9643                }
9644            }
9645
9646            next_offset += envelope_size;
9647
9648            // Decode the remaining unknown envelopes.
9649            while next_offset < end_offset {
9650                _next_ordinal_to_read += 1;
9651                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9652                next_offset += envelope_size;
9653            }
9654
9655            Ok(())
9656        }
9657    }
9658
9659    impl Notification {
9660        #[inline(always)]
9661        fn max_ordinal_present(&self) -> u64 {
9662            if let Some(_) = self.addressed_player {
9663                return 11;
9664            }
9665            if let Some(_) = self.available_players_changed {
9666                return 10;
9667            }
9668            if let Some(_) = self.device_connected {
9669                return 9;
9670            }
9671            if let Some(_) = self.volume {
9672                return 8;
9673            }
9674            if let Some(_) = self.player_id {
9675                return 7;
9676            }
9677            if let Some(_) = self.application_settings {
9678                return 6;
9679            }
9680            if let Some(_) = self.system_status {
9681                return 5;
9682            }
9683            if let Some(_) = self.battery_status {
9684                return 4;
9685            }
9686            if let Some(_) = self.pos {
9687                return 3;
9688            }
9689            if let Some(_) = self.track_id {
9690                return 2;
9691            }
9692            if let Some(_) = self.status {
9693                return 1;
9694            }
9695            0
9696        }
9697    }
9698
9699    impl fidl::encoding::ValueTypeMarker for Notification {
9700        type Borrowed<'a> = &'a Self;
9701        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9702            value
9703        }
9704    }
9705
9706    unsafe impl fidl::encoding::TypeMarker for Notification {
9707        type Owned = Self;
9708
9709        #[inline(always)]
9710        fn inline_align(_context: fidl::encoding::Context) -> usize {
9711            8
9712        }
9713
9714        #[inline(always)]
9715        fn inline_size(_context: fidl::encoding::Context) -> usize {
9716            16
9717        }
9718    }
9719
9720    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Notification, D>
9721        for &Notification
9722    {
9723        unsafe fn encode(
9724            self,
9725            encoder: &mut fidl::encoding::Encoder<'_, D>,
9726            offset: usize,
9727            mut depth: fidl::encoding::Depth,
9728        ) -> fidl::Result<()> {
9729            encoder.debug_check_bounds::<Notification>(offset);
9730            // Vector header
9731            let max_ordinal: u64 = self.max_ordinal_present();
9732            encoder.write_num(max_ordinal, offset);
9733            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9734            // Calling encoder.out_of_line_offset(0) is not allowed.
9735            if max_ordinal == 0 {
9736                return Ok(());
9737            }
9738            depth.increment()?;
9739            let envelope_size = 8;
9740            let bytes_len = max_ordinal as usize * envelope_size;
9741            #[allow(unused_variables)]
9742            let offset = encoder.out_of_line_offset(bytes_len);
9743            let mut _prev_end_offset: usize = 0;
9744            if 1 > max_ordinal {
9745                return Ok(());
9746            }
9747
9748            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9749            // are envelope_size bytes.
9750            let cur_offset: usize = (1 - 1) * envelope_size;
9751
9752            // Zero reserved fields.
9753            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9754
9755            // Safety:
9756            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9757            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9758            //   envelope_size bytes, there is always sufficient room.
9759            fidl::encoding::encode_in_envelope_optional::<PlaybackStatus, D>(
9760                self.status
9761                    .as_ref()
9762                    .map(<PlaybackStatus as fidl::encoding::ValueTypeMarker>::borrow),
9763                encoder,
9764                offset + cur_offset,
9765                depth,
9766            )?;
9767
9768            _prev_end_offset = cur_offset + envelope_size;
9769            if 2 > max_ordinal {
9770                return Ok(());
9771            }
9772
9773            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9774            // are envelope_size bytes.
9775            let cur_offset: usize = (2 - 1) * envelope_size;
9776
9777            // Zero reserved fields.
9778            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9779
9780            // Safety:
9781            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9782            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9783            //   envelope_size bytes, there is always sufficient room.
9784            fidl::encoding::encode_in_envelope_optional::<u64, D>(
9785                self.track_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
9786                encoder,
9787                offset + cur_offset,
9788                depth,
9789            )?;
9790
9791            _prev_end_offset = cur_offset + envelope_size;
9792            if 3 > max_ordinal {
9793                return Ok(());
9794            }
9795
9796            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9797            // are envelope_size bytes.
9798            let cur_offset: usize = (3 - 1) * envelope_size;
9799
9800            // Zero reserved fields.
9801            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9802
9803            // Safety:
9804            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9805            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9806            //   envelope_size bytes, there is always sufficient room.
9807            fidl::encoding::encode_in_envelope_optional::<u32, D>(
9808                self.pos.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
9809                encoder,
9810                offset + cur_offset,
9811                depth,
9812            )?;
9813
9814            _prev_end_offset = cur_offset + envelope_size;
9815            if 4 > max_ordinal {
9816                return Ok(());
9817            }
9818
9819            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9820            // are envelope_size bytes.
9821            let cur_offset: usize = (4 - 1) * envelope_size;
9822
9823            // Zero reserved fields.
9824            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9825
9826            // Safety:
9827            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9828            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9829            //   envelope_size bytes, there is always sufficient room.
9830            fidl::encoding::encode_in_envelope_optional::<BatteryStatus, D>(
9831                self.battery_status
9832                    .as_ref()
9833                    .map(<BatteryStatus as fidl::encoding::ValueTypeMarker>::borrow),
9834                encoder,
9835                offset + cur_offset,
9836                depth,
9837            )?;
9838
9839            _prev_end_offset = cur_offset + envelope_size;
9840            if 5 > max_ordinal {
9841                return Ok(());
9842            }
9843
9844            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9845            // are envelope_size bytes.
9846            let cur_offset: usize = (5 - 1) * envelope_size;
9847
9848            // Zero reserved fields.
9849            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9850
9851            // Safety:
9852            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9853            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9854            //   envelope_size bytes, there is always sufficient room.
9855            fidl::encoding::encode_in_envelope_optional::<SystemStatus, D>(
9856                self.system_status
9857                    .as_ref()
9858                    .map(<SystemStatus as fidl::encoding::ValueTypeMarker>::borrow),
9859                encoder,
9860                offset + cur_offset,
9861                depth,
9862            )?;
9863
9864            _prev_end_offset = cur_offset + envelope_size;
9865            if 6 > max_ordinal {
9866                return Ok(());
9867            }
9868
9869            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9870            // are envelope_size bytes.
9871            let cur_offset: usize = (6 - 1) * envelope_size;
9872
9873            // Zero reserved fields.
9874            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9875
9876            // Safety:
9877            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9878            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9879            //   envelope_size bytes, there is always sufficient room.
9880            fidl::encoding::encode_in_envelope_optional::<PlayerApplicationSettings, D>(
9881                self.application_settings
9882                    .as_ref()
9883                    .map(<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow),
9884                encoder,
9885                offset + cur_offset,
9886                depth,
9887            )?;
9888
9889            _prev_end_offset = cur_offset + envelope_size;
9890            if 7 > max_ordinal {
9891                return Ok(());
9892            }
9893
9894            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9895            // are envelope_size bytes.
9896            let cur_offset: usize = (7 - 1) * envelope_size;
9897
9898            // Zero reserved fields.
9899            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9900
9901            // Safety:
9902            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9903            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9904            //   envelope_size bytes, there is always sufficient room.
9905            fidl::encoding::encode_in_envelope_optional::<u16, D>(
9906                self.player_id.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
9907                encoder,
9908                offset + cur_offset,
9909                depth,
9910            )?;
9911
9912            _prev_end_offset = cur_offset + envelope_size;
9913            if 8 > max_ordinal {
9914                return Ok(());
9915            }
9916
9917            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9918            // are envelope_size bytes.
9919            let cur_offset: usize = (8 - 1) * envelope_size;
9920
9921            // Zero reserved fields.
9922            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9923
9924            // Safety:
9925            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9926            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9927            //   envelope_size bytes, there is always sufficient room.
9928            fidl::encoding::encode_in_envelope_optional::<u8, D>(
9929                self.volume.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
9930                encoder,
9931                offset + cur_offset,
9932                depth,
9933            )?;
9934
9935            _prev_end_offset = cur_offset + envelope_size;
9936            if 9 > max_ordinal {
9937                return Ok(());
9938            }
9939
9940            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9941            // are envelope_size bytes.
9942            let cur_offset: usize = (9 - 1) * envelope_size;
9943
9944            // Zero reserved fields.
9945            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9946
9947            // Safety:
9948            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9949            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9950            //   envelope_size bytes, there is always sufficient room.
9951            fidl::encoding::encode_in_envelope_optional::<bool, D>(
9952                self.device_connected
9953                    .as_ref()
9954                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
9955                encoder,
9956                offset + cur_offset,
9957                depth,
9958            )?;
9959
9960            _prev_end_offset = cur_offset + envelope_size;
9961            if 10 > max_ordinal {
9962                return Ok(());
9963            }
9964
9965            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9966            // are envelope_size bytes.
9967            let cur_offset: usize = (10 - 1) * envelope_size;
9968
9969            // Zero reserved fields.
9970            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9971
9972            // Safety:
9973            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9974            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9975            //   envelope_size bytes, there is always sufficient room.
9976            fidl::encoding::encode_in_envelope_optional::<bool, D>(
9977                self.available_players_changed
9978                    .as_ref()
9979                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
9980                encoder,
9981                offset + cur_offset,
9982                depth,
9983            )?;
9984
9985            _prev_end_offset = cur_offset + envelope_size;
9986            if 11 > max_ordinal {
9987                return Ok(());
9988            }
9989
9990            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9991            // are envelope_size bytes.
9992            let cur_offset: usize = (11 - 1) * envelope_size;
9993
9994            // Zero reserved fields.
9995            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9996
9997            // Safety:
9998            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9999            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10000            //   envelope_size bytes, there is always sufficient room.
10001            fidl::encoding::encode_in_envelope_optional::<u16, D>(
10002                self.addressed_player
10003                    .as_ref()
10004                    .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
10005                encoder,
10006                offset + cur_offset,
10007                depth,
10008            )?;
10009
10010            _prev_end_offset = cur_offset + envelope_size;
10011
10012            Ok(())
10013        }
10014    }
10015
10016    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Notification {
10017        #[inline(always)]
10018        fn new_empty() -> Self {
10019            Self::default()
10020        }
10021
10022        unsafe fn decode(
10023            &mut self,
10024            decoder: &mut fidl::encoding::Decoder<'_, D>,
10025            offset: usize,
10026            mut depth: fidl::encoding::Depth,
10027        ) -> fidl::Result<()> {
10028            decoder.debug_check_bounds::<Self>(offset);
10029            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10030                None => return Err(fidl::Error::NotNullable),
10031                Some(len) => len,
10032            };
10033            // Calling decoder.out_of_line_offset(0) is not allowed.
10034            if len == 0 {
10035                return Ok(());
10036            };
10037            depth.increment()?;
10038            let envelope_size = 8;
10039            let bytes_len = len * envelope_size;
10040            let offset = decoder.out_of_line_offset(bytes_len)?;
10041            // Decode the envelope for each type.
10042            let mut _next_ordinal_to_read = 0;
10043            let mut next_offset = offset;
10044            let end_offset = offset + bytes_len;
10045            _next_ordinal_to_read += 1;
10046            if next_offset >= end_offset {
10047                return Ok(());
10048            }
10049
10050            // Decode unknown envelopes for gaps in ordinals.
10051            while _next_ordinal_to_read < 1 {
10052                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10053                _next_ordinal_to_read += 1;
10054                next_offset += envelope_size;
10055            }
10056
10057            let next_out_of_line = decoder.next_out_of_line();
10058            let handles_before = decoder.remaining_handles();
10059            if let Some((inlined, num_bytes, num_handles)) =
10060                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10061            {
10062                let member_inline_size =
10063                    <PlaybackStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10064                if inlined != (member_inline_size <= 4) {
10065                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10066                }
10067                let inner_offset;
10068                let mut inner_depth = depth.clone();
10069                if inlined {
10070                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10071                    inner_offset = next_offset;
10072                } else {
10073                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10074                    inner_depth.increment()?;
10075                }
10076                let val_ref =
10077                    self.status.get_or_insert_with(|| fidl::new_empty!(PlaybackStatus, D));
10078                fidl::decode!(PlaybackStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
10079                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10080                {
10081                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10082                }
10083                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10084                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10085                }
10086            }
10087
10088            next_offset += envelope_size;
10089            _next_ordinal_to_read += 1;
10090            if next_offset >= end_offset {
10091                return Ok(());
10092            }
10093
10094            // Decode unknown envelopes for gaps in ordinals.
10095            while _next_ordinal_to_read < 2 {
10096                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10097                _next_ordinal_to_read += 1;
10098                next_offset += envelope_size;
10099            }
10100
10101            let next_out_of_line = decoder.next_out_of_line();
10102            let handles_before = decoder.remaining_handles();
10103            if let Some((inlined, num_bytes, num_handles)) =
10104                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10105            {
10106                let member_inline_size =
10107                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10108                if inlined != (member_inline_size <= 4) {
10109                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10110                }
10111                let inner_offset;
10112                let mut inner_depth = depth.clone();
10113                if inlined {
10114                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10115                    inner_offset = next_offset;
10116                } else {
10117                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10118                    inner_depth.increment()?;
10119                }
10120                let val_ref = self.track_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
10121                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
10122                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10123                {
10124                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10125                }
10126                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10127                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10128                }
10129            }
10130
10131            next_offset += envelope_size;
10132            _next_ordinal_to_read += 1;
10133            if next_offset >= end_offset {
10134                return Ok(());
10135            }
10136
10137            // Decode unknown envelopes for gaps in ordinals.
10138            while _next_ordinal_to_read < 3 {
10139                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10140                _next_ordinal_to_read += 1;
10141                next_offset += envelope_size;
10142            }
10143
10144            let next_out_of_line = decoder.next_out_of_line();
10145            let handles_before = decoder.remaining_handles();
10146            if let Some((inlined, num_bytes, num_handles)) =
10147                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10148            {
10149                let member_inline_size =
10150                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10151                if inlined != (member_inline_size <= 4) {
10152                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10153                }
10154                let inner_offset;
10155                let mut inner_depth = depth.clone();
10156                if inlined {
10157                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10158                    inner_offset = next_offset;
10159                } else {
10160                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10161                    inner_depth.increment()?;
10162                }
10163                let val_ref = self.pos.get_or_insert_with(|| fidl::new_empty!(u32, D));
10164                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
10165                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10166                {
10167                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10168                }
10169                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10170                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10171                }
10172            }
10173
10174            next_offset += envelope_size;
10175            _next_ordinal_to_read += 1;
10176            if next_offset >= end_offset {
10177                return Ok(());
10178            }
10179
10180            // Decode unknown envelopes for gaps in ordinals.
10181            while _next_ordinal_to_read < 4 {
10182                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10183                _next_ordinal_to_read += 1;
10184                next_offset += envelope_size;
10185            }
10186
10187            let next_out_of_line = decoder.next_out_of_line();
10188            let handles_before = decoder.remaining_handles();
10189            if let Some((inlined, num_bytes, num_handles)) =
10190                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10191            {
10192                let member_inline_size =
10193                    <BatteryStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10194                if inlined != (member_inline_size <= 4) {
10195                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10196                }
10197                let inner_offset;
10198                let mut inner_depth = depth.clone();
10199                if inlined {
10200                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10201                    inner_offset = next_offset;
10202                } else {
10203                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10204                    inner_depth.increment()?;
10205                }
10206                let val_ref =
10207                    self.battery_status.get_or_insert_with(|| fidl::new_empty!(BatteryStatus, D));
10208                fidl::decode!(BatteryStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
10209                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10210                {
10211                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10212                }
10213                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10214                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10215                }
10216            }
10217
10218            next_offset += envelope_size;
10219            _next_ordinal_to_read += 1;
10220            if next_offset >= end_offset {
10221                return Ok(());
10222            }
10223
10224            // Decode unknown envelopes for gaps in ordinals.
10225            while _next_ordinal_to_read < 5 {
10226                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10227                _next_ordinal_to_read += 1;
10228                next_offset += envelope_size;
10229            }
10230
10231            let next_out_of_line = decoder.next_out_of_line();
10232            let handles_before = decoder.remaining_handles();
10233            if let Some((inlined, num_bytes, num_handles)) =
10234                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10235            {
10236                let member_inline_size =
10237                    <SystemStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10238                if inlined != (member_inline_size <= 4) {
10239                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10240                }
10241                let inner_offset;
10242                let mut inner_depth = depth.clone();
10243                if inlined {
10244                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10245                    inner_offset = next_offset;
10246                } else {
10247                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10248                    inner_depth.increment()?;
10249                }
10250                let val_ref =
10251                    self.system_status.get_or_insert_with(|| fidl::new_empty!(SystemStatus, D));
10252                fidl::decode!(SystemStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
10253                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10254                {
10255                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10256                }
10257                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10258                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10259                }
10260            }
10261
10262            next_offset += envelope_size;
10263            _next_ordinal_to_read += 1;
10264            if next_offset >= end_offset {
10265                return Ok(());
10266            }
10267
10268            // Decode unknown envelopes for gaps in ordinals.
10269            while _next_ordinal_to_read < 6 {
10270                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10271                _next_ordinal_to_read += 1;
10272                next_offset += envelope_size;
10273            }
10274
10275            let next_out_of_line = decoder.next_out_of_line();
10276            let handles_before = decoder.remaining_handles();
10277            if let Some((inlined, num_bytes, num_handles)) =
10278                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10279            {
10280                let member_inline_size =
10281                    <PlayerApplicationSettings as fidl::encoding::TypeMarker>::inline_size(
10282                        decoder.context,
10283                    );
10284                if inlined != (member_inline_size <= 4) {
10285                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10286                }
10287                let inner_offset;
10288                let mut inner_depth = depth.clone();
10289                if inlined {
10290                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10291                    inner_offset = next_offset;
10292                } else {
10293                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10294                    inner_depth.increment()?;
10295                }
10296                let val_ref = self
10297                    .application_settings
10298                    .get_or_insert_with(|| fidl::new_empty!(PlayerApplicationSettings, D));
10299                fidl::decode!(
10300                    PlayerApplicationSettings,
10301                    D,
10302                    val_ref,
10303                    decoder,
10304                    inner_offset,
10305                    inner_depth
10306                )?;
10307                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10308                {
10309                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10310                }
10311                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10312                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10313                }
10314            }
10315
10316            next_offset += envelope_size;
10317            _next_ordinal_to_read += 1;
10318            if next_offset >= end_offset {
10319                return Ok(());
10320            }
10321
10322            // Decode unknown envelopes for gaps in ordinals.
10323            while _next_ordinal_to_read < 7 {
10324                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10325                _next_ordinal_to_read += 1;
10326                next_offset += envelope_size;
10327            }
10328
10329            let next_out_of_line = decoder.next_out_of_line();
10330            let handles_before = decoder.remaining_handles();
10331            if let Some((inlined, num_bytes, num_handles)) =
10332                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10333            {
10334                let member_inline_size =
10335                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10336                if inlined != (member_inline_size <= 4) {
10337                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10338                }
10339                let inner_offset;
10340                let mut inner_depth = depth.clone();
10341                if inlined {
10342                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10343                    inner_offset = next_offset;
10344                } else {
10345                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10346                    inner_depth.increment()?;
10347                }
10348                let val_ref = self.player_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
10349                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
10350                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10351                {
10352                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10353                }
10354                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10355                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10356                }
10357            }
10358
10359            next_offset += envelope_size;
10360            _next_ordinal_to_read += 1;
10361            if next_offset >= end_offset {
10362                return Ok(());
10363            }
10364
10365            // Decode unknown envelopes for gaps in ordinals.
10366            while _next_ordinal_to_read < 8 {
10367                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10368                _next_ordinal_to_read += 1;
10369                next_offset += envelope_size;
10370            }
10371
10372            let next_out_of_line = decoder.next_out_of_line();
10373            let handles_before = decoder.remaining_handles();
10374            if let Some((inlined, num_bytes, num_handles)) =
10375                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10376            {
10377                let member_inline_size =
10378                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10379                if inlined != (member_inline_size <= 4) {
10380                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10381                }
10382                let inner_offset;
10383                let mut inner_depth = depth.clone();
10384                if inlined {
10385                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10386                    inner_offset = next_offset;
10387                } else {
10388                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10389                    inner_depth.increment()?;
10390                }
10391                let val_ref = self.volume.get_or_insert_with(|| fidl::new_empty!(u8, D));
10392                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
10393                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10394                {
10395                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10396                }
10397                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10398                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10399                }
10400            }
10401
10402            next_offset += envelope_size;
10403            _next_ordinal_to_read += 1;
10404            if next_offset >= end_offset {
10405                return Ok(());
10406            }
10407
10408            // Decode unknown envelopes for gaps in ordinals.
10409            while _next_ordinal_to_read < 9 {
10410                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10411                _next_ordinal_to_read += 1;
10412                next_offset += envelope_size;
10413            }
10414
10415            let next_out_of_line = decoder.next_out_of_line();
10416            let handles_before = decoder.remaining_handles();
10417            if let Some((inlined, num_bytes, num_handles)) =
10418                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10419            {
10420                let member_inline_size =
10421                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10422                if inlined != (member_inline_size <= 4) {
10423                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10424                }
10425                let inner_offset;
10426                let mut inner_depth = depth.clone();
10427                if inlined {
10428                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10429                    inner_offset = next_offset;
10430                } else {
10431                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10432                    inner_depth.increment()?;
10433                }
10434                let val_ref =
10435                    self.device_connected.get_or_insert_with(|| fidl::new_empty!(bool, D));
10436                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
10437                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10438                {
10439                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10440                }
10441                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10442                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10443                }
10444            }
10445
10446            next_offset += envelope_size;
10447            _next_ordinal_to_read += 1;
10448            if next_offset >= end_offset {
10449                return Ok(());
10450            }
10451
10452            // Decode unknown envelopes for gaps in ordinals.
10453            while _next_ordinal_to_read < 10 {
10454                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10455                _next_ordinal_to_read += 1;
10456                next_offset += envelope_size;
10457            }
10458
10459            let next_out_of_line = decoder.next_out_of_line();
10460            let handles_before = decoder.remaining_handles();
10461            if let Some((inlined, num_bytes, num_handles)) =
10462                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10463            {
10464                let member_inline_size =
10465                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10466                if inlined != (member_inline_size <= 4) {
10467                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10468                }
10469                let inner_offset;
10470                let mut inner_depth = depth.clone();
10471                if inlined {
10472                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10473                    inner_offset = next_offset;
10474                } else {
10475                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10476                    inner_depth.increment()?;
10477                }
10478                let val_ref =
10479                    self.available_players_changed.get_or_insert_with(|| fidl::new_empty!(bool, D));
10480                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
10481                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10482                {
10483                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10484                }
10485                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10486                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10487                }
10488            }
10489
10490            next_offset += envelope_size;
10491            _next_ordinal_to_read += 1;
10492            if next_offset >= end_offset {
10493                return Ok(());
10494            }
10495
10496            // Decode unknown envelopes for gaps in ordinals.
10497            while _next_ordinal_to_read < 11 {
10498                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10499                _next_ordinal_to_read += 1;
10500                next_offset += envelope_size;
10501            }
10502
10503            let next_out_of_line = decoder.next_out_of_line();
10504            let handles_before = decoder.remaining_handles();
10505            if let Some((inlined, num_bytes, num_handles)) =
10506                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10507            {
10508                let member_inline_size =
10509                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10510                if inlined != (member_inline_size <= 4) {
10511                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10512                }
10513                let inner_offset;
10514                let mut inner_depth = depth.clone();
10515                if inlined {
10516                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10517                    inner_offset = next_offset;
10518                } else {
10519                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10520                    inner_depth.increment()?;
10521                }
10522                let val_ref = self.addressed_player.get_or_insert_with(|| fidl::new_empty!(u16, D));
10523                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
10524                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10525                {
10526                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10527                }
10528                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10529                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10530                }
10531            }
10532
10533            next_offset += envelope_size;
10534
10535            // Decode the remaining unknown envelopes.
10536            while next_offset < end_offset {
10537                _next_ordinal_to_read += 1;
10538                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10539                next_offset += envelope_size;
10540            }
10541
10542            Ok(())
10543        }
10544    }
10545
10546    impl PlayStatus {
10547        #[inline(always)]
10548        fn max_ordinal_present(&self) -> u64 {
10549            if let Some(_) = self.playback_status {
10550                return 3;
10551            }
10552            if let Some(_) = self.song_position {
10553                return 2;
10554            }
10555            if let Some(_) = self.song_length {
10556                return 1;
10557            }
10558            0
10559        }
10560    }
10561
10562    impl fidl::encoding::ValueTypeMarker for PlayStatus {
10563        type Borrowed<'a> = &'a Self;
10564        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10565            value
10566        }
10567    }
10568
10569    unsafe impl fidl::encoding::TypeMarker for PlayStatus {
10570        type Owned = Self;
10571
10572        #[inline(always)]
10573        fn inline_align(_context: fidl::encoding::Context) -> usize {
10574            8
10575        }
10576
10577        #[inline(always)]
10578        fn inline_size(_context: fidl::encoding::Context) -> usize {
10579            16
10580        }
10581    }
10582
10583    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PlayStatus, D>
10584        for &PlayStatus
10585    {
10586        unsafe fn encode(
10587            self,
10588            encoder: &mut fidl::encoding::Encoder<'_, D>,
10589            offset: usize,
10590            mut depth: fidl::encoding::Depth,
10591        ) -> fidl::Result<()> {
10592            encoder.debug_check_bounds::<PlayStatus>(offset);
10593            // Vector header
10594            let max_ordinal: u64 = self.max_ordinal_present();
10595            encoder.write_num(max_ordinal, offset);
10596            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10597            // Calling encoder.out_of_line_offset(0) is not allowed.
10598            if max_ordinal == 0 {
10599                return Ok(());
10600            }
10601            depth.increment()?;
10602            let envelope_size = 8;
10603            let bytes_len = max_ordinal as usize * envelope_size;
10604            #[allow(unused_variables)]
10605            let offset = encoder.out_of_line_offset(bytes_len);
10606            let mut _prev_end_offset: usize = 0;
10607            if 1 > max_ordinal {
10608                return Ok(());
10609            }
10610
10611            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10612            // are envelope_size bytes.
10613            let cur_offset: usize = (1 - 1) * envelope_size;
10614
10615            // Zero reserved fields.
10616            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10617
10618            // Safety:
10619            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10620            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10621            //   envelope_size bytes, there is always sufficient room.
10622            fidl::encoding::encode_in_envelope_optional::<u32, D>(
10623                self.song_length.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
10624                encoder,
10625                offset + cur_offset,
10626                depth,
10627            )?;
10628
10629            _prev_end_offset = cur_offset + envelope_size;
10630            if 2 > max_ordinal {
10631                return Ok(());
10632            }
10633
10634            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10635            // are envelope_size bytes.
10636            let cur_offset: usize = (2 - 1) * envelope_size;
10637
10638            // Zero reserved fields.
10639            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10640
10641            // Safety:
10642            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10643            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10644            //   envelope_size bytes, there is always sufficient room.
10645            fidl::encoding::encode_in_envelope_optional::<u32, D>(
10646                self.song_position.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
10647                encoder,
10648                offset + cur_offset,
10649                depth,
10650            )?;
10651
10652            _prev_end_offset = cur_offset + envelope_size;
10653            if 3 > max_ordinal {
10654                return Ok(());
10655            }
10656
10657            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10658            // are envelope_size bytes.
10659            let cur_offset: usize = (3 - 1) * envelope_size;
10660
10661            // Zero reserved fields.
10662            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10663
10664            // Safety:
10665            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10666            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10667            //   envelope_size bytes, there is always sufficient room.
10668            fidl::encoding::encode_in_envelope_optional::<PlaybackStatus, D>(
10669                self.playback_status
10670                    .as_ref()
10671                    .map(<PlaybackStatus as fidl::encoding::ValueTypeMarker>::borrow),
10672                encoder,
10673                offset + cur_offset,
10674                depth,
10675            )?;
10676
10677            _prev_end_offset = cur_offset + envelope_size;
10678
10679            Ok(())
10680        }
10681    }
10682
10683    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PlayStatus {
10684        #[inline(always)]
10685        fn new_empty() -> Self {
10686            Self::default()
10687        }
10688
10689        unsafe fn decode(
10690            &mut self,
10691            decoder: &mut fidl::encoding::Decoder<'_, D>,
10692            offset: usize,
10693            mut depth: fidl::encoding::Depth,
10694        ) -> fidl::Result<()> {
10695            decoder.debug_check_bounds::<Self>(offset);
10696            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10697                None => return Err(fidl::Error::NotNullable),
10698                Some(len) => len,
10699            };
10700            // Calling decoder.out_of_line_offset(0) is not allowed.
10701            if len == 0 {
10702                return Ok(());
10703            };
10704            depth.increment()?;
10705            let envelope_size = 8;
10706            let bytes_len = len * envelope_size;
10707            let offset = decoder.out_of_line_offset(bytes_len)?;
10708            // Decode the envelope for each type.
10709            let mut _next_ordinal_to_read = 0;
10710            let mut next_offset = offset;
10711            let end_offset = offset + bytes_len;
10712            _next_ordinal_to_read += 1;
10713            if next_offset >= end_offset {
10714                return Ok(());
10715            }
10716
10717            // Decode unknown envelopes for gaps in ordinals.
10718            while _next_ordinal_to_read < 1 {
10719                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10720                _next_ordinal_to_read += 1;
10721                next_offset += envelope_size;
10722            }
10723
10724            let next_out_of_line = decoder.next_out_of_line();
10725            let handles_before = decoder.remaining_handles();
10726            if let Some((inlined, num_bytes, num_handles)) =
10727                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10728            {
10729                let member_inline_size =
10730                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10731                if inlined != (member_inline_size <= 4) {
10732                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10733                }
10734                let inner_offset;
10735                let mut inner_depth = depth.clone();
10736                if inlined {
10737                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10738                    inner_offset = next_offset;
10739                } else {
10740                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10741                    inner_depth.increment()?;
10742                }
10743                let val_ref = self.song_length.get_or_insert_with(|| fidl::new_empty!(u32, D));
10744                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
10745                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10746                {
10747                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10748                }
10749                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10750                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10751                }
10752            }
10753
10754            next_offset += envelope_size;
10755            _next_ordinal_to_read += 1;
10756            if next_offset >= end_offset {
10757                return Ok(());
10758            }
10759
10760            // Decode unknown envelopes for gaps in ordinals.
10761            while _next_ordinal_to_read < 2 {
10762                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10763                _next_ordinal_to_read += 1;
10764                next_offset += envelope_size;
10765            }
10766
10767            let next_out_of_line = decoder.next_out_of_line();
10768            let handles_before = decoder.remaining_handles();
10769            if let Some((inlined, num_bytes, num_handles)) =
10770                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10771            {
10772                let member_inline_size =
10773                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10774                if inlined != (member_inline_size <= 4) {
10775                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10776                }
10777                let inner_offset;
10778                let mut inner_depth = depth.clone();
10779                if inlined {
10780                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10781                    inner_offset = next_offset;
10782                } else {
10783                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10784                    inner_depth.increment()?;
10785                }
10786                let val_ref = self.song_position.get_or_insert_with(|| fidl::new_empty!(u32, D));
10787                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
10788                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10789                {
10790                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10791                }
10792                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10793                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10794                }
10795            }
10796
10797            next_offset += envelope_size;
10798            _next_ordinal_to_read += 1;
10799            if next_offset >= end_offset {
10800                return Ok(());
10801            }
10802
10803            // Decode unknown envelopes for gaps in ordinals.
10804            while _next_ordinal_to_read < 3 {
10805                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10806                _next_ordinal_to_read += 1;
10807                next_offset += envelope_size;
10808            }
10809
10810            let next_out_of_line = decoder.next_out_of_line();
10811            let handles_before = decoder.remaining_handles();
10812            if let Some((inlined, num_bytes, num_handles)) =
10813                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10814            {
10815                let member_inline_size =
10816                    <PlaybackStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10817                if inlined != (member_inline_size <= 4) {
10818                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10819                }
10820                let inner_offset;
10821                let mut inner_depth = depth.clone();
10822                if inlined {
10823                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10824                    inner_offset = next_offset;
10825                } else {
10826                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10827                    inner_depth.increment()?;
10828                }
10829                let val_ref =
10830                    self.playback_status.get_or_insert_with(|| fidl::new_empty!(PlaybackStatus, D));
10831                fidl::decode!(PlaybackStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
10832                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10833                {
10834                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10835                }
10836                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10837                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10838                }
10839            }
10840
10841            next_offset += envelope_size;
10842
10843            // Decode the remaining unknown envelopes.
10844            while next_offset < end_offset {
10845                _next_ordinal_to_read += 1;
10846                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10847                next_offset += envelope_size;
10848            }
10849
10850            Ok(())
10851        }
10852    }
10853
10854    impl PlayerApplicationSettings {
10855        #[inline(always)]
10856        fn max_ordinal_present(&self) -> u64 {
10857            if let Some(_) = self.custom_settings {
10858                return 5;
10859            }
10860            if let Some(_) = self.scan_mode {
10861                return 4;
10862            }
10863            if let Some(_) = self.shuffle_mode {
10864                return 3;
10865            }
10866            if let Some(_) = self.repeat_status_mode {
10867                return 2;
10868            }
10869            if let Some(_) = self.equalizer {
10870                return 1;
10871            }
10872            0
10873        }
10874    }
10875
10876    impl fidl::encoding::ValueTypeMarker for PlayerApplicationSettings {
10877        type Borrowed<'a> = &'a Self;
10878        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10879            value
10880        }
10881    }
10882
10883    unsafe impl fidl::encoding::TypeMarker for PlayerApplicationSettings {
10884        type Owned = Self;
10885
10886        #[inline(always)]
10887        fn inline_align(_context: fidl::encoding::Context) -> usize {
10888            8
10889        }
10890
10891        #[inline(always)]
10892        fn inline_size(_context: fidl::encoding::Context) -> usize {
10893            16
10894        }
10895    }
10896
10897    unsafe impl<D: fidl::encoding::ResourceDialect>
10898        fidl::encoding::Encode<PlayerApplicationSettings, D> for &PlayerApplicationSettings
10899    {
10900        unsafe fn encode(
10901            self,
10902            encoder: &mut fidl::encoding::Encoder<'_, D>,
10903            offset: usize,
10904            mut depth: fidl::encoding::Depth,
10905        ) -> fidl::Result<()> {
10906            encoder.debug_check_bounds::<PlayerApplicationSettings>(offset);
10907            // Vector header
10908            let max_ordinal: u64 = self.max_ordinal_present();
10909            encoder.write_num(max_ordinal, offset);
10910            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10911            // Calling encoder.out_of_line_offset(0) is not allowed.
10912            if max_ordinal == 0 {
10913                return Ok(());
10914            }
10915            depth.increment()?;
10916            let envelope_size = 8;
10917            let bytes_len = max_ordinal as usize * envelope_size;
10918            #[allow(unused_variables)]
10919            let offset = encoder.out_of_line_offset(bytes_len);
10920            let mut _prev_end_offset: usize = 0;
10921            if 1 > max_ordinal {
10922                return Ok(());
10923            }
10924
10925            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10926            // are envelope_size bytes.
10927            let cur_offset: usize = (1 - 1) * envelope_size;
10928
10929            // Zero reserved fields.
10930            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10931
10932            // Safety:
10933            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10934            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10935            //   envelope_size bytes, there is always sufficient room.
10936            fidl::encoding::encode_in_envelope_optional::<Equalizer, D>(
10937                self.equalizer.as_ref().map(<Equalizer as fidl::encoding::ValueTypeMarker>::borrow),
10938                encoder,
10939                offset + cur_offset,
10940                depth,
10941            )?;
10942
10943            _prev_end_offset = cur_offset + envelope_size;
10944            if 2 > max_ordinal {
10945                return Ok(());
10946            }
10947
10948            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10949            // are envelope_size bytes.
10950            let cur_offset: usize = (2 - 1) * envelope_size;
10951
10952            // Zero reserved fields.
10953            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10954
10955            // Safety:
10956            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10957            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10958            //   envelope_size bytes, there is always sufficient room.
10959            fidl::encoding::encode_in_envelope_optional::<RepeatStatusMode, D>(
10960                self.repeat_status_mode
10961                    .as_ref()
10962                    .map(<RepeatStatusMode as fidl::encoding::ValueTypeMarker>::borrow),
10963                encoder,
10964                offset + cur_offset,
10965                depth,
10966            )?;
10967
10968            _prev_end_offset = cur_offset + envelope_size;
10969            if 3 > max_ordinal {
10970                return Ok(());
10971            }
10972
10973            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10974            // are envelope_size bytes.
10975            let cur_offset: usize = (3 - 1) * envelope_size;
10976
10977            // Zero reserved fields.
10978            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10979
10980            // Safety:
10981            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10982            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10983            //   envelope_size bytes, there is always sufficient room.
10984            fidl::encoding::encode_in_envelope_optional::<ShuffleMode, D>(
10985                self.shuffle_mode
10986                    .as_ref()
10987                    .map(<ShuffleMode as fidl::encoding::ValueTypeMarker>::borrow),
10988                encoder,
10989                offset + cur_offset,
10990                depth,
10991            )?;
10992
10993            _prev_end_offset = cur_offset + envelope_size;
10994            if 4 > max_ordinal {
10995                return Ok(());
10996            }
10997
10998            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10999            // are envelope_size bytes.
11000            let cur_offset: usize = (4 - 1) * envelope_size;
11001
11002            // Zero reserved fields.
11003            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11004
11005            // Safety:
11006            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11007            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11008            //   envelope_size bytes, there is always sufficient room.
11009            fidl::encoding::encode_in_envelope_optional::<ScanMode, D>(
11010                self.scan_mode.as_ref().map(<ScanMode as fidl::encoding::ValueTypeMarker>::borrow),
11011                encoder,
11012                offset + cur_offset,
11013                depth,
11014            )?;
11015
11016            _prev_end_offset = cur_offset + envelope_size;
11017            if 5 > max_ordinal {
11018                return Ok(());
11019            }
11020
11021            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
11022            // are envelope_size bytes.
11023            let cur_offset: usize = (5 - 1) * envelope_size;
11024
11025            // Zero reserved fields.
11026            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
11027
11028            // Safety:
11029            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
11030            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
11031            //   envelope_size bytes, there is always sufficient room.
11032            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<CustomPlayerApplicationSetting, 127>, D>(
11033            self.custom_settings.as_ref().map(<fidl::encoding::Vector<CustomPlayerApplicationSetting, 127> as fidl::encoding::ValueTypeMarker>::borrow),
11034            encoder, offset + cur_offset, depth
11035        )?;
11036
11037            _prev_end_offset = cur_offset + envelope_size;
11038
11039            Ok(())
11040        }
11041    }
11042
11043    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11044        for PlayerApplicationSettings
11045    {
11046        #[inline(always)]
11047        fn new_empty() -> Self {
11048            Self::default()
11049        }
11050
11051        unsafe fn decode(
11052            &mut self,
11053            decoder: &mut fidl::encoding::Decoder<'_, D>,
11054            offset: usize,
11055            mut depth: fidl::encoding::Depth,
11056        ) -> fidl::Result<()> {
11057            decoder.debug_check_bounds::<Self>(offset);
11058            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
11059                None => return Err(fidl::Error::NotNullable),
11060                Some(len) => len,
11061            };
11062            // Calling decoder.out_of_line_offset(0) is not allowed.
11063            if len == 0 {
11064                return Ok(());
11065            };
11066            depth.increment()?;
11067            let envelope_size = 8;
11068            let bytes_len = len * envelope_size;
11069            let offset = decoder.out_of_line_offset(bytes_len)?;
11070            // Decode the envelope for each type.
11071            let mut _next_ordinal_to_read = 0;
11072            let mut next_offset = offset;
11073            let end_offset = offset + bytes_len;
11074            _next_ordinal_to_read += 1;
11075            if next_offset >= end_offset {
11076                return Ok(());
11077            }
11078
11079            // Decode unknown envelopes for gaps in ordinals.
11080            while _next_ordinal_to_read < 1 {
11081                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11082                _next_ordinal_to_read += 1;
11083                next_offset += envelope_size;
11084            }
11085
11086            let next_out_of_line = decoder.next_out_of_line();
11087            let handles_before = decoder.remaining_handles();
11088            if let Some((inlined, num_bytes, num_handles)) =
11089                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11090            {
11091                let member_inline_size =
11092                    <Equalizer as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11093                if inlined != (member_inline_size <= 4) {
11094                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11095                }
11096                let inner_offset;
11097                let mut inner_depth = depth.clone();
11098                if inlined {
11099                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11100                    inner_offset = next_offset;
11101                } else {
11102                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11103                    inner_depth.increment()?;
11104                }
11105                let val_ref = self.equalizer.get_or_insert_with(|| fidl::new_empty!(Equalizer, D));
11106                fidl::decode!(Equalizer, D, val_ref, decoder, inner_offset, inner_depth)?;
11107                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11108                {
11109                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11110                }
11111                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11112                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11113                }
11114            }
11115
11116            next_offset += envelope_size;
11117            _next_ordinal_to_read += 1;
11118            if next_offset >= end_offset {
11119                return Ok(());
11120            }
11121
11122            // Decode unknown envelopes for gaps in ordinals.
11123            while _next_ordinal_to_read < 2 {
11124                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11125                _next_ordinal_to_read += 1;
11126                next_offset += envelope_size;
11127            }
11128
11129            let next_out_of_line = decoder.next_out_of_line();
11130            let handles_before = decoder.remaining_handles();
11131            if let Some((inlined, num_bytes, num_handles)) =
11132                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11133            {
11134                let member_inline_size =
11135                    <RepeatStatusMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11136                if inlined != (member_inline_size <= 4) {
11137                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11138                }
11139                let inner_offset;
11140                let mut inner_depth = depth.clone();
11141                if inlined {
11142                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11143                    inner_offset = next_offset;
11144                } else {
11145                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11146                    inner_depth.increment()?;
11147                }
11148                let val_ref = self
11149                    .repeat_status_mode
11150                    .get_or_insert_with(|| fidl::new_empty!(RepeatStatusMode, D));
11151                fidl::decode!(RepeatStatusMode, D, val_ref, decoder, inner_offset, inner_depth)?;
11152                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11153                {
11154                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11155                }
11156                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11157                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11158                }
11159            }
11160
11161            next_offset += envelope_size;
11162            _next_ordinal_to_read += 1;
11163            if next_offset >= end_offset {
11164                return Ok(());
11165            }
11166
11167            // Decode unknown envelopes for gaps in ordinals.
11168            while _next_ordinal_to_read < 3 {
11169                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11170                _next_ordinal_to_read += 1;
11171                next_offset += envelope_size;
11172            }
11173
11174            let next_out_of_line = decoder.next_out_of_line();
11175            let handles_before = decoder.remaining_handles();
11176            if let Some((inlined, num_bytes, num_handles)) =
11177                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11178            {
11179                let member_inline_size =
11180                    <ShuffleMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11181                if inlined != (member_inline_size <= 4) {
11182                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11183                }
11184                let inner_offset;
11185                let mut inner_depth = depth.clone();
11186                if inlined {
11187                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11188                    inner_offset = next_offset;
11189                } else {
11190                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11191                    inner_depth.increment()?;
11192                }
11193                let val_ref =
11194                    self.shuffle_mode.get_or_insert_with(|| fidl::new_empty!(ShuffleMode, D));
11195                fidl::decode!(ShuffleMode, D, val_ref, decoder, inner_offset, inner_depth)?;
11196                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11197                {
11198                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11199                }
11200                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11201                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11202                }
11203            }
11204
11205            next_offset += envelope_size;
11206            _next_ordinal_to_read += 1;
11207            if next_offset >= end_offset {
11208                return Ok(());
11209            }
11210
11211            // Decode unknown envelopes for gaps in ordinals.
11212            while _next_ordinal_to_read < 4 {
11213                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11214                _next_ordinal_to_read += 1;
11215                next_offset += envelope_size;
11216            }
11217
11218            let next_out_of_line = decoder.next_out_of_line();
11219            let handles_before = decoder.remaining_handles();
11220            if let Some((inlined, num_bytes, num_handles)) =
11221                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11222            {
11223                let member_inline_size =
11224                    <ScanMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
11225                if inlined != (member_inline_size <= 4) {
11226                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11227                }
11228                let inner_offset;
11229                let mut inner_depth = depth.clone();
11230                if inlined {
11231                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11232                    inner_offset = next_offset;
11233                } else {
11234                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11235                    inner_depth.increment()?;
11236                }
11237                let val_ref = self.scan_mode.get_or_insert_with(|| fidl::new_empty!(ScanMode, D));
11238                fidl::decode!(ScanMode, D, val_ref, decoder, inner_offset, inner_depth)?;
11239                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11240                {
11241                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11242                }
11243                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11244                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11245                }
11246            }
11247
11248            next_offset += envelope_size;
11249            _next_ordinal_to_read += 1;
11250            if next_offset >= end_offset {
11251                return Ok(());
11252            }
11253
11254            // Decode unknown envelopes for gaps in ordinals.
11255            while _next_ordinal_to_read < 5 {
11256                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11257                _next_ordinal_to_read += 1;
11258                next_offset += envelope_size;
11259            }
11260
11261            let next_out_of_line = decoder.next_out_of_line();
11262            let handles_before = decoder.remaining_handles();
11263            if let Some((inlined, num_bytes, num_handles)) =
11264                fidl::encoding::decode_envelope_header(decoder, next_offset)?
11265            {
11266                let member_inline_size = <fidl::encoding::Vector<
11267                    CustomPlayerApplicationSetting,
11268                    127,
11269                > as fidl::encoding::TypeMarker>::inline_size(
11270                    decoder.context
11271                );
11272                if inlined != (member_inline_size <= 4) {
11273                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
11274                }
11275                let inner_offset;
11276                let mut inner_depth = depth.clone();
11277                if inlined {
11278                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
11279                    inner_offset = next_offset;
11280                } else {
11281                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11282                    inner_depth.increment()?;
11283                }
11284                let val_ref =
11285                self.custom_settings.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<CustomPlayerApplicationSetting, 127>, D));
11286                fidl::decode!(fidl::encoding::Vector<CustomPlayerApplicationSetting, 127>, D, val_ref, decoder, inner_offset, inner_depth)?;
11287                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
11288                {
11289                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
11290                }
11291                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11292                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11293                }
11294            }
11295
11296            next_offset += envelope_size;
11297
11298            // Decode the remaining unknown envelopes.
11299            while next_offset < end_offset {
11300                _next_ordinal_to_read += 1;
11301                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
11302                next_offset += envelope_size;
11303            }
11304
11305            Ok(())
11306        }
11307    }
11308
11309    impl fidl::encoding::ValueTypeMarker for AttributeRequestOption {
11310        type Borrowed<'a> = &'a Self;
11311        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11312            value
11313        }
11314    }
11315
11316    unsafe impl fidl::encoding::TypeMarker for AttributeRequestOption {
11317        type Owned = Self;
11318
11319        #[inline(always)]
11320        fn inline_align(_context: fidl::encoding::Context) -> usize {
11321            8
11322        }
11323
11324        #[inline(always)]
11325        fn inline_size(_context: fidl::encoding::Context) -> usize {
11326            16
11327        }
11328    }
11329
11330    unsafe impl<D: fidl::encoding::ResourceDialect>
11331        fidl::encoding::Encode<AttributeRequestOption, D> for &AttributeRequestOption
11332    {
11333        #[inline]
11334        unsafe fn encode(
11335            self,
11336            encoder: &mut fidl::encoding::Encoder<'_, D>,
11337            offset: usize,
11338            _depth: fidl::encoding::Depth,
11339        ) -> fidl::Result<()> {
11340            encoder.debug_check_bounds::<AttributeRequestOption>(offset);
11341            encoder.write_num::<u64>(self.ordinal(), offset);
11342            match self {
11343            AttributeRequestOption::GetAll(ref val) => {
11344                fidl::encoding::encode_in_envelope::<bool, D>(
11345                    <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
11346                    encoder, offset + 8, _depth
11347                )
11348            }
11349            AttributeRequestOption::AttributeList(ref val) => {
11350                fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<MediaAttributeId, 8>, D>(
11351                    <fidl::encoding::Vector<MediaAttributeId, 8> as fidl::encoding::ValueTypeMarker>::borrow(val),
11352                    encoder, offset + 8, _depth
11353                )
11354            }
11355        }
11356        }
11357    }
11358
11359    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11360        for AttributeRequestOption
11361    {
11362        #[inline(always)]
11363        fn new_empty() -> Self {
11364            Self::GetAll(fidl::new_empty!(bool, D))
11365        }
11366
11367        #[inline]
11368        unsafe fn decode(
11369            &mut self,
11370            decoder: &mut fidl::encoding::Decoder<'_, D>,
11371            offset: usize,
11372            mut depth: fidl::encoding::Depth,
11373        ) -> fidl::Result<()> {
11374            decoder.debug_check_bounds::<Self>(offset);
11375            #[allow(unused_variables)]
11376            let next_out_of_line = decoder.next_out_of_line();
11377            let handles_before = decoder.remaining_handles();
11378            let (ordinal, inlined, num_bytes, num_handles) =
11379                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
11380
11381            let member_inline_size = match ordinal {
11382            1 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11383            2 => <fidl::encoding::Vector<MediaAttributeId, 8> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11384            _ => return Err(fidl::Error::UnknownUnionTag),
11385        };
11386
11387            if inlined != (member_inline_size <= 4) {
11388                return Err(fidl::Error::InvalidInlineBitInEnvelope);
11389            }
11390            let _inner_offset;
11391            if inlined {
11392                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
11393                _inner_offset = offset + 8;
11394            } else {
11395                depth.increment()?;
11396                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11397            }
11398            match ordinal {
11399                1 => {
11400                    #[allow(irrefutable_let_patterns)]
11401                    if let AttributeRequestOption::GetAll(_) = self {
11402                        // Do nothing, read the value into the object
11403                    } else {
11404                        // Initialize `self` to the right variant
11405                        *self = AttributeRequestOption::GetAll(fidl::new_empty!(bool, D));
11406                    }
11407                    #[allow(irrefutable_let_patterns)]
11408                    if let AttributeRequestOption::GetAll(ref mut val) = self {
11409                        fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
11410                    } else {
11411                        unreachable!()
11412                    }
11413                }
11414                2 => {
11415                    #[allow(irrefutable_let_patterns)]
11416                    if let AttributeRequestOption::AttributeList(_) = self {
11417                        // Do nothing, read the value into the object
11418                    } else {
11419                        // Initialize `self` to the right variant
11420                        *self = AttributeRequestOption::AttributeList(
11421                            fidl::new_empty!(fidl::encoding::Vector<MediaAttributeId, 8>, D),
11422                        );
11423                    }
11424                    #[allow(irrefutable_let_patterns)]
11425                    if let AttributeRequestOption::AttributeList(ref mut val) = self {
11426                        fidl::decode!(fidl::encoding::Vector<MediaAttributeId, 8>, D, val, decoder, _inner_offset, depth)?;
11427                    } else {
11428                        unreachable!()
11429                    }
11430                }
11431                ordinal => panic!("unexpected ordinal {:?}", ordinal),
11432            }
11433            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
11434                return Err(fidl::Error::InvalidNumBytesInEnvelope);
11435            }
11436            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11437                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11438            }
11439            Ok(())
11440        }
11441    }
11442
11443    impl fidl::encoding::ValueTypeMarker for FileSystemItem {
11444        type Borrowed<'a> = &'a Self;
11445        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11446            value
11447        }
11448    }
11449
11450    unsafe impl fidl::encoding::TypeMarker for FileSystemItem {
11451        type Owned = Self;
11452
11453        #[inline(always)]
11454        fn inline_align(_context: fidl::encoding::Context) -> usize {
11455            8
11456        }
11457
11458        #[inline(always)]
11459        fn inline_size(_context: fidl::encoding::Context) -> usize {
11460            16
11461        }
11462    }
11463
11464    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileSystemItem, D>
11465        for &FileSystemItem
11466    {
11467        #[inline]
11468        unsafe fn encode(
11469            self,
11470            encoder: &mut fidl::encoding::Encoder<'_, D>,
11471            offset: usize,
11472            _depth: fidl::encoding::Depth,
11473        ) -> fidl::Result<()> {
11474            encoder.debug_check_bounds::<FileSystemItem>(offset);
11475            encoder.write_num::<u64>(self.ordinal(), offset);
11476            match self {
11477                FileSystemItem::Folder(ref val) => {
11478                    fidl::encoding::encode_in_envelope::<FolderItem, D>(
11479                        <FolderItem as fidl::encoding::ValueTypeMarker>::borrow(val),
11480                        encoder,
11481                        offset + 8,
11482                        _depth,
11483                    )
11484                }
11485                FileSystemItem::MediaElement(ref val) => {
11486                    fidl::encoding::encode_in_envelope::<MediaElementItem, D>(
11487                        <MediaElementItem as fidl::encoding::ValueTypeMarker>::borrow(val),
11488                        encoder,
11489                        offset + 8,
11490                        _depth,
11491                    )
11492                }
11493            }
11494        }
11495    }
11496
11497    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileSystemItem {
11498        #[inline(always)]
11499        fn new_empty() -> Self {
11500            Self::Folder(fidl::new_empty!(FolderItem, D))
11501        }
11502
11503        #[inline]
11504        unsafe fn decode(
11505            &mut self,
11506            decoder: &mut fidl::encoding::Decoder<'_, D>,
11507            offset: usize,
11508            mut depth: fidl::encoding::Depth,
11509        ) -> fidl::Result<()> {
11510            decoder.debug_check_bounds::<Self>(offset);
11511            #[allow(unused_variables)]
11512            let next_out_of_line = decoder.next_out_of_line();
11513            let handles_before = decoder.remaining_handles();
11514            let (ordinal, inlined, num_bytes, num_handles) =
11515                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
11516
11517            let member_inline_size = match ordinal {
11518                1 => <FolderItem as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11519                2 => <MediaElementItem as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11520                _ => return Err(fidl::Error::UnknownUnionTag),
11521            };
11522
11523            if inlined != (member_inline_size <= 4) {
11524                return Err(fidl::Error::InvalidInlineBitInEnvelope);
11525            }
11526            let _inner_offset;
11527            if inlined {
11528                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
11529                _inner_offset = offset + 8;
11530            } else {
11531                depth.increment()?;
11532                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11533            }
11534            match ordinal {
11535                1 => {
11536                    #[allow(irrefutable_let_patterns)]
11537                    if let FileSystemItem::Folder(_) = self {
11538                        // Do nothing, read the value into the object
11539                    } else {
11540                        // Initialize `self` to the right variant
11541                        *self = FileSystemItem::Folder(fidl::new_empty!(FolderItem, D));
11542                    }
11543                    #[allow(irrefutable_let_patterns)]
11544                    if let FileSystemItem::Folder(ref mut val) = self {
11545                        fidl::decode!(FolderItem, D, val, decoder, _inner_offset, depth)?;
11546                    } else {
11547                        unreachable!()
11548                    }
11549                }
11550                2 => {
11551                    #[allow(irrefutable_let_patterns)]
11552                    if let FileSystemItem::MediaElement(_) = self {
11553                        // Do nothing, read the value into the object
11554                    } else {
11555                        // Initialize `self` to the right variant
11556                        *self = FileSystemItem::MediaElement(fidl::new_empty!(MediaElementItem, D));
11557                    }
11558                    #[allow(irrefutable_let_patterns)]
11559                    if let FileSystemItem::MediaElement(ref mut val) = self {
11560                        fidl::decode!(MediaElementItem, D, val, decoder, _inner_offset, depth)?;
11561                    } else {
11562                        unreachable!()
11563                    }
11564                }
11565                ordinal => panic!("unexpected ordinal {:?}", ordinal),
11566            }
11567            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
11568                return Err(fidl::Error::InvalidNumBytesInEnvelope);
11569            }
11570            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11571                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11572            }
11573            Ok(())
11574        }
11575    }
11576
11577    impl fidl::encoding::ValueTypeMarker for Path {
11578        type Borrowed<'a> = &'a Self;
11579        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11580            value
11581        }
11582    }
11583
11584    unsafe impl fidl::encoding::TypeMarker for Path {
11585        type Owned = Self;
11586
11587        #[inline(always)]
11588        fn inline_align(_context: fidl::encoding::Context) -> usize {
11589            8
11590        }
11591
11592        #[inline(always)]
11593        fn inline_size(_context: fidl::encoding::Context) -> usize {
11594            16
11595        }
11596    }
11597
11598    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Path, D> for &Path {
11599        #[inline]
11600        unsafe fn encode(
11601            self,
11602            encoder: &mut fidl::encoding::Encoder<'_, D>,
11603            offset: usize,
11604            _depth: fidl::encoding::Depth,
11605        ) -> fidl::Result<()> {
11606            encoder.debug_check_bounds::<Path>(offset);
11607            encoder.write_num::<u64>(self.ordinal(), offset);
11608            match self {
11609                Path::Parent(ref val) => fidl::encoding::encode_in_envelope::<Parent, D>(
11610                    <Parent as fidl::encoding::ValueTypeMarker>::borrow(val),
11611                    encoder,
11612                    offset + 8,
11613                    _depth,
11614                ),
11615                Path::ChildFolderUid(ref val) => fidl::encoding::encode_in_envelope::<u64, D>(
11616                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
11617                    encoder,
11618                    offset + 8,
11619                    _depth,
11620                ),
11621                Path::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
11622            }
11623        }
11624    }
11625
11626    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Path {
11627        #[inline(always)]
11628        fn new_empty() -> Self {
11629            Self::__SourceBreaking { unknown_ordinal: 0 }
11630        }
11631
11632        #[inline]
11633        unsafe fn decode(
11634            &mut self,
11635            decoder: &mut fidl::encoding::Decoder<'_, D>,
11636            offset: usize,
11637            mut depth: fidl::encoding::Depth,
11638        ) -> fidl::Result<()> {
11639            decoder.debug_check_bounds::<Self>(offset);
11640            #[allow(unused_variables)]
11641            let next_out_of_line = decoder.next_out_of_line();
11642            let handles_before = decoder.remaining_handles();
11643            let (ordinal, inlined, num_bytes, num_handles) =
11644                fidl::encoding::decode_union_inline_portion(decoder, offset)?;
11645
11646            let member_inline_size = match ordinal {
11647                1 => <Parent as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11648                2 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
11649                0 => return Err(fidl::Error::UnknownUnionTag),
11650                _ => num_bytes as usize,
11651            };
11652
11653            if inlined != (member_inline_size <= 4) {
11654                return Err(fidl::Error::InvalidInlineBitInEnvelope);
11655            }
11656            let _inner_offset;
11657            if inlined {
11658                decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
11659                _inner_offset = offset + 8;
11660            } else {
11661                depth.increment()?;
11662                _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
11663            }
11664            match ordinal {
11665                1 => {
11666                    #[allow(irrefutable_let_patterns)]
11667                    if let Path::Parent(_) = self {
11668                        // Do nothing, read the value into the object
11669                    } else {
11670                        // Initialize `self` to the right variant
11671                        *self = Path::Parent(fidl::new_empty!(Parent, D));
11672                    }
11673                    #[allow(irrefutable_let_patterns)]
11674                    if let Path::Parent(ref mut val) = self {
11675                        fidl::decode!(Parent, D, val, decoder, _inner_offset, depth)?;
11676                    } else {
11677                        unreachable!()
11678                    }
11679                }
11680                2 => {
11681                    #[allow(irrefutable_let_patterns)]
11682                    if let Path::ChildFolderUid(_) = self {
11683                        // Do nothing, read the value into the object
11684                    } else {
11685                        // Initialize `self` to the right variant
11686                        *self = Path::ChildFolderUid(fidl::new_empty!(u64, D));
11687                    }
11688                    #[allow(irrefutable_let_patterns)]
11689                    if let Path::ChildFolderUid(ref mut val) = self {
11690                        fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
11691                    } else {
11692                        unreachable!()
11693                    }
11694                }
11695                #[allow(deprecated)]
11696                ordinal => {
11697                    for _ in 0..num_handles {
11698                        decoder.drop_next_handle()?;
11699                    }
11700                    *self = Path::__SourceBreaking { unknown_ordinal: ordinal };
11701                }
11702            }
11703            if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
11704                return Err(fidl::Error::InvalidNumBytesInEnvelope);
11705            }
11706            if handles_before != decoder.remaining_handles() + (num_handles as usize) {
11707                return Err(fidl::Error::InvalidNumHandlesInEnvelope);
11708            }
11709            Ok(())
11710        }
11711    }
11712}