1#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10use futures::future::{self, MaybeDone, TryFutureExt};
11use zx_status;
12
13pub const MAX_ATTRIBUTES: u64 = 131;
16
17pub const MAX_ATTRIBUTE_VALUES: u64 = 255;
20
21pub const MAX_ATTRIBUTE_VALUE_LENGTH: u64 = 65535;
24
25pub const MAX_CUSTOM_ATTRIBUTES: u64 = 127;
28
29pub const MAX_FILESYSTEM_ITEMS: u16 = 16;
34
35pub const MAX_MEDIA_PLAYER_ITEMS: u16 = 16;
40
41pub const MAX_NOTIFICATIONS: u8 = 255;
45
46pub const MAX_NOW_PLAYING_ITEMS: u16 = 16;
51
52pub const MAX_NUM_MEDIA_ATTRIBUTES: u8 = 8;
57
58bitflags! {
59 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
62 pub struct MajorPlayerType: u8 {
63 const AUDIO = 1;
64 const VIDEO = 2;
65 const BROADCASTING_AUDIO = 4;
66 const BROADCASTING_VIDEO = 8;
67 }
68}
69
70impl MajorPlayerType {
71 #[deprecated = "Strict bits should not use `has_unknown_bits`"]
72 #[inline(always)]
73 pub fn has_unknown_bits(&self) -> bool {
74 false
75 }
76
77 #[deprecated = "Strict bits should not use `get_unknown_bits`"]
78 #[inline(always)]
79 pub fn get_unknown_bits(&self) -> u8 {
80 0
81 }
82}
83
84bitflags! {
85 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
87 pub struct Notifications: u32 {
88 const PLAYBACK_STATUS = 1;
90 const TRACK = 2;
92 const TRACK_POS = 4;
94 const BATT_STATUS = 8;
96 const SYSTEM_STATUS = 16;
98 const PLAYER_APPLICATION_SETTINGS = 32;
100 const ADDRESSED_PLAYER = 64;
102 const VOLUME = 128;
104 const AVAILABLE_PLAYERS = 256;
106 const CONNECTION = 65536;
108 }
109}
110
111impl Notifications {
112 #[deprecated = "Strict bits should not use `has_unknown_bits`"]
113 #[inline(always)]
114 pub fn has_unknown_bits(&self) -> bool {
115 false
116 }
117
118 #[deprecated = "Strict bits should not use `get_unknown_bits`"]
119 #[inline(always)]
120 pub fn get_unknown_bits(&self) -> u32 {
121 0
122 }
123}
124
125bitflags! {
126 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
127 pub struct PlayerFeatureBits: u64 {
128 const SELECT = 72057594037927936;
129 const UP = 144115188075855872;
130 const DOWN = 288230376151711744;
131 const LEFT = 576460752303423488;
132 const RIGHT = 1152921504606846976;
133 const RIGHT_UP = 2305843009213693952;
134 const RIGHT_DOWN = 4611686018427387904;
135 const LEFT_UP = 9223372036854775808;
136 const LEFT_DOWN = 281474976710656;
137 const ROOT_MENU = 562949953421312;
138 const SETUP_MENU = 1125899906842624;
139 const CONTENTS_MENU = 2251799813685248;
140 const FAVORITE_MENU = 4503599627370496;
141 const EXIT = 9007199254740992;
142 const ZERO = 18014398509481984;
143 const ONE = 36028797018963968;
144 const TWO = 1099511627776;
145 const THREE = 2199023255552;
146 const FOUR = 4398046511104;
147 const FIVE = 8796093022208;
148 const SIX = 17592186044416;
149 const SEVEN = 35184372088832;
150 const EIGHT = 70368744177664;
151 const NINE = 140737488355328;
152 const DOT = 4294967296;
153 const ENTER = 8589934592;
154 const CLEAR = 17179869184;
155 const CHANNEL_UP = 34359738368;
156 const CHANNEL_DOWN = 68719476736;
157 const PREVIOUS_CHANNEL = 137438953472;
158 const SOUND_SELECT = 274877906944;
159 const INPUT_SELECT = 549755813888;
160 const DISPLAY_INFORMATION = 16777216;
161 const HELP = 33554432;
162 const PAGE_UP = 67108864;
163 const PAGE_DOWN = 134217728;
164 const POWER = 268435456;
165 const VOLUME_UP = 536870912;
166 const VOLUME_DOWN = 1073741824;
167 const MUTE = 2147483648;
168 const PLAY = 65536;
169 const STOP = 131072;
170 const PAUSE = 262144;
171 const RECORD = 524288;
172 const REWIND = 1048576;
173 const FAST_FORWARD = 2097152;
174 const EJECT = 4194304;
175 const FORWARD = 8388608;
176 const BACKWARD = 256;
177 const ANGLE = 512;
178 const SUBPICTURE = 1024;
179 const F1 = 2048;
180 const F2 = 4096;
181 const F3 = 8192;
182 const F4 = 16384;
183 const F5 = 32768;
184 const VENDOR_UNIQUE = 1;
185 const BASIC_GROUP_NAVIGATION = 2;
186 const ADVANCED_CONTROL_PLAYER = 4;
187 const BROWSING = 8;
188 const SEARCHING = 16;
189 const ADD_TO_NOW_PLAYING = 32;
190 const UIDS_UNIQUE_IN_PLAYER_BROWSE_TREE = 64;
191 const ONLY_BROWSABLE_WHEN_ADDRESSED = 128;
192 }
193}
194
195impl PlayerFeatureBits {
196 #[deprecated = "Strict bits should not use `has_unknown_bits`"]
197 #[inline(always)]
198 pub fn has_unknown_bits(&self) -> bool {
199 false
200 }
201
202 #[deprecated = "Strict bits should not use `get_unknown_bits`"]
203 #[inline(always)]
204 pub fn get_unknown_bits(&self) -> u64 {
205 0
206 }
207}
208
209bitflags! {
210 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
211 pub struct PlayerFeatureBitsExt: u64 {
212 const ONLY_SEARCHABLE_WHEN_ADDRESSED = 72057594037927936;
213 const NOW_PLAYING = 144115188075855872;
214 const UID_PERSISTENCY = 288230376151711744;
215 const NUMBER_OF_ITEMS = 576460752303423488;
216 const COVER_ART = 1152921504606846976;
217 }
218}
219
220impl PlayerFeatureBitsExt {
221 #[deprecated = "Strict bits should not use `has_unknown_bits`"]
222 #[inline(always)]
223 pub fn has_unknown_bits(&self) -> bool {
224 false
225 }
226
227 #[deprecated = "Strict bits should not use `get_unknown_bits`"]
228 #[inline(always)]
229 pub fn get_unknown_bits(&self) -> u64 {
230 0
231 }
232}
233
234bitflags! {
235 #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
238 pub struct PlayerSubType: u32 {
239 const AUDIO_BOOK = 1;
240 const PODCAST = 2;
241 }
242}
243
244impl PlayerSubType {
245 #[deprecated = "Strict bits should not use `has_unknown_bits`"]
246 #[inline(always)]
247 pub fn has_unknown_bits(&self) -> bool {
248 false
249 }
250
251 #[deprecated = "Strict bits should not use `get_unknown_bits`"]
252 #[inline(always)]
253 pub fn get_unknown_bits(&self) -> u32 {
254 0
255 }
256}
257
258#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
260#[repr(u8)]
261pub enum AvcPanelCommand {
262 Select = 0,
263 Up = 1,
264 Down = 2,
265 Left = 3,
266 Right = 4,
267 RootMenu = 9,
268 ContentsMenu = 11,
269 FavoriteMenu = 12,
270 Exit = 13,
271 OnDemandMenu = 14,
272 AppsMenu = 15,
273 Key0 = 32,
274 Key1 = 33,
275 Key2 = 34,
276 Key3 = 35,
277 Key4 = 36,
278 Key5 = 37,
279 Key6 = 38,
280 Key7 = 39,
281 Key8 = 40,
282 Key9 = 41,
283 Dot = 42,
284 Enter = 43,
285 ChannelUp = 48,
286 ChannelDown = 49,
287 ChannelPrevious = 50,
288 InputSelect = 52,
289 Info = 53,
290 Help = 54,
291 PageUp = 55,
292 PageDown = 56,
293 Lock = 58,
294 Power = 64,
295 VolumeUp = 65,
296 VolumeDown = 66,
297 Mute = 67,
298 Play = 68,
299 Stop = 69,
300 Pause = 70,
301 Record = 71,
302 Rewind = 72,
303 FastForward = 73,
304 Eject = 74,
305 Forward = 75,
306 Backward = 76,
307 List = 77,
308 F1 = 113,
309 F2 = 114,
310 F3 = 115,
311 F4 = 116,
312 F5 = 117,
313 F6 = 118,
314 F7 = 119,
315 F8 = 120,
316 F9 = 121,
317 Red = 122,
318 Green = 123,
319 Blue = 124,
320 Yellow = 125,
321}
322
323impl AvcPanelCommand {
324 #[inline]
325 pub fn from_primitive(prim: u8) -> Option<Self> {
326 match prim {
327 0 => Some(Self::Select),
328 1 => Some(Self::Up),
329 2 => Some(Self::Down),
330 3 => Some(Self::Left),
331 4 => Some(Self::Right),
332 9 => Some(Self::RootMenu),
333 11 => Some(Self::ContentsMenu),
334 12 => Some(Self::FavoriteMenu),
335 13 => Some(Self::Exit),
336 14 => Some(Self::OnDemandMenu),
337 15 => Some(Self::AppsMenu),
338 32 => Some(Self::Key0),
339 33 => Some(Self::Key1),
340 34 => Some(Self::Key2),
341 35 => Some(Self::Key3),
342 36 => Some(Self::Key4),
343 37 => Some(Self::Key5),
344 38 => Some(Self::Key6),
345 39 => Some(Self::Key7),
346 40 => Some(Self::Key8),
347 41 => Some(Self::Key9),
348 42 => Some(Self::Dot),
349 43 => Some(Self::Enter),
350 48 => Some(Self::ChannelUp),
351 49 => Some(Self::ChannelDown),
352 50 => Some(Self::ChannelPrevious),
353 52 => Some(Self::InputSelect),
354 53 => Some(Self::Info),
355 54 => Some(Self::Help),
356 55 => Some(Self::PageUp),
357 56 => Some(Self::PageDown),
358 58 => Some(Self::Lock),
359 64 => Some(Self::Power),
360 65 => Some(Self::VolumeUp),
361 66 => Some(Self::VolumeDown),
362 67 => Some(Self::Mute),
363 68 => Some(Self::Play),
364 69 => Some(Self::Stop),
365 70 => Some(Self::Pause),
366 71 => Some(Self::Record),
367 72 => Some(Self::Rewind),
368 73 => Some(Self::FastForward),
369 74 => Some(Self::Eject),
370 75 => Some(Self::Forward),
371 76 => Some(Self::Backward),
372 77 => Some(Self::List),
373 113 => Some(Self::F1),
374 114 => Some(Self::F2),
375 115 => Some(Self::F3),
376 116 => Some(Self::F4),
377 117 => Some(Self::F5),
378 118 => Some(Self::F6),
379 119 => Some(Self::F7),
380 120 => Some(Self::F8),
381 121 => Some(Self::F9),
382 122 => Some(Self::Red),
383 123 => Some(Self::Green),
384 124 => Some(Self::Blue),
385 125 => Some(Self::Yellow),
386 _ => None,
387 }
388 }
389
390 #[inline]
391 pub const fn into_primitive(self) -> u8 {
392 self as u8
393 }
394
395 #[deprecated = "Strict enums should not use `is_unknown`"]
396 #[inline]
397 pub fn is_unknown(&self) -> bool {
398 false
399 }
400}
401
402#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
406#[repr(u8)]
407pub enum BatteryStatus {
408 Normal = 0,
409 Warning = 1,
410 Critical = 2,
411 External = 3,
412 FullCharge = 4,
413 Reserved = 5,
414}
415
416impl BatteryStatus {
417 #[inline]
418 pub fn from_primitive(prim: u8) -> Option<Self> {
419 match prim {
420 0 => Some(Self::Normal),
421 1 => Some(Self::Warning),
422 2 => Some(Self::Critical),
423 3 => Some(Self::External),
424 4 => Some(Self::FullCharge),
425 5 => Some(Self::Reserved),
426 _ => None,
427 }
428 }
429
430 #[inline]
431 pub const fn into_primitive(self) -> u8 {
432 self as u8
433 }
434
435 #[deprecated = "Strict enums should not use `is_unknown`"]
436 #[inline]
437 pub fn is_unknown(&self) -> bool {
438 false
439 }
440}
441
442#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
444#[repr(u32)]
445pub enum BrowseControllerError {
446 UnknownFailure = 1,
447 TimedOut = 2,
448 RemoteNotConnected = 3,
449 CommandNotImplemented = 4,
450 CommandRejected = 5,
451 CommandUnexpected = 6,
452 PacketEncoding = 7,
453 ProtocolError = 8,
454 ConnectionError = 9,
455 UidChanged = 10,
456 InvalidDirection = 11,
457 InvalidId = 12,
458 InvalidScope = 13,
459 RangeOutOfBounds = 14,
460 ItemNotPlayable = 15,
461 MediaInUse = 16,
462 PlayerNotBrowsable = 17,
463 PlayerNotAddressed = 18,
464 NoValidResults = 19,
465 NoAvailablePlayers = 20,
466}
467
468impl BrowseControllerError {
469 #[inline]
470 pub fn from_primitive(prim: u32) -> Option<Self> {
471 match prim {
472 1 => Some(Self::UnknownFailure),
473 2 => Some(Self::TimedOut),
474 3 => Some(Self::RemoteNotConnected),
475 4 => Some(Self::CommandNotImplemented),
476 5 => Some(Self::CommandRejected),
477 6 => Some(Self::CommandUnexpected),
478 7 => Some(Self::PacketEncoding),
479 8 => Some(Self::ProtocolError),
480 9 => Some(Self::ConnectionError),
481 10 => Some(Self::UidChanged),
482 11 => Some(Self::InvalidDirection),
483 12 => Some(Self::InvalidId),
484 13 => Some(Self::InvalidScope),
485 14 => Some(Self::RangeOutOfBounds),
486 15 => Some(Self::ItemNotPlayable),
487 16 => Some(Self::MediaInUse),
488 17 => Some(Self::PlayerNotBrowsable),
489 18 => Some(Self::PlayerNotAddressed),
490 19 => Some(Self::NoValidResults),
491 20 => Some(Self::NoAvailablePlayers),
492 _ => None,
493 }
494 }
495
496 #[inline]
497 pub const fn into_primitive(self) -> u32 {
498 self as u32
499 }
500
501 #[deprecated = "Strict enums should not use `is_unknown`"]
502 #[inline]
503 pub fn is_unknown(&self) -> bool {
504 false
505 }
506}
507
508#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
510#[repr(u32)]
511pub enum ControllerError {
512 UnknownFailure = 1,
513 TimedOut = 2,
514 RemoteNotConnected = 3,
515 CommandNotImplemented = 4,
516 CommandRejected = 5,
517 CommandUnexpected = 6,
518 InvalidArguments = 7,
519 PacketEncoding = 8,
520 ProtocolError = 9,
521 ConnectionError = 10,
522 UnexpectedResponse = 11,
523}
524
525impl ControllerError {
526 #[inline]
527 pub fn from_primitive(prim: u32) -> Option<Self> {
528 match prim {
529 1 => Some(Self::UnknownFailure),
530 2 => Some(Self::TimedOut),
531 3 => Some(Self::RemoteNotConnected),
532 4 => Some(Self::CommandNotImplemented),
533 5 => Some(Self::CommandRejected),
534 6 => Some(Self::CommandUnexpected),
535 7 => Some(Self::InvalidArguments),
536 8 => Some(Self::PacketEncoding),
537 9 => Some(Self::ProtocolError),
538 10 => Some(Self::ConnectionError),
539 11 => Some(Self::UnexpectedResponse),
540 _ => None,
541 }
542 }
543
544 #[inline]
545 pub const fn into_primitive(self) -> u32 {
546 self as u32
547 }
548
549 #[deprecated = "Strict enums should not use `is_unknown`"]
550 #[inline]
551 pub fn is_unknown(&self) -> bool {
552 false
553 }
554}
555
556#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
558#[repr(u8)]
559pub enum Equalizer {
560 Off = 1,
561 On = 2,
562}
563
564impl Equalizer {
565 #[inline]
566 pub fn from_primitive(prim: u8) -> Option<Self> {
567 match prim {
568 1 => Some(Self::Off),
569 2 => Some(Self::On),
570 _ => None,
571 }
572 }
573
574 #[inline]
575 pub const fn into_primitive(self) -> u8 {
576 self as u8
577 }
578
579 #[deprecated = "Strict enums should not use `is_unknown`"]
580 #[inline]
581 pub fn is_unknown(&self) -> bool {
582 false
583 }
584}
585
586#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
589#[repr(u8)]
590pub enum FolderType {
591 Mixed = 0,
592 Titles = 1,
593 Albums = 2,
594 Artists = 3,
595 Genres = 4,
596 Playlists = 5,
597 Years = 6,
598}
599
600impl FolderType {
601 #[inline]
602 pub fn from_primitive(prim: u8) -> Option<Self> {
603 match prim {
604 0 => Some(Self::Mixed),
605 1 => Some(Self::Titles),
606 2 => Some(Self::Albums),
607 3 => Some(Self::Artists),
608 4 => Some(Self::Genres),
609 5 => Some(Self::Playlists),
610 6 => Some(Self::Years),
611 _ => None,
612 }
613 }
614
615 #[inline]
616 pub const fn into_primitive(self) -> u8 {
617 self as u8
618 }
619
620 #[deprecated = "Strict enums should not use `is_unknown`"]
621 #[inline]
622 pub fn is_unknown(&self) -> bool {
623 false
624 }
625}
626
627#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
630#[repr(u32)]
631pub enum MediaAttributeId {
632 Title = 1,
633 ArtistName = 2,
634 AlbumName = 3,
635 TrackNumber = 4,
636 TotalNumberOfTracks = 5,
637 Genre = 6,
638 PlayingTime = 7,
639 DefaultCoverArt = 8,
640}
641
642impl MediaAttributeId {
643 #[inline]
644 pub fn from_primitive(prim: u32) -> Option<Self> {
645 match prim {
646 1 => Some(Self::Title),
647 2 => Some(Self::ArtistName),
648 3 => Some(Self::AlbumName),
649 4 => Some(Self::TrackNumber),
650 5 => Some(Self::TotalNumberOfTracks),
651 6 => Some(Self::Genre),
652 7 => Some(Self::PlayingTime),
653 8 => Some(Self::DefaultCoverArt),
654 _ => None,
655 }
656 }
657
658 #[inline]
659 pub const fn into_primitive(self) -> u32 {
660 self as u32
661 }
662
663 #[deprecated = "Strict enums should not use `is_unknown`"]
664 #[inline]
665 pub fn is_unknown(&self) -> bool {
666 false
667 }
668}
669
670#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
673#[repr(u8)]
674pub enum MediaType {
675 Audio = 0,
676 Video = 1,
677}
678
679impl MediaType {
680 #[inline]
681 pub fn from_primitive(prim: u8) -> Option<Self> {
682 match prim {
683 0 => Some(Self::Audio),
684 1 => Some(Self::Video),
685 _ => None,
686 }
687 }
688
689 #[inline]
690 pub const fn into_primitive(self) -> u8 {
691 self as u8
692 }
693
694 #[deprecated = "Strict enums should not use `is_unknown`"]
695 #[inline]
696 pub fn is_unknown(&self) -> bool {
697 false
698 }
699}
700
701#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
704#[repr(u8)]
705pub enum NotificationEvent {
706 PlaybackStatusChanged = 1,
707 TrackChanged = 2,
708 TrackReachedEnd = 3,
709 TrackReachedStart = 4,
710 TrackPosChanged = 5,
711 BattStatusChanged = 6,
712 SystemStatusChanged = 7,
713 PlayerApplicationSettingChanged = 8,
714 NowPlayingContentChanged = 9,
715 AvailablePlayersChanged = 10,
716 AddressedPlayerChanged = 11,
717 UidsChanged = 12,
718 VolumeChanged = 13,
719}
720
721impl NotificationEvent {
722 #[inline]
723 pub fn from_primitive(prim: u8) -> Option<Self> {
724 match prim {
725 1 => Some(Self::PlaybackStatusChanged),
726 2 => Some(Self::TrackChanged),
727 3 => Some(Self::TrackReachedEnd),
728 4 => Some(Self::TrackReachedStart),
729 5 => Some(Self::TrackPosChanged),
730 6 => Some(Self::BattStatusChanged),
731 7 => Some(Self::SystemStatusChanged),
732 8 => Some(Self::PlayerApplicationSettingChanged),
733 9 => Some(Self::NowPlayingContentChanged),
734 10 => Some(Self::AvailablePlayersChanged),
735 11 => Some(Self::AddressedPlayerChanged),
736 12 => Some(Self::UidsChanged),
737 13 => Some(Self::VolumeChanged),
738 _ => None,
739 }
740 }
741
742 #[inline]
743 pub const fn into_primitive(self) -> u8 {
744 self as u8
745 }
746
747 #[deprecated = "Strict enums should not use `is_unknown`"]
748 #[inline]
749 pub fn is_unknown(&self) -> bool {
750 false
751 }
752}
753
754#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
757#[repr(u8)]
758pub enum PlaybackStatus {
759 Stopped = 0,
760 Playing = 1,
761 Paused = 2,
762 FwdSeek = 3,
763 RevSeek = 4,
764 Error = 255,
765}
766
767impl PlaybackStatus {
768 #[inline]
769 pub fn from_primitive(prim: u8) -> Option<Self> {
770 match prim {
771 0 => Some(Self::Stopped),
772 1 => Some(Self::Playing),
773 2 => Some(Self::Paused),
774 3 => Some(Self::FwdSeek),
775 4 => Some(Self::RevSeek),
776 255 => Some(Self::Error),
777 _ => None,
778 }
779 }
780
781 #[inline]
782 pub const fn into_primitive(self) -> u8 {
783 self as u8
784 }
785
786 #[deprecated = "Strict enums should not use `is_unknown`"]
787 #[inline]
788 pub fn is_unknown(&self) -> bool {
789 false
790 }
791}
792
793#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
796#[repr(u8)]
797pub enum PlayerApplicationSettingAttributeId {
798 Equalizer = 1,
799 RepeatStatusMode = 2,
800 ShuffleMode = 3,
801 ScanMode = 4,
802}
803
804impl PlayerApplicationSettingAttributeId {
805 #[inline]
806 pub fn from_primitive(prim: u8) -> Option<Self> {
807 match prim {
808 1 => Some(Self::Equalizer),
809 2 => Some(Self::RepeatStatusMode),
810 3 => Some(Self::ShuffleMode),
811 4 => Some(Self::ScanMode),
812 _ => None,
813 }
814 }
815
816 #[inline]
817 pub const fn into_primitive(self) -> u8 {
818 self as u8
819 }
820
821 #[deprecated = "Strict enums should not use `is_unknown`"]
822 #[inline]
823 pub fn is_unknown(&self) -> bool {
824 false
825 }
826}
827
828#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
830#[repr(u8)]
831pub enum RepeatStatusMode {
832 Off = 1,
833 SingleTrackRepeat = 2,
834 AllTrackRepeat = 3,
835 GroupRepeat = 4,
836}
837
838impl RepeatStatusMode {
839 #[inline]
840 pub fn from_primitive(prim: u8) -> Option<Self> {
841 match prim {
842 1 => Some(Self::Off),
843 2 => Some(Self::SingleTrackRepeat),
844 3 => Some(Self::AllTrackRepeat),
845 4 => Some(Self::GroupRepeat),
846 _ => None,
847 }
848 }
849
850 #[inline]
851 pub const fn into_primitive(self) -> u8 {
852 self as u8
853 }
854
855 #[deprecated = "Strict enums should not use `is_unknown`"]
856 #[inline]
857 pub fn is_unknown(&self) -> bool {
858 false
859 }
860}
861
862#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
864#[repr(u8)]
865pub enum ScanMode {
866 Off = 1,
867 AllTrackScan = 2,
868 GroupScan = 3,
869}
870
871impl ScanMode {
872 #[inline]
873 pub fn from_primitive(prim: u8) -> Option<Self> {
874 match prim {
875 1 => Some(Self::Off),
876 2 => Some(Self::AllTrackScan),
877 3 => Some(Self::GroupScan),
878 _ => None,
879 }
880 }
881
882 #[inline]
883 pub const fn into_primitive(self) -> u8 {
884 self as u8
885 }
886
887 #[deprecated = "Strict enums should not use `is_unknown`"]
888 #[inline]
889 pub fn is_unknown(&self) -> bool {
890 false
891 }
892}
893
894#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
896#[repr(u8)]
897pub enum ShuffleMode {
898 Off = 1,
899 AllTrackShuffle = 2,
900 GroupShuffle = 3,
901}
902
903impl ShuffleMode {
904 #[inline]
905 pub fn from_primitive(prim: u8) -> Option<Self> {
906 match prim {
907 1 => Some(Self::Off),
908 2 => Some(Self::AllTrackShuffle),
909 3 => Some(Self::GroupShuffle),
910 _ => None,
911 }
912 }
913
914 #[inline]
915 pub const fn into_primitive(self) -> u8 {
916 self as u8
917 }
918
919 #[deprecated = "Strict enums should not use `is_unknown`"]
920 #[inline]
921 pub fn is_unknown(&self) -> bool {
922 false
923 }
924}
925
926#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
929#[repr(u8)]
930pub enum SystemStatus {
931 PowerOn = 0,
932 PowerOff = 1,
933 Unplugged = 2,
934}
935
936impl SystemStatus {
937 #[inline]
938 pub fn from_primitive(prim: u8) -> Option<Self> {
939 match prim {
940 0 => Some(Self::PowerOn),
941 1 => Some(Self::PowerOff),
942 2 => Some(Self::Unplugged),
943 _ => None,
944 }
945 }
946
947 #[inline]
948 pub const fn into_primitive(self) -> u8 {
949 self as u8
950 }
951
952 #[deprecated = "Strict enums should not use `is_unknown`"]
953 #[inline]
954 pub fn is_unknown(&self) -> bool {
955 false
956 }
957}
958
959#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
963#[repr(u32)]
964pub enum TargetAvcError {
965 RejectedInvalidCommand = 0,
966 RejectedInvalidParameter = 1,
967 RejectedParameterContentError = 2,
968 RejectedInternalError = 3,
969 RejectedUidChanged = 5,
970 RejectedInvalidPlayerId = 17,
971 RejectedNoAvailablePlayers = 21,
972 RejectedAddressedPlayerChanged = 22,
973}
974
975impl TargetAvcError {
976 #[inline]
977 pub fn from_primitive(prim: u32) -> Option<Self> {
978 match prim {
979 0 => Some(Self::RejectedInvalidCommand),
980 1 => Some(Self::RejectedInvalidParameter),
981 2 => Some(Self::RejectedParameterContentError),
982 3 => Some(Self::RejectedInternalError),
983 5 => Some(Self::RejectedUidChanged),
984 17 => Some(Self::RejectedInvalidPlayerId),
985 21 => Some(Self::RejectedNoAvailablePlayers),
986 22 => Some(Self::RejectedAddressedPlayerChanged),
987 _ => None,
988 }
989 }
990
991 #[inline]
992 pub const fn into_primitive(self) -> u32 {
993 self as u32
994 }
995
996 #[deprecated = "Strict enums should not use `is_unknown`"]
997 #[inline]
998 pub fn is_unknown(&self) -> bool {
999 false
1000 }
1001}
1002
1003#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
1005#[repr(u32)]
1006pub enum TargetPassthroughError {
1007 CommandNotImplemented = 1,
1008 CommandRejected = 2,
1009}
1010
1011impl TargetPassthroughError {
1012 #[inline]
1013 pub fn from_primitive(prim: u32) -> Option<Self> {
1014 match prim {
1015 1 => Some(Self::CommandNotImplemented),
1016 2 => Some(Self::CommandRejected),
1017 _ => None,
1018 }
1019 }
1020
1021 #[inline]
1022 pub const fn into_primitive(self) -> u32 {
1023 self as u32
1024 }
1025
1026 #[deprecated = "Strict enums should not use `is_unknown`"]
1027 #[inline]
1028 pub fn is_unknown(&self) -> bool {
1029 false
1030 }
1031}
1032
1033#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1034#[repr(C)]
1035pub struct AbsoluteVolumeHandlerGetCurrentVolumeResponse {
1036 pub volume: u8,
1037}
1038
1039impl fidl::Persistable for AbsoluteVolumeHandlerGetCurrentVolumeResponse {}
1040
1041#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1042#[repr(C)]
1043pub struct AbsoluteVolumeHandlerOnVolumeChangedResponse {
1044 pub new_volume: u8,
1045}
1046
1047impl fidl::Persistable for AbsoluteVolumeHandlerOnVolumeChangedResponse {}
1048
1049#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1050#[repr(C)]
1051pub struct AbsoluteVolumeHandlerSetVolumeRequest {
1052 pub requested_volume: u8,
1053}
1054
1055impl fidl::Persistable for AbsoluteVolumeHandlerSetVolumeRequest {}
1056
1057#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1058#[repr(C)]
1059pub struct AbsoluteVolumeHandlerSetVolumeResponse {
1060 pub set_volume: u8,
1061}
1062
1063impl fidl::Persistable for AbsoluteVolumeHandlerSetVolumeResponse {}
1064
1065#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1071#[repr(C)]
1072pub struct AddressedPlayerId {
1073 pub id: u16,
1074}
1075
1076impl fidl::Persistable for AddressedPlayerId {}
1077
1078#[derive(Clone, Debug, PartialEq)]
1079pub struct BrowseControllerChangePathRequest {
1080 pub path: Path,
1081}
1082
1083impl fidl::Persistable for BrowseControllerChangePathRequest {}
1084
1085#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1086pub struct BrowseControllerGetFileSystemItemsRequest {
1087 pub start_index: u32,
1088 pub end_index: u32,
1089 pub attribute_option: AttributeRequestOption,
1090}
1091
1092impl fidl::Persistable for BrowseControllerGetFileSystemItemsRequest {}
1093
1094#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1095#[repr(C)]
1096pub struct BrowseControllerGetMediaPlayerItemsRequest {
1097 pub start_index: u32,
1098 pub end_index: u32,
1099}
1100
1101impl fidl::Persistable for BrowseControllerGetMediaPlayerItemsRequest {}
1102
1103#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1104pub struct BrowseControllerGetNowPlayingItemsRequest {
1105 pub start_index: u32,
1106 pub end_index: u32,
1107 pub attribute_option: AttributeRequestOption,
1108}
1109
1110impl fidl::Persistable for BrowseControllerGetNowPlayingItemsRequest {}
1111
1112#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1113#[repr(C)]
1114pub struct BrowseControllerPlayFileSystemItemRequest {
1115 pub uid: u64,
1117}
1118
1119impl fidl::Persistable for BrowseControllerPlayFileSystemItemRequest {}
1120
1121#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1122#[repr(C)]
1123pub struct BrowseControllerPlayNowPlayingItemRequest {
1124 pub uid: u64,
1125}
1126
1127impl fidl::Persistable for BrowseControllerPlayNowPlayingItemRequest {}
1128
1129#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1130#[repr(C)]
1131pub struct BrowseControllerSetBrowsedPlayerRequest {
1132 pub player_id: u16,
1133}
1134
1135impl fidl::Persistable for BrowseControllerSetBrowsedPlayerRequest {}
1136
1137#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1138#[repr(C)]
1139pub struct BrowseControllerChangePathResponse {
1140 pub num_items: u32,
1141}
1142
1143impl fidl::Persistable for BrowseControllerChangePathResponse {}
1144
1145#[derive(Clone, Debug, PartialEq)]
1146pub struct BrowseControllerGetFileSystemItemsResponse {
1147 pub items: Vec<FileSystemItem>,
1148}
1149
1150impl fidl::Persistable for BrowseControllerGetFileSystemItemsResponse {}
1151
1152#[derive(Clone, Debug, PartialEq)]
1153pub struct BrowseControllerGetMediaPlayerItemsResponse {
1154 pub items: Vec<MediaPlayerItem>,
1155}
1156
1157impl fidl::Persistable for BrowseControllerGetMediaPlayerItemsResponse {}
1158
1159#[derive(Clone, Debug, PartialEq)]
1160pub struct BrowseControllerGetNowPlayingItemsResponse {
1161 pub items: Vec<MediaElementItem>,
1162}
1163
1164impl fidl::Persistable for BrowseControllerGetNowPlayingItemsResponse {}
1165
1166#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1167pub struct ControllerGetPlayerApplicationSettingsRequest {
1168 pub attribute_ids: Vec<PlayerApplicationSettingAttributeId>,
1169}
1170
1171impl fidl::Persistable for ControllerGetPlayerApplicationSettingsRequest {}
1172
1173#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1174pub struct ControllerInformBatteryStatusRequest {
1175 pub battery_status: BatteryStatus,
1176}
1177
1178impl fidl::Persistable for ControllerInformBatteryStatusRequest {}
1179
1180#[derive(Clone, Debug, PartialEq)]
1181pub struct ControllerOnNotificationRequest {
1182 pub timestamp: i64,
1183 pub notification: Notification,
1184}
1185
1186impl fidl::Persistable for ControllerOnNotificationRequest {}
1187
1188#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1189pub struct ControllerSendCommandRequest {
1190 pub command: AvcPanelCommand,
1191}
1192
1193impl fidl::Persistable for ControllerSendCommandRequest {}
1194
1195#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1196#[repr(C)]
1197pub struct ControllerSetAbsoluteVolumeRequest {
1198 pub requested_volume: u8,
1199}
1200
1201impl fidl::Persistable for ControllerSetAbsoluteVolumeRequest {}
1202
1203#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1204#[repr(C)]
1205pub struct ControllerSetAddressedPlayerRequest {
1206 pub player_id: u16,
1207}
1208
1209impl fidl::Persistable for ControllerSetAddressedPlayerRequest {}
1210
1211#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1212pub struct ControllerSetNotificationFilterRequest {
1213 pub notifications: Notifications,
1214 pub position_change_interval: u32,
1215}
1216
1217impl fidl::Persistable for ControllerSetNotificationFilterRequest {}
1218
1219#[derive(Clone, Debug, PartialEq)]
1220pub struct ControllerSetPlayerApplicationSettingsRequest {
1221 pub requested_settings: PlayerApplicationSettings,
1222}
1223
1224impl fidl::Persistable for ControllerSetPlayerApplicationSettingsRequest {}
1225
1226#[derive(Clone, Debug, PartialEq)]
1227pub struct ControllerGetMediaAttributesResponse {
1228 pub attributes: MediaAttributes,
1229}
1230
1231impl fidl::Persistable for ControllerGetMediaAttributesResponse {}
1232
1233#[derive(Clone, Debug, PartialEq)]
1234pub struct ControllerGetPlayStatusResponse {
1235 pub play_status: PlayStatus,
1236}
1237
1238impl fidl::Persistable for ControllerGetPlayStatusResponse {}
1239
1240#[derive(Clone, Debug, PartialEq)]
1241pub struct ControllerGetPlayerApplicationSettingsResponse {
1242 pub current_settings: PlayerApplicationSettings,
1243}
1244
1245impl fidl::Persistable for ControllerGetPlayerApplicationSettingsResponse {}
1246
1247#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1248#[repr(C)]
1249pub struct ControllerSetAbsoluteVolumeResponse {
1250 pub set_volume: u8,
1251}
1252
1253impl fidl::Persistable for ControllerSetAbsoluteVolumeResponse {}
1254
1255#[derive(Clone, Debug, PartialEq)]
1256pub struct ControllerSetPlayerApplicationSettingsResponse {
1257 pub set_settings: PlayerApplicationSettings,
1258}
1259
1260impl fidl::Persistable for ControllerSetPlayerApplicationSettingsResponse {}
1261
1262#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1264pub struct CustomAttributeValue {
1265 pub description: String,
1266 pub value: u8,
1267}
1268
1269impl fidl::Persistable for CustomAttributeValue {}
1270
1271#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1272pub struct Parent;
1273
1274impl fidl::Persistable for Parent {}
1275
1276#[derive(Debug, PartialEq)]
1277pub struct PeerManagerGetBrowseControllerForTargetRequest {
1278 pub peer_id: fidl_fuchsia_bluetooth::PeerId,
1279 pub client: fidl::endpoints::ServerEnd<BrowseControllerMarker>,
1280}
1281
1282impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
1283 for PeerManagerGetBrowseControllerForTargetRequest
1284{
1285}
1286
1287#[derive(Debug, PartialEq)]
1288pub struct PeerManagerGetControllerForTargetRequest {
1289 pub peer_id: fidl_fuchsia_bluetooth::PeerId,
1290 pub client: fidl::endpoints::ServerEnd<ControllerMarker>,
1291}
1292
1293impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
1294 for PeerManagerGetControllerForTargetRequest
1295{
1296}
1297
1298#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1299pub struct PeerManagerRegisterTargetHandlerRequest {
1300 pub handler: fidl::endpoints::ClientEnd<TargetHandlerMarker>,
1301}
1302
1303impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
1304 for PeerManagerRegisterTargetHandlerRequest
1305{
1306}
1307
1308#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1309pub struct PeerManagerSetAbsoluteVolumeHandlerRequest {
1310 pub handler: fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
1311}
1312
1313impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
1314 for PeerManagerSetAbsoluteVolumeHandlerRequest
1315{
1316}
1317
1318#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1319pub struct TargetHandlerGetNotificationRequest {
1320 pub event_id: NotificationEvent,
1321}
1322
1323impl fidl::Persistable for TargetHandlerGetNotificationRequest {}
1324
1325#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1326pub struct TargetHandlerGetPlayerApplicationSettingsRequest {
1327 pub attribute_ids: Vec<PlayerApplicationSettingAttributeId>,
1328}
1329
1330impl fidl::Persistable for TargetHandlerGetPlayerApplicationSettingsRequest {}
1331
1332#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1333pub struct TargetHandlerSendCommandRequest {
1334 pub command: AvcPanelCommand,
1335 pub pressed: bool,
1336}
1337
1338impl fidl::Persistable for TargetHandlerSendCommandRequest {}
1339
1340#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1341#[repr(C)]
1342pub struct TargetHandlerSetAddressedPlayerRequest {
1343 pub player_id: AddressedPlayerId,
1344}
1345
1346impl fidl::Persistable for TargetHandlerSetAddressedPlayerRequest {}
1347
1348#[derive(Clone, Debug, PartialEq)]
1349pub struct TargetHandlerSetPlayerApplicationSettingsRequest {
1350 pub requested_settings: PlayerApplicationSettings,
1351}
1352
1353impl fidl::Persistable for TargetHandlerSetPlayerApplicationSettingsRequest {}
1354
1355#[derive(Clone, Debug, PartialEq)]
1356pub struct TargetHandlerWatchNotificationRequest {
1357 pub event_id: NotificationEvent,
1358 pub current: Notification,
1359 pub pos_change_interval: u32,
1360}
1361
1362impl fidl::Persistable for TargetHandlerWatchNotificationRequest {}
1363
1364#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1365pub struct TargetHandlerGetEventsSupportedResponse {
1366 pub notification_ids: Vec<NotificationEvent>,
1367}
1368
1369impl fidl::Persistable for TargetHandlerGetEventsSupportedResponse {}
1370
1371#[derive(Clone, Debug, PartialEq)]
1372pub struct TargetHandlerGetMediaAttributesResponse {
1373 pub attributes: MediaAttributes,
1374}
1375
1376impl fidl::Persistable for TargetHandlerGetMediaAttributesResponse {}
1377
1378#[derive(Clone, Debug, PartialEq)]
1379pub struct TargetHandlerGetMediaPlayerItemsResponse {
1380 pub items: Vec<MediaPlayerItem>,
1381}
1382
1383impl fidl::Persistable for TargetHandlerGetMediaPlayerItemsResponse {}
1384
1385#[derive(Clone, Debug, PartialEq)]
1386pub struct TargetHandlerGetNotificationResponse {
1387 pub current_value: Notification,
1388}
1389
1390impl fidl::Persistable for TargetHandlerGetNotificationResponse {}
1391
1392#[derive(Clone, Debug, PartialEq)]
1393pub struct TargetHandlerGetPlayStatusResponse {
1394 pub play_status: PlayStatus,
1395}
1396
1397impl fidl::Persistable for TargetHandlerGetPlayStatusResponse {}
1398
1399#[derive(Clone, Debug, PartialEq)]
1400pub struct TargetHandlerGetPlayerApplicationSettingsResponse {
1401 pub current_settings: PlayerApplicationSettings,
1402}
1403
1404impl fidl::Persistable for TargetHandlerGetPlayerApplicationSettingsResponse {}
1405
1406#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1407pub struct TargetHandlerListPlayerApplicationSettingAttributesResponse {
1408 pub attributes: Vec<PlayerApplicationSettingAttributeId>,
1409}
1410
1411impl fidl::Persistable for TargetHandlerListPlayerApplicationSettingAttributesResponse {}
1412
1413#[derive(Clone, Debug, PartialEq)]
1414pub struct TargetHandlerSetPlayerApplicationSettingsResponse {
1415 pub set_settings: PlayerApplicationSettings,
1416}
1417
1418impl fidl::Persistable for TargetHandlerSetPlayerApplicationSettingsResponse {}
1419
1420#[derive(Clone, Debug, PartialEq)]
1421pub struct TargetHandlerWatchNotificationResponse {
1422 pub new_value: Notification,
1423}
1424
1425impl fidl::Persistable for TargetHandlerWatchNotificationResponse {}
1426
1427#[derive(Clone, Debug, Default, PartialEq)]
1430pub struct CustomPlayerApplicationSetting {
1431 pub attribute_id: Option<u8>,
1434 pub attribute_name: Option<String>,
1436 pub possible_values: Option<Vec<CustomAttributeValue>>,
1438 pub current_value: Option<u8>,
1440 #[doc(hidden)]
1441 pub __source_breaking: fidl::marker::SourceBreaking,
1442}
1443
1444impl fidl::Persistable for CustomPlayerApplicationSetting {}
1445
1446#[derive(Clone, Debug, Default, PartialEq)]
1449pub struct FolderItem {
1450 pub folder_uid: Option<u64>,
1451 pub folder_type: Option<FolderType>,
1452 pub is_playable: Option<bool>,
1453 pub displayable_name: Option<String>,
1454 #[doc(hidden)]
1455 pub __source_breaking: fidl::marker::SourceBreaking,
1456}
1457
1458impl fidl::Persistable for FolderItem {}
1459
1460#[derive(Clone, Debug, Default, PartialEq)]
1462pub struct MediaAttributes {
1463 pub title: Option<String>,
1465 pub artist_name: Option<String>,
1467 pub album_name: Option<String>,
1469 pub track_number: Option<String>,
1471 pub total_number_of_tracks: Option<String>,
1473 pub genre: Option<String>,
1475 pub playing_time: Option<String>,
1477 #[doc(hidden)]
1478 pub __source_breaking: fidl::marker::SourceBreaking,
1479}
1480
1481impl fidl::Persistable for MediaAttributes {}
1482
1483#[derive(Clone, Debug, Default, PartialEq)]
1486pub struct MediaElementItem {
1487 pub media_element_uid: Option<u64>,
1488 pub media_type: Option<MediaType>,
1489 pub displayable_name: Option<String>,
1490 pub attributes: Option<MediaAttributes>,
1491 #[doc(hidden)]
1492 pub __source_breaking: fidl::marker::SourceBreaking,
1493}
1494
1495impl fidl::Persistable for MediaElementItem {}
1496
1497#[derive(Clone, Debug, Default, PartialEq)]
1500pub struct MediaPlayerItem {
1501 pub player_id: Option<u16>,
1502 pub major_type: Option<MajorPlayerType>,
1503 pub sub_type: Option<PlayerSubType>,
1504 pub playback_status: Option<PlaybackStatus>,
1505 pub displayable_name: Option<String>,
1506 pub feature_bits: Option<PlayerFeatureBits>,
1507 pub feature_bits_ext: Option<PlayerFeatureBitsExt>,
1508 #[doc(hidden)]
1509 pub __source_breaking: fidl::marker::SourceBreaking,
1510}
1511
1512impl fidl::Persistable for MediaPlayerItem {}
1513
1514#[derive(Clone, Debug, Default, PartialEq)]
1517pub struct Notification {
1518 pub status: Option<PlaybackStatus>,
1520 pub track_id: Option<u64>,
1522 pub pos: Option<u32>,
1524 pub battery_status: Option<BatteryStatus>,
1526 pub system_status: Option<SystemStatus>,
1528 pub application_settings: Option<PlayerApplicationSettings>,
1530 pub player_id: Option<u16>,
1532 pub volume: Option<u8>,
1534 pub device_connected: Option<bool>,
1536 pub available_players_changed: Option<bool>,
1538 pub addressed_player: Option<u16>,
1540 #[doc(hidden)]
1541 pub __source_breaking: fidl::marker::SourceBreaking,
1542}
1543
1544impl fidl::Persistable for Notification {}
1545
1546#[derive(Clone, Debug, Default, PartialEq)]
1549pub struct PlayStatus {
1550 pub song_length: Option<u32>,
1553 pub song_position: Option<u32>,
1556 pub playback_status: Option<PlaybackStatus>,
1559 #[doc(hidden)]
1560 pub __source_breaking: fidl::marker::SourceBreaking,
1561}
1562
1563impl fidl::Persistable for PlayStatus {}
1564
1565#[derive(Clone, Debug, Default, PartialEq)]
1567pub struct PlayerApplicationSettings {
1568 pub equalizer: Option<Equalizer>,
1570 pub repeat_status_mode: Option<RepeatStatusMode>,
1572 pub shuffle_mode: Option<ShuffleMode>,
1574 pub scan_mode: Option<ScanMode>,
1576 pub custom_settings: Option<Vec<CustomPlayerApplicationSetting>>,
1578 #[doc(hidden)]
1579 pub __source_breaking: fidl::marker::SourceBreaking,
1580}
1581
1582impl fidl::Persistable for PlayerApplicationSettings {}
1583
1584#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1589pub enum AttributeRequestOption {
1590 GetAll(bool),
1591 AttributeList(Vec<MediaAttributeId>),
1592}
1593
1594impl AttributeRequestOption {
1595 #[inline]
1596 pub fn ordinal(&self) -> u64 {
1597 match *self {
1598 Self::GetAll(_) => 1,
1599 Self::AttributeList(_) => 2,
1600 }
1601 }
1602
1603 #[deprecated = "Strict unions should not use `is_unknown`"]
1604 #[inline]
1605 pub fn is_unknown(&self) -> bool {
1606 false
1607 }
1608}
1609
1610impl fidl::Persistable for AttributeRequestOption {}
1611
1612#[derive(Clone, Debug, PartialEq)]
1616pub enum FileSystemItem {
1617 Folder(FolderItem),
1618 MediaElement(MediaElementItem),
1619}
1620
1621impl FileSystemItem {
1622 #[inline]
1623 pub fn ordinal(&self) -> u64 {
1624 match *self {
1625 Self::Folder(_) => 1,
1626 Self::MediaElement(_) => 2,
1627 }
1628 }
1629
1630 #[deprecated = "Strict unions should not use `is_unknown`"]
1631 #[inline]
1632 pub fn is_unknown(&self) -> bool {
1633 false
1634 }
1635}
1636
1637impl fidl::Persistable for FileSystemItem {}
1638
1639#[derive(Clone, Debug)]
1644pub enum Path {
1645 Parent(Parent),
1646 ChildFolderUid(u64),
1647 #[doc(hidden)]
1648 __SourceBreaking {
1649 unknown_ordinal: u64,
1650 },
1651}
1652
1653#[macro_export]
1655macro_rules! PathUnknown {
1656 () => {
1657 _
1658 };
1659}
1660
1661impl PartialEq for Path {
1663 fn eq(&self, other: &Self) -> bool {
1664 match (self, other) {
1665 (Self::Parent(x), Self::Parent(y)) => *x == *y,
1666 (Self::ChildFolderUid(x), Self::ChildFolderUid(y)) => *x == *y,
1667 _ => false,
1668 }
1669 }
1670}
1671
1672impl Path {
1673 #[inline]
1674 pub fn ordinal(&self) -> u64 {
1675 match *self {
1676 Self::Parent(_) => 1,
1677 Self::ChildFolderUid(_) => 2,
1678 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
1679 }
1680 }
1681
1682 #[inline]
1683 pub fn unknown_variant_for_testing() -> Self {
1684 Self::__SourceBreaking { unknown_ordinal: 0 }
1685 }
1686
1687 #[inline]
1688 pub fn is_unknown(&self) -> bool {
1689 match self {
1690 Self::__SourceBreaking { .. } => true,
1691 _ => false,
1692 }
1693 }
1694}
1695
1696impl fidl::Persistable for Path {}
1697
1698#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1699pub struct AbsoluteVolumeHandlerMarker;
1700
1701impl fidl::endpoints::ProtocolMarker for AbsoluteVolumeHandlerMarker {
1702 type Proxy = AbsoluteVolumeHandlerProxy;
1703 type RequestStream = AbsoluteVolumeHandlerRequestStream;
1704 #[cfg(target_os = "fuchsia")]
1705 type SynchronousProxy = AbsoluteVolumeHandlerSynchronousProxy;
1706
1707 const DEBUG_NAME: &'static str = "(anonymous) AbsoluteVolumeHandler";
1708}
1709
1710pub trait AbsoluteVolumeHandlerProxyInterface: Send + Sync {
1711 type SetVolumeResponseFut: std::future::Future<Output = Result<u8, fidl::Error>> + Send;
1712 fn r#set_volume(&self, requested_volume: u8) -> Self::SetVolumeResponseFut;
1713 type OnVolumeChangedResponseFut: std::future::Future<Output = Result<u8, fidl::Error>> + Send;
1714 fn r#on_volume_changed(&self) -> Self::OnVolumeChangedResponseFut;
1715 type GetCurrentVolumeResponseFut: std::future::Future<Output = Result<u8, fidl::Error>> + Send;
1716 fn r#get_current_volume(&self) -> Self::GetCurrentVolumeResponseFut;
1717}
1718#[derive(Debug)]
1719#[cfg(target_os = "fuchsia")]
1720pub struct AbsoluteVolumeHandlerSynchronousProxy {
1721 client: fidl::client::sync::Client,
1722}
1723
1724#[cfg(target_os = "fuchsia")]
1725impl fidl::endpoints::SynchronousProxy for AbsoluteVolumeHandlerSynchronousProxy {
1726 type Proxy = AbsoluteVolumeHandlerProxy;
1727 type Protocol = AbsoluteVolumeHandlerMarker;
1728
1729 fn from_channel(inner: fidl::Channel) -> Self {
1730 Self::new(inner)
1731 }
1732
1733 fn into_channel(self) -> fidl::Channel {
1734 self.client.into_channel()
1735 }
1736
1737 fn as_channel(&self) -> &fidl::Channel {
1738 self.client.as_channel()
1739 }
1740}
1741
1742#[cfg(target_os = "fuchsia")]
1743impl AbsoluteVolumeHandlerSynchronousProxy {
1744 pub fn new(channel: fidl::Channel) -> Self {
1745 let protocol_name =
1746 <AbsoluteVolumeHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1747 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1748 }
1749
1750 pub fn into_channel(self) -> fidl::Channel {
1751 self.client.into_channel()
1752 }
1753
1754 pub fn wait_for_event(
1757 &self,
1758 deadline: zx::MonotonicInstant,
1759 ) -> Result<AbsoluteVolumeHandlerEvent, fidl::Error> {
1760 AbsoluteVolumeHandlerEvent::decode(self.client.wait_for_event(deadline)?)
1761 }
1762
1763 pub fn r#set_volume(
1767 &self,
1768 mut requested_volume: u8,
1769 ___deadline: zx::MonotonicInstant,
1770 ) -> Result<u8, fidl::Error> {
1771 let _response = self.client.send_query::<
1772 AbsoluteVolumeHandlerSetVolumeRequest,
1773 AbsoluteVolumeHandlerSetVolumeResponse,
1774 >(
1775 (requested_volume,),
1776 0x2796843ecbdecc65,
1777 fidl::encoding::DynamicFlags::empty(),
1778 ___deadline,
1779 )?;
1780 Ok(_response.set_volume)
1781 }
1782
1783 pub fn r#on_volume_changed(
1789 &self,
1790 ___deadline: zx::MonotonicInstant,
1791 ) -> Result<u8, fidl::Error> {
1792 let _response = self.client.send_query::<
1793 fidl::encoding::EmptyPayload,
1794 AbsoluteVolumeHandlerOnVolumeChangedResponse,
1795 >(
1796 (),
1797 0x1a1f9cffd4f2a74,
1798 fidl::encoding::DynamicFlags::empty(),
1799 ___deadline,
1800 )?;
1801 Ok(_response.new_volume)
1802 }
1803
1804 pub fn r#get_current_volume(
1806 &self,
1807 ___deadline: zx::MonotonicInstant,
1808 ) -> Result<u8, fidl::Error> {
1809 let _response = self.client.send_query::<
1810 fidl::encoding::EmptyPayload,
1811 AbsoluteVolumeHandlerGetCurrentVolumeResponse,
1812 >(
1813 (),
1814 0x6ae76e0c77ac35ff,
1815 fidl::encoding::DynamicFlags::empty(),
1816 ___deadline,
1817 )?;
1818 Ok(_response.volume)
1819 }
1820}
1821
1822#[derive(Debug, Clone)]
1823pub struct AbsoluteVolumeHandlerProxy {
1824 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1825}
1826
1827impl fidl::endpoints::Proxy for AbsoluteVolumeHandlerProxy {
1828 type Protocol = AbsoluteVolumeHandlerMarker;
1829
1830 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1831 Self::new(inner)
1832 }
1833
1834 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1835 self.client.into_channel().map_err(|client| Self { client })
1836 }
1837
1838 fn as_channel(&self) -> &::fidl::AsyncChannel {
1839 self.client.as_channel()
1840 }
1841}
1842
1843impl AbsoluteVolumeHandlerProxy {
1844 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1846 let protocol_name =
1847 <AbsoluteVolumeHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1848 Self { client: fidl::client::Client::new(channel, protocol_name) }
1849 }
1850
1851 pub fn take_event_stream(&self) -> AbsoluteVolumeHandlerEventStream {
1857 AbsoluteVolumeHandlerEventStream { event_receiver: self.client.take_event_receiver() }
1858 }
1859
1860 pub fn r#set_volume(
1864 &self,
1865 mut requested_volume: u8,
1866 ) -> fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect> {
1867 AbsoluteVolumeHandlerProxyInterface::r#set_volume(self, requested_volume)
1868 }
1869
1870 pub fn r#on_volume_changed(
1876 &self,
1877 ) -> fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect> {
1878 AbsoluteVolumeHandlerProxyInterface::r#on_volume_changed(self)
1879 }
1880
1881 pub fn r#get_current_volume(
1883 &self,
1884 ) -> fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect> {
1885 AbsoluteVolumeHandlerProxyInterface::r#get_current_volume(self)
1886 }
1887}
1888
1889impl AbsoluteVolumeHandlerProxyInterface for AbsoluteVolumeHandlerProxy {
1890 type SetVolumeResponseFut =
1891 fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect>;
1892 fn r#set_volume(&self, mut requested_volume: u8) -> Self::SetVolumeResponseFut {
1893 fn _decode(
1894 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1895 ) -> Result<u8, fidl::Error> {
1896 let _response = fidl::client::decode_transaction_body::<
1897 AbsoluteVolumeHandlerSetVolumeResponse,
1898 fidl::encoding::DefaultFuchsiaResourceDialect,
1899 0x2796843ecbdecc65,
1900 >(_buf?)?;
1901 Ok(_response.set_volume)
1902 }
1903 self.client.send_query_and_decode::<AbsoluteVolumeHandlerSetVolumeRequest, u8>(
1904 (requested_volume,),
1905 0x2796843ecbdecc65,
1906 fidl::encoding::DynamicFlags::empty(),
1907 _decode,
1908 )
1909 }
1910
1911 type OnVolumeChangedResponseFut =
1912 fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect>;
1913 fn r#on_volume_changed(&self) -> Self::OnVolumeChangedResponseFut {
1914 fn _decode(
1915 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1916 ) -> Result<u8, fidl::Error> {
1917 let _response = fidl::client::decode_transaction_body::<
1918 AbsoluteVolumeHandlerOnVolumeChangedResponse,
1919 fidl::encoding::DefaultFuchsiaResourceDialect,
1920 0x1a1f9cffd4f2a74,
1921 >(_buf?)?;
1922 Ok(_response.new_volume)
1923 }
1924 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u8>(
1925 (),
1926 0x1a1f9cffd4f2a74,
1927 fidl::encoding::DynamicFlags::empty(),
1928 _decode,
1929 )
1930 }
1931
1932 type GetCurrentVolumeResponseFut =
1933 fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect>;
1934 fn r#get_current_volume(&self) -> Self::GetCurrentVolumeResponseFut {
1935 fn _decode(
1936 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1937 ) -> Result<u8, fidl::Error> {
1938 let _response = fidl::client::decode_transaction_body::<
1939 AbsoluteVolumeHandlerGetCurrentVolumeResponse,
1940 fidl::encoding::DefaultFuchsiaResourceDialect,
1941 0x6ae76e0c77ac35ff,
1942 >(_buf?)?;
1943 Ok(_response.volume)
1944 }
1945 self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u8>(
1946 (),
1947 0x6ae76e0c77ac35ff,
1948 fidl::encoding::DynamicFlags::empty(),
1949 _decode,
1950 )
1951 }
1952}
1953
1954pub struct AbsoluteVolumeHandlerEventStream {
1955 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1956}
1957
1958impl std::marker::Unpin for AbsoluteVolumeHandlerEventStream {}
1959
1960impl futures::stream::FusedStream for AbsoluteVolumeHandlerEventStream {
1961 fn is_terminated(&self) -> bool {
1962 self.event_receiver.is_terminated()
1963 }
1964}
1965
1966impl futures::Stream for AbsoluteVolumeHandlerEventStream {
1967 type Item = Result<AbsoluteVolumeHandlerEvent, fidl::Error>;
1968
1969 fn poll_next(
1970 mut self: std::pin::Pin<&mut Self>,
1971 cx: &mut std::task::Context<'_>,
1972 ) -> std::task::Poll<Option<Self::Item>> {
1973 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1974 &mut self.event_receiver,
1975 cx
1976 )?) {
1977 Some(buf) => std::task::Poll::Ready(Some(AbsoluteVolumeHandlerEvent::decode(buf))),
1978 None => std::task::Poll::Ready(None),
1979 }
1980 }
1981}
1982
1983#[derive(Debug)]
1984pub enum AbsoluteVolumeHandlerEvent {}
1985
1986impl AbsoluteVolumeHandlerEvent {
1987 fn decode(
1989 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1990 ) -> Result<AbsoluteVolumeHandlerEvent, fidl::Error> {
1991 let (bytes, _handles) = buf.split_mut();
1992 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1993 debug_assert_eq!(tx_header.tx_id, 0);
1994 match tx_header.ordinal {
1995 _ => Err(fidl::Error::UnknownOrdinal {
1996 ordinal: tx_header.ordinal,
1997 protocol_name:
1998 <AbsoluteVolumeHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1999 }),
2000 }
2001 }
2002}
2003
2004pub struct AbsoluteVolumeHandlerRequestStream {
2006 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2007 is_terminated: bool,
2008}
2009
2010impl std::marker::Unpin for AbsoluteVolumeHandlerRequestStream {}
2011
2012impl futures::stream::FusedStream for AbsoluteVolumeHandlerRequestStream {
2013 fn is_terminated(&self) -> bool {
2014 self.is_terminated
2015 }
2016}
2017
2018impl fidl::endpoints::RequestStream for AbsoluteVolumeHandlerRequestStream {
2019 type Protocol = AbsoluteVolumeHandlerMarker;
2020 type ControlHandle = AbsoluteVolumeHandlerControlHandle;
2021
2022 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
2023 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
2024 }
2025
2026 fn control_handle(&self) -> Self::ControlHandle {
2027 AbsoluteVolumeHandlerControlHandle { inner: self.inner.clone() }
2028 }
2029
2030 fn into_inner(
2031 self,
2032 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
2033 {
2034 (self.inner, self.is_terminated)
2035 }
2036
2037 fn from_inner(
2038 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2039 is_terminated: bool,
2040 ) -> Self {
2041 Self { inner, is_terminated }
2042 }
2043}
2044
2045impl futures::Stream for AbsoluteVolumeHandlerRequestStream {
2046 type Item = Result<AbsoluteVolumeHandlerRequest, fidl::Error>;
2047
2048 fn poll_next(
2049 mut self: std::pin::Pin<&mut Self>,
2050 cx: &mut std::task::Context<'_>,
2051 ) -> std::task::Poll<Option<Self::Item>> {
2052 let this = &mut *self;
2053 if this.inner.check_shutdown(cx) {
2054 this.is_terminated = true;
2055 return std::task::Poll::Ready(None);
2056 }
2057 if this.is_terminated {
2058 panic!("polled AbsoluteVolumeHandlerRequestStream after completion");
2059 }
2060 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
2061 |bytes, handles| {
2062 match this.inner.channel().read_etc(cx, bytes, handles) {
2063 std::task::Poll::Ready(Ok(())) => {}
2064 std::task::Poll::Pending => return std::task::Poll::Pending,
2065 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
2066 this.is_terminated = true;
2067 return std::task::Poll::Ready(None);
2068 }
2069 std::task::Poll::Ready(Err(e)) => {
2070 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
2071 e.into(),
2072 ))))
2073 }
2074 }
2075
2076 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
2078
2079 std::task::Poll::Ready(Some(match header.ordinal {
2080 0x2796843ecbdecc65 => {
2081 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2082 let mut req = fidl::new_empty!(AbsoluteVolumeHandlerSetVolumeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
2083 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AbsoluteVolumeHandlerSetVolumeRequest>(&header, _body_bytes, handles, &mut req)?;
2084 let control_handle = AbsoluteVolumeHandlerControlHandle {
2085 inner: this.inner.clone(),
2086 };
2087 Ok(AbsoluteVolumeHandlerRequest::SetVolume {requested_volume: req.requested_volume,
2088
2089 responder: AbsoluteVolumeHandlerSetVolumeResponder {
2090 control_handle: std::mem::ManuallyDrop::new(control_handle),
2091 tx_id: header.tx_id,
2092 },
2093 })
2094 }
2095 0x1a1f9cffd4f2a74 => {
2096 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2097 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2098 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2099 let control_handle = AbsoluteVolumeHandlerControlHandle {
2100 inner: this.inner.clone(),
2101 };
2102 Ok(AbsoluteVolumeHandlerRequest::OnVolumeChanged {
2103 responder: AbsoluteVolumeHandlerOnVolumeChangedResponder {
2104 control_handle: std::mem::ManuallyDrop::new(control_handle),
2105 tx_id: header.tx_id,
2106 },
2107 })
2108 }
2109 0x6ae76e0c77ac35ff => {
2110 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
2111 let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
2112 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
2113 let control_handle = AbsoluteVolumeHandlerControlHandle {
2114 inner: this.inner.clone(),
2115 };
2116 Ok(AbsoluteVolumeHandlerRequest::GetCurrentVolume {
2117 responder: AbsoluteVolumeHandlerGetCurrentVolumeResponder {
2118 control_handle: std::mem::ManuallyDrop::new(control_handle),
2119 tx_id: header.tx_id,
2120 },
2121 })
2122 }
2123 _ => Err(fidl::Error::UnknownOrdinal {
2124 ordinal: header.ordinal,
2125 protocol_name: <AbsoluteVolumeHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
2126 }),
2127 }))
2128 },
2129 )
2130 }
2131}
2132
2133#[derive(Debug)]
2138pub enum AbsoluteVolumeHandlerRequest {
2139 SetVolume { requested_volume: u8, responder: AbsoluteVolumeHandlerSetVolumeResponder },
2143 OnVolumeChanged { responder: AbsoluteVolumeHandlerOnVolumeChangedResponder },
2149 GetCurrentVolume { responder: AbsoluteVolumeHandlerGetCurrentVolumeResponder },
2151}
2152
2153impl AbsoluteVolumeHandlerRequest {
2154 #[allow(irrefutable_let_patterns)]
2155 pub fn into_set_volume(self) -> Option<(u8, AbsoluteVolumeHandlerSetVolumeResponder)> {
2156 if let AbsoluteVolumeHandlerRequest::SetVolume { requested_volume, responder } = self {
2157 Some((requested_volume, responder))
2158 } else {
2159 None
2160 }
2161 }
2162
2163 #[allow(irrefutable_let_patterns)]
2164 pub fn into_on_volume_changed(self) -> Option<(AbsoluteVolumeHandlerOnVolumeChangedResponder)> {
2165 if let AbsoluteVolumeHandlerRequest::OnVolumeChanged { responder } = self {
2166 Some((responder))
2167 } else {
2168 None
2169 }
2170 }
2171
2172 #[allow(irrefutable_let_patterns)]
2173 pub fn into_get_current_volume(
2174 self,
2175 ) -> Option<(AbsoluteVolumeHandlerGetCurrentVolumeResponder)> {
2176 if let AbsoluteVolumeHandlerRequest::GetCurrentVolume { responder } = self {
2177 Some((responder))
2178 } else {
2179 None
2180 }
2181 }
2182
2183 pub fn method_name(&self) -> &'static str {
2185 match *self {
2186 AbsoluteVolumeHandlerRequest::SetVolume { .. } => "set_volume",
2187 AbsoluteVolumeHandlerRequest::OnVolumeChanged { .. } => "on_volume_changed",
2188 AbsoluteVolumeHandlerRequest::GetCurrentVolume { .. } => "get_current_volume",
2189 }
2190 }
2191}
2192
2193#[derive(Debug, Clone)]
2194pub struct AbsoluteVolumeHandlerControlHandle {
2195 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
2196}
2197
2198impl fidl::endpoints::ControlHandle for AbsoluteVolumeHandlerControlHandle {
2199 fn shutdown(&self) {
2200 self.inner.shutdown()
2201 }
2202 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
2203 self.inner.shutdown_with_epitaph(status)
2204 }
2205
2206 fn is_closed(&self) -> bool {
2207 self.inner.channel().is_closed()
2208 }
2209 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
2210 self.inner.channel().on_closed()
2211 }
2212
2213 #[cfg(target_os = "fuchsia")]
2214 fn signal_peer(
2215 &self,
2216 clear_mask: zx::Signals,
2217 set_mask: zx::Signals,
2218 ) -> Result<(), zx_status::Status> {
2219 use fidl::Peered;
2220 self.inner.channel().signal_peer(clear_mask, set_mask)
2221 }
2222}
2223
2224impl AbsoluteVolumeHandlerControlHandle {}
2225
2226#[must_use = "FIDL methods require a response to be sent"]
2227#[derive(Debug)]
2228pub struct AbsoluteVolumeHandlerSetVolumeResponder {
2229 control_handle: std::mem::ManuallyDrop<AbsoluteVolumeHandlerControlHandle>,
2230 tx_id: u32,
2231}
2232
2233impl std::ops::Drop for AbsoluteVolumeHandlerSetVolumeResponder {
2237 fn drop(&mut self) {
2238 self.control_handle.shutdown();
2239 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2241 }
2242}
2243
2244impl fidl::endpoints::Responder for AbsoluteVolumeHandlerSetVolumeResponder {
2245 type ControlHandle = AbsoluteVolumeHandlerControlHandle;
2246
2247 fn control_handle(&self) -> &AbsoluteVolumeHandlerControlHandle {
2248 &self.control_handle
2249 }
2250
2251 fn drop_without_shutdown(mut self) {
2252 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2254 std::mem::forget(self);
2256 }
2257}
2258
2259impl AbsoluteVolumeHandlerSetVolumeResponder {
2260 pub fn send(self, mut set_volume: u8) -> Result<(), fidl::Error> {
2264 let _result = self.send_raw(set_volume);
2265 if _result.is_err() {
2266 self.control_handle.shutdown();
2267 }
2268 self.drop_without_shutdown();
2269 _result
2270 }
2271
2272 pub fn send_no_shutdown_on_err(self, mut set_volume: u8) -> Result<(), fidl::Error> {
2274 let _result = self.send_raw(set_volume);
2275 self.drop_without_shutdown();
2276 _result
2277 }
2278
2279 fn send_raw(&self, mut set_volume: u8) -> Result<(), fidl::Error> {
2280 self.control_handle.inner.send::<AbsoluteVolumeHandlerSetVolumeResponse>(
2281 (set_volume,),
2282 self.tx_id,
2283 0x2796843ecbdecc65,
2284 fidl::encoding::DynamicFlags::empty(),
2285 )
2286 }
2287}
2288
2289#[must_use = "FIDL methods require a response to be sent"]
2290#[derive(Debug)]
2291pub struct AbsoluteVolumeHandlerOnVolumeChangedResponder {
2292 control_handle: std::mem::ManuallyDrop<AbsoluteVolumeHandlerControlHandle>,
2293 tx_id: u32,
2294}
2295
2296impl std::ops::Drop for AbsoluteVolumeHandlerOnVolumeChangedResponder {
2300 fn drop(&mut self) {
2301 self.control_handle.shutdown();
2302 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2304 }
2305}
2306
2307impl fidl::endpoints::Responder for AbsoluteVolumeHandlerOnVolumeChangedResponder {
2308 type ControlHandle = AbsoluteVolumeHandlerControlHandle;
2309
2310 fn control_handle(&self) -> &AbsoluteVolumeHandlerControlHandle {
2311 &self.control_handle
2312 }
2313
2314 fn drop_without_shutdown(mut self) {
2315 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2317 std::mem::forget(self);
2319 }
2320}
2321
2322impl AbsoluteVolumeHandlerOnVolumeChangedResponder {
2323 pub fn send(self, mut new_volume: u8) -> Result<(), fidl::Error> {
2327 let _result = self.send_raw(new_volume);
2328 if _result.is_err() {
2329 self.control_handle.shutdown();
2330 }
2331 self.drop_without_shutdown();
2332 _result
2333 }
2334
2335 pub fn send_no_shutdown_on_err(self, mut new_volume: u8) -> Result<(), fidl::Error> {
2337 let _result = self.send_raw(new_volume);
2338 self.drop_without_shutdown();
2339 _result
2340 }
2341
2342 fn send_raw(&self, mut new_volume: u8) -> Result<(), fidl::Error> {
2343 self.control_handle.inner.send::<AbsoluteVolumeHandlerOnVolumeChangedResponse>(
2344 (new_volume,),
2345 self.tx_id,
2346 0x1a1f9cffd4f2a74,
2347 fidl::encoding::DynamicFlags::empty(),
2348 )
2349 }
2350}
2351
2352#[must_use = "FIDL methods require a response to be sent"]
2353#[derive(Debug)]
2354pub struct AbsoluteVolumeHandlerGetCurrentVolumeResponder {
2355 control_handle: std::mem::ManuallyDrop<AbsoluteVolumeHandlerControlHandle>,
2356 tx_id: u32,
2357}
2358
2359impl std::ops::Drop for AbsoluteVolumeHandlerGetCurrentVolumeResponder {
2363 fn drop(&mut self) {
2364 self.control_handle.shutdown();
2365 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2367 }
2368}
2369
2370impl fidl::endpoints::Responder for AbsoluteVolumeHandlerGetCurrentVolumeResponder {
2371 type ControlHandle = AbsoluteVolumeHandlerControlHandle;
2372
2373 fn control_handle(&self) -> &AbsoluteVolumeHandlerControlHandle {
2374 &self.control_handle
2375 }
2376
2377 fn drop_without_shutdown(mut self) {
2378 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
2380 std::mem::forget(self);
2382 }
2383}
2384
2385impl AbsoluteVolumeHandlerGetCurrentVolumeResponder {
2386 pub fn send(self, mut volume: u8) -> Result<(), fidl::Error> {
2390 let _result = self.send_raw(volume);
2391 if _result.is_err() {
2392 self.control_handle.shutdown();
2393 }
2394 self.drop_without_shutdown();
2395 _result
2396 }
2397
2398 pub fn send_no_shutdown_on_err(self, mut volume: u8) -> Result<(), fidl::Error> {
2400 let _result = self.send_raw(volume);
2401 self.drop_without_shutdown();
2402 _result
2403 }
2404
2405 fn send_raw(&self, mut volume: u8) -> Result<(), fidl::Error> {
2406 self.control_handle.inner.send::<AbsoluteVolumeHandlerGetCurrentVolumeResponse>(
2407 (volume,),
2408 self.tx_id,
2409 0x6ae76e0c77ac35ff,
2410 fidl::encoding::DynamicFlags::empty(),
2411 )
2412 }
2413}
2414
2415#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2416pub struct BrowseControllerMarker;
2417
2418impl fidl::endpoints::ProtocolMarker for BrowseControllerMarker {
2419 type Proxy = BrowseControllerProxy;
2420 type RequestStream = BrowseControllerRequestStream;
2421 #[cfg(target_os = "fuchsia")]
2422 type SynchronousProxy = BrowseControllerSynchronousProxy;
2423
2424 const DEBUG_NAME: &'static str = "(anonymous) BrowseController";
2425}
2426pub type BrowseControllerGetMediaPlayerItemsResult =
2427 Result<Vec<MediaPlayerItem>, BrowseControllerError>;
2428pub type BrowseControllerGetNowPlayingItemsResult =
2429 Result<Vec<MediaElementItem>, BrowseControllerError>;
2430pub type BrowseControllerGetFileSystemItemsResult =
2431 Result<Vec<FileSystemItem>, BrowseControllerError>;
2432pub type BrowseControllerChangePathResult = Result<u32, BrowseControllerError>;
2433pub type BrowseControllerPlayFileSystemItemResult = Result<(), BrowseControllerError>;
2434pub type BrowseControllerPlayNowPlayingItemResult = Result<(), BrowseControllerError>;
2435pub type BrowseControllerSetBrowsedPlayerResult = Result<(), BrowseControllerError>;
2436
2437pub trait BrowseControllerProxyInterface: Send + Sync {
2438 type GetMediaPlayerItemsResponseFut: std::future::Future<Output = Result<BrowseControllerGetMediaPlayerItemsResult, fidl::Error>>
2439 + Send;
2440 fn r#get_media_player_items(
2441 &self,
2442 start_index: u32,
2443 end_index: u32,
2444 ) -> Self::GetMediaPlayerItemsResponseFut;
2445 type GetNowPlayingItemsResponseFut: std::future::Future<Output = Result<BrowseControllerGetNowPlayingItemsResult, fidl::Error>>
2446 + Send;
2447 fn r#get_now_playing_items(
2448 &self,
2449 start_index: u32,
2450 end_index: u32,
2451 attribute_option: &AttributeRequestOption,
2452 ) -> Self::GetNowPlayingItemsResponseFut;
2453 type GetFileSystemItemsResponseFut: std::future::Future<Output = Result<BrowseControllerGetFileSystemItemsResult, fidl::Error>>
2454 + Send;
2455 fn r#get_file_system_items(
2456 &self,
2457 start_index: u32,
2458 end_index: u32,
2459 attribute_option: &AttributeRequestOption,
2460 ) -> Self::GetFileSystemItemsResponseFut;
2461 type ChangePathResponseFut: std::future::Future<Output = Result<BrowseControllerChangePathResult, fidl::Error>>
2462 + Send;
2463 fn r#change_path(&self, path: &Path) -> Self::ChangePathResponseFut;
2464 type PlayFileSystemItemResponseFut: std::future::Future<Output = Result<BrowseControllerPlayFileSystemItemResult, fidl::Error>>
2465 + Send;
2466 fn r#play_file_system_item(&self, uid: u64) -> Self::PlayFileSystemItemResponseFut;
2467 type PlayNowPlayingItemResponseFut: std::future::Future<Output = Result<BrowseControllerPlayNowPlayingItemResult, fidl::Error>>
2468 + Send;
2469 fn r#play_now_playing_item(&self, uid: u64) -> Self::PlayNowPlayingItemResponseFut;
2470 type SetBrowsedPlayerResponseFut: std::future::Future<Output = Result<BrowseControllerSetBrowsedPlayerResult, fidl::Error>>
2471 + Send;
2472 fn r#set_browsed_player(&self, player_id: u16) -> Self::SetBrowsedPlayerResponseFut;
2473}
2474#[derive(Debug)]
2475#[cfg(target_os = "fuchsia")]
2476pub struct BrowseControllerSynchronousProxy {
2477 client: fidl::client::sync::Client,
2478}
2479
2480#[cfg(target_os = "fuchsia")]
2481impl fidl::endpoints::SynchronousProxy for BrowseControllerSynchronousProxy {
2482 type Proxy = BrowseControllerProxy;
2483 type Protocol = BrowseControllerMarker;
2484
2485 fn from_channel(inner: fidl::Channel) -> Self {
2486 Self::new(inner)
2487 }
2488
2489 fn into_channel(self) -> fidl::Channel {
2490 self.client.into_channel()
2491 }
2492
2493 fn as_channel(&self) -> &fidl::Channel {
2494 self.client.as_channel()
2495 }
2496}
2497
2498#[cfg(target_os = "fuchsia")]
2499impl BrowseControllerSynchronousProxy {
2500 pub fn new(channel: fidl::Channel) -> Self {
2501 let protocol_name = <BrowseControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2502 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2503 }
2504
2505 pub fn into_channel(self) -> fidl::Channel {
2506 self.client.into_channel()
2507 }
2508
2509 pub fn wait_for_event(
2512 &self,
2513 deadline: zx::MonotonicInstant,
2514 ) -> Result<BrowseControllerEvent, fidl::Error> {
2515 BrowseControllerEvent::decode(self.client.wait_for_event(deadline)?)
2516 }
2517
2518 pub fn r#get_media_player_items(
2521 &self,
2522 mut start_index: u32,
2523 mut end_index: u32,
2524 ___deadline: zx::MonotonicInstant,
2525 ) -> Result<BrowseControllerGetMediaPlayerItemsResult, fidl::Error> {
2526 let _response = self
2527 .client
2528 .send_query::<BrowseControllerGetMediaPlayerItemsRequest, fidl::encoding::ResultType<
2529 BrowseControllerGetMediaPlayerItemsResponse,
2530 BrowseControllerError,
2531 >>(
2532 (start_index, end_index),
2533 0x49c06d30a9aa02ba,
2534 fidl::encoding::DynamicFlags::empty(),
2535 ___deadline,
2536 )?;
2537 Ok(_response.map(|x| x.items))
2538 }
2539
2540 pub fn r#get_now_playing_items(
2545 &self,
2546 mut start_index: u32,
2547 mut end_index: u32,
2548 mut attribute_option: &AttributeRequestOption,
2549 ___deadline: zx::MonotonicInstant,
2550 ) -> Result<BrowseControllerGetNowPlayingItemsResult, fidl::Error> {
2551 let _response = self
2552 .client
2553 .send_query::<BrowseControllerGetNowPlayingItemsRequest, fidl::encoding::ResultType<
2554 BrowseControllerGetNowPlayingItemsResponse,
2555 BrowseControllerError,
2556 >>(
2557 (start_index, end_index, attribute_option),
2558 0x35f5a88695b46cf7,
2559 fidl::encoding::DynamicFlags::empty(),
2560 ___deadline,
2561 )?;
2562 Ok(_response.map(|x| x.items))
2563 }
2564
2565 pub fn r#get_file_system_items(
2569 &self,
2570 mut start_index: u32,
2571 mut end_index: u32,
2572 mut attribute_option: &AttributeRequestOption,
2573 ___deadline: zx::MonotonicInstant,
2574 ) -> Result<BrowseControllerGetFileSystemItemsResult, fidl::Error> {
2575 let _response = self
2576 .client
2577 .send_query::<BrowseControllerGetFileSystemItemsRequest, fidl::encoding::ResultType<
2578 BrowseControllerGetFileSystemItemsResponse,
2579 BrowseControllerError,
2580 >>(
2581 (start_index, end_index, attribute_option),
2582 0x5d1415aecee72133,
2583 fidl::encoding::DynamicFlags::empty(),
2584 ___deadline,
2585 )?;
2586 Ok(_response.map(|x| x.items))
2587 }
2588
2589 pub fn r#change_path(
2594 &self,
2595 mut path: &Path,
2596 ___deadline: zx::MonotonicInstant,
2597 ) -> Result<BrowseControllerChangePathResult, fidl::Error> {
2598 let _response =
2599 self.client
2600 .send_query::<BrowseControllerChangePathRequest, fidl::encoding::ResultType<
2601 BrowseControllerChangePathResponse,
2602 BrowseControllerError,
2603 >>(
2604 (path,),
2605 0x2e0600579d43b51e,
2606 fidl::encoding::DynamicFlags::empty(),
2607 ___deadline,
2608 )?;
2609 Ok(_response.map(|x| x.num_items))
2610 }
2611
2612 pub fn r#play_file_system_item(
2614 &self,
2615 mut uid: u64,
2616 ___deadline: zx::MonotonicInstant,
2617 ) -> Result<BrowseControllerPlayFileSystemItemResult, fidl::Error> {
2618 let _response = self.client.send_query::<
2619 BrowseControllerPlayFileSystemItemRequest,
2620 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BrowseControllerError>,
2621 >(
2622 (uid,),
2623 0x57075115ce25cf16,
2624 fidl::encoding::DynamicFlags::empty(),
2625 ___deadline,
2626 )?;
2627 Ok(_response.map(|x| x))
2628 }
2629
2630 pub fn r#play_now_playing_item(
2633 &self,
2634 mut uid: u64,
2635 ___deadline: zx::MonotonicInstant,
2636 ) -> Result<BrowseControllerPlayNowPlayingItemResult, fidl::Error> {
2637 let _response = self.client.send_query::<
2638 BrowseControllerPlayNowPlayingItemRequest,
2639 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BrowseControllerError>,
2640 >(
2641 (uid,),
2642 0x116e151d547fd2d7,
2643 fidl::encoding::DynamicFlags::empty(),
2644 ___deadline,
2645 )?;
2646 Ok(_response.map(|x| x))
2647 }
2648
2649 pub fn r#set_browsed_player(
2651 &self,
2652 mut player_id: u16,
2653 ___deadline: zx::MonotonicInstant,
2654 ) -> Result<BrowseControllerSetBrowsedPlayerResult, fidl::Error> {
2655 let _response = self.client.send_query::<
2656 BrowseControllerSetBrowsedPlayerRequest,
2657 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BrowseControllerError>,
2658 >(
2659 (player_id,),
2660 0x3e3256f57f8848da,
2661 fidl::encoding::DynamicFlags::empty(),
2662 ___deadline,
2663 )?;
2664 Ok(_response.map(|x| x))
2665 }
2666}
2667
2668#[derive(Debug, Clone)]
2669pub struct BrowseControllerProxy {
2670 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2671}
2672
2673impl fidl::endpoints::Proxy for BrowseControllerProxy {
2674 type Protocol = BrowseControllerMarker;
2675
2676 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2677 Self::new(inner)
2678 }
2679
2680 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2681 self.client.into_channel().map_err(|client| Self { client })
2682 }
2683
2684 fn as_channel(&self) -> &::fidl::AsyncChannel {
2685 self.client.as_channel()
2686 }
2687}
2688
2689impl BrowseControllerProxy {
2690 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2692 let protocol_name = <BrowseControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2693 Self { client: fidl::client::Client::new(channel, protocol_name) }
2694 }
2695
2696 pub fn take_event_stream(&self) -> BrowseControllerEventStream {
2702 BrowseControllerEventStream { event_receiver: self.client.take_event_receiver() }
2703 }
2704
2705 pub fn r#get_media_player_items(
2708 &self,
2709 mut start_index: u32,
2710 mut end_index: u32,
2711 ) -> fidl::client::QueryResponseFut<
2712 BrowseControllerGetMediaPlayerItemsResult,
2713 fidl::encoding::DefaultFuchsiaResourceDialect,
2714 > {
2715 BrowseControllerProxyInterface::r#get_media_player_items(self, start_index, end_index)
2716 }
2717
2718 pub fn r#get_now_playing_items(
2723 &self,
2724 mut start_index: u32,
2725 mut end_index: u32,
2726 mut attribute_option: &AttributeRequestOption,
2727 ) -> fidl::client::QueryResponseFut<
2728 BrowseControllerGetNowPlayingItemsResult,
2729 fidl::encoding::DefaultFuchsiaResourceDialect,
2730 > {
2731 BrowseControllerProxyInterface::r#get_now_playing_items(
2732 self,
2733 start_index,
2734 end_index,
2735 attribute_option,
2736 )
2737 }
2738
2739 pub fn r#get_file_system_items(
2743 &self,
2744 mut start_index: u32,
2745 mut end_index: u32,
2746 mut attribute_option: &AttributeRequestOption,
2747 ) -> fidl::client::QueryResponseFut<
2748 BrowseControllerGetFileSystemItemsResult,
2749 fidl::encoding::DefaultFuchsiaResourceDialect,
2750 > {
2751 BrowseControllerProxyInterface::r#get_file_system_items(
2752 self,
2753 start_index,
2754 end_index,
2755 attribute_option,
2756 )
2757 }
2758
2759 pub fn r#change_path(
2764 &self,
2765 mut path: &Path,
2766 ) -> fidl::client::QueryResponseFut<
2767 BrowseControllerChangePathResult,
2768 fidl::encoding::DefaultFuchsiaResourceDialect,
2769 > {
2770 BrowseControllerProxyInterface::r#change_path(self, path)
2771 }
2772
2773 pub fn r#play_file_system_item(
2775 &self,
2776 mut uid: u64,
2777 ) -> fidl::client::QueryResponseFut<
2778 BrowseControllerPlayFileSystemItemResult,
2779 fidl::encoding::DefaultFuchsiaResourceDialect,
2780 > {
2781 BrowseControllerProxyInterface::r#play_file_system_item(self, uid)
2782 }
2783
2784 pub fn r#play_now_playing_item(
2787 &self,
2788 mut uid: u64,
2789 ) -> fidl::client::QueryResponseFut<
2790 BrowseControllerPlayNowPlayingItemResult,
2791 fidl::encoding::DefaultFuchsiaResourceDialect,
2792 > {
2793 BrowseControllerProxyInterface::r#play_now_playing_item(self, uid)
2794 }
2795
2796 pub fn r#set_browsed_player(
2798 &self,
2799 mut player_id: u16,
2800 ) -> fidl::client::QueryResponseFut<
2801 BrowseControllerSetBrowsedPlayerResult,
2802 fidl::encoding::DefaultFuchsiaResourceDialect,
2803 > {
2804 BrowseControllerProxyInterface::r#set_browsed_player(self, player_id)
2805 }
2806}
2807
2808impl BrowseControllerProxyInterface for BrowseControllerProxy {
2809 type GetMediaPlayerItemsResponseFut = fidl::client::QueryResponseFut<
2810 BrowseControllerGetMediaPlayerItemsResult,
2811 fidl::encoding::DefaultFuchsiaResourceDialect,
2812 >;
2813 fn r#get_media_player_items(
2814 &self,
2815 mut start_index: u32,
2816 mut end_index: u32,
2817 ) -> Self::GetMediaPlayerItemsResponseFut {
2818 fn _decode(
2819 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2820 ) -> Result<BrowseControllerGetMediaPlayerItemsResult, fidl::Error> {
2821 let _response = fidl::client::decode_transaction_body::<
2822 fidl::encoding::ResultType<
2823 BrowseControllerGetMediaPlayerItemsResponse,
2824 BrowseControllerError,
2825 >,
2826 fidl::encoding::DefaultFuchsiaResourceDialect,
2827 0x49c06d30a9aa02ba,
2828 >(_buf?)?;
2829 Ok(_response.map(|x| x.items))
2830 }
2831 self.client.send_query_and_decode::<
2832 BrowseControllerGetMediaPlayerItemsRequest,
2833 BrowseControllerGetMediaPlayerItemsResult,
2834 >(
2835 (start_index, end_index,),
2836 0x49c06d30a9aa02ba,
2837 fidl::encoding::DynamicFlags::empty(),
2838 _decode,
2839 )
2840 }
2841
2842 type GetNowPlayingItemsResponseFut = fidl::client::QueryResponseFut<
2843 BrowseControllerGetNowPlayingItemsResult,
2844 fidl::encoding::DefaultFuchsiaResourceDialect,
2845 >;
2846 fn r#get_now_playing_items(
2847 &self,
2848 mut start_index: u32,
2849 mut end_index: u32,
2850 mut attribute_option: &AttributeRequestOption,
2851 ) -> Self::GetNowPlayingItemsResponseFut {
2852 fn _decode(
2853 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2854 ) -> Result<BrowseControllerGetNowPlayingItemsResult, fidl::Error> {
2855 let _response = fidl::client::decode_transaction_body::<
2856 fidl::encoding::ResultType<
2857 BrowseControllerGetNowPlayingItemsResponse,
2858 BrowseControllerError,
2859 >,
2860 fidl::encoding::DefaultFuchsiaResourceDialect,
2861 0x35f5a88695b46cf7,
2862 >(_buf?)?;
2863 Ok(_response.map(|x| x.items))
2864 }
2865 self.client.send_query_and_decode::<
2866 BrowseControllerGetNowPlayingItemsRequest,
2867 BrowseControllerGetNowPlayingItemsResult,
2868 >(
2869 (start_index, end_index, attribute_option,),
2870 0x35f5a88695b46cf7,
2871 fidl::encoding::DynamicFlags::empty(),
2872 _decode,
2873 )
2874 }
2875
2876 type GetFileSystemItemsResponseFut = fidl::client::QueryResponseFut<
2877 BrowseControllerGetFileSystemItemsResult,
2878 fidl::encoding::DefaultFuchsiaResourceDialect,
2879 >;
2880 fn r#get_file_system_items(
2881 &self,
2882 mut start_index: u32,
2883 mut end_index: u32,
2884 mut attribute_option: &AttributeRequestOption,
2885 ) -> Self::GetFileSystemItemsResponseFut {
2886 fn _decode(
2887 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2888 ) -> Result<BrowseControllerGetFileSystemItemsResult, fidl::Error> {
2889 let _response = fidl::client::decode_transaction_body::<
2890 fidl::encoding::ResultType<
2891 BrowseControllerGetFileSystemItemsResponse,
2892 BrowseControllerError,
2893 >,
2894 fidl::encoding::DefaultFuchsiaResourceDialect,
2895 0x5d1415aecee72133,
2896 >(_buf?)?;
2897 Ok(_response.map(|x| x.items))
2898 }
2899 self.client.send_query_and_decode::<
2900 BrowseControllerGetFileSystemItemsRequest,
2901 BrowseControllerGetFileSystemItemsResult,
2902 >(
2903 (start_index, end_index, attribute_option,),
2904 0x5d1415aecee72133,
2905 fidl::encoding::DynamicFlags::empty(),
2906 _decode,
2907 )
2908 }
2909
2910 type ChangePathResponseFut = fidl::client::QueryResponseFut<
2911 BrowseControllerChangePathResult,
2912 fidl::encoding::DefaultFuchsiaResourceDialect,
2913 >;
2914 fn r#change_path(&self, mut path: &Path) -> Self::ChangePathResponseFut {
2915 fn _decode(
2916 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2917 ) -> Result<BrowseControllerChangePathResult, fidl::Error> {
2918 let _response = fidl::client::decode_transaction_body::<
2919 fidl::encoding::ResultType<
2920 BrowseControllerChangePathResponse,
2921 BrowseControllerError,
2922 >,
2923 fidl::encoding::DefaultFuchsiaResourceDialect,
2924 0x2e0600579d43b51e,
2925 >(_buf?)?;
2926 Ok(_response.map(|x| x.num_items))
2927 }
2928 self.client.send_query_and_decode::<
2929 BrowseControllerChangePathRequest,
2930 BrowseControllerChangePathResult,
2931 >(
2932 (path,),
2933 0x2e0600579d43b51e,
2934 fidl::encoding::DynamicFlags::empty(),
2935 _decode,
2936 )
2937 }
2938
2939 type PlayFileSystemItemResponseFut = fidl::client::QueryResponseFut<
2940 BrowseControllerPlayFileSystemItemResult,
2941 fidl::encoding::DefaultFuchsiaResourceDialect,
2942 >;
2943 fn r#play_file_system_item(&self, mut uid: u64) -> Self::PlayFileSystemItemResponseFut {
2944 fn _decode(
2945 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2946 ) -> Result<BrowseControllerPlayFileSystemItemResult, fidl::Error> {
2947 let _response = fidl::client::decode_transaction_body::<
2948 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BrowseControllerError>,
2949 fidl::encoding::DefaultFuchsiaResourceDialect,
2950 0x57075115ce25cf16,
2951 >(_buf?)?;
2952 Ok(_response.map(|x| x))
2953 }
2954 self.client.send_query_and_decode::<
2955 BrowseControllerPlayFileSystemItemRequest,
2956 BrowseControllerPlayFileSystemItemResult,
2957 >(
2958 (uid,),
2959 0x57075115ce25cf16,
2960 fidl::encoding::DynamicFlags::empty(),
2961 _decode,
2962 )
2963 }
2964
2965 type PlayNowPlayingItemResponseFut = fidl::client::QueryResponseFut<
2966 BrowseControllerPlayNowPlayingItemResult,
2967 fidl::encoding::DefaultFuchsiaResourceDialect,
2968 >;
2969 fn r#play_now_playing_item(&self, mut uid: u64) -> Self::PlayNowPlayingItemResponseFut {
2970 fn _decode(
2971 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2972 ) -> Result<BrowseControllerPlayNowPlayingItemResult, fidl::Error> {
2973 let _response = fidl::client::decode_transaction_body::<
2974 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BrowseControllerError>,
2975 fidl::encoding::DefaultFuchsiaResourceDialect,
2976 0x116e151d547fd2d7,
2977 >(_buf?)?;
2978 Ok(_response.map(|x| x))
2979 }
2980 self.client.send_query_and_decode::<
2981 BrowseControllerPlayNowPlayingItemRequest,
2982 BrowseControllerPlayNowPlayingItemResult,
2983 >(
2984 (uid,),
2985 0x116e151d547fd2d7,
2986 fidl::encoding::DynamicFlags::empty(),
2987 _decode,
2988 )
2989 }
2990
2991 type SetBrowsedPlayerResponseFut = fidl::client::QueryResponseFut<
2992 BrowseControllerSetBrowsedPlayerResult,
2993 fidl::encoding::DefaultFuchsiaResourceDialect,
2994 >;
2995 fn r#set_browsed_player(&self, mut player_id: u16) -> Self::SetBrowsedPlayerResponseFut {
2996 fn _decode(
2997 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2998 ) -> Result<BrowseControllerSetBrowsedPlayerResult, fidl::Error> {
2999 let _response = fidl::client::decode_transaction_body::<
3000 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BrowseControllerError>,
3001 fidl::encoding::DefaultFuchsiaResourceDialect,
3002 0x3e3256f57f8848da,
3003 >(_buf?)?;
3004 Ok(_response.map(|x| x))
3005 }
3006 self.client.send_query_and_decode::<
3007 BrowseControllerSetBrowsedPlayerRequest,
3008 BrowseControllerSetBrowsedPlayerResult,
3009 >(
3010 (player_id,),
3011 0x3e3256f57f8848da,
3012 fidl::encoding::DynamicFlags::empty(),
3013 _decode,
3014 )
3015 }
3016}
3017
3018pub struct BrowseControllerEventStream {
3019 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3020}
3021
3022impl std::marker::Unpin for BrowseControllerEventStream {}
3023
3024impl futures::stream::FusedStream for BrowseControllerEventStream {
3025 fn is_terminated(&self) -> bool {
3026 self.event_receiver.is_terminated()
3027 }
3028}
3029
3030impl futures::Stream for BrowseControllerEventStream {
3031 type Item = Result<BrowseControllerEvent, fidl::Error>;
3032
3033 fn poll_next(
3034 mut self: std::pin::Pin<&mut Self>,
3035 cx: &mut std::task::Context<'_>,
3036 ) -> std::task::Poll<Option<Self::Item>> {
3037 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3038 &mut self.event_receiver,
3039 cx
3040 )?) {
3041 Some(buf) => std::task::Poll::Ready(Some(BrowseControllerEvent::decode(buf))),
3042 None => std::task::Poll::Ready(None),
3043 }
3044 }
3045}
3046
3047#[derive(Debug)]
3048pub enum BrowseControllerEvent {}
3049
3050impl BrowseControllerEvent {
3051 fn decode(
3053 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3054 ) -> Result<BrowseControllerEvent, fidl::Error> {
3055 let (bytes, _handles) = buf.split_mut();
3056 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3057 debug_assert_eq!(tx_header.tx_id, 0);
3058 match tx_header.ordinal {
3059 _ => Err(fidl::Error::UnknownOrdinal {
3060 ordinal: tx_header.ordinal,
3061 protocol_name:
3062 <BrowseControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3063 }),
3064 }
3065 }
3066}
3067
3068pub struct BrowseControllerRequestStream {
3070 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3071 is_terminated: bool,
3072}
3073
3074impl std::marker::Unpin for BrowseControllerRequestStream {}
3075
3076impl futures::stream::FusedStream for BrowseControllerRequestStream {
3077 fn is_terminated(&self) -> bool {
3078 self.is_terminated
3079 }
3080}
3081
3082impl fidl::endpoints::RequestStream for BrowseControllerRequestStream {
3083 type Protocol = BrowseControllerMarker;
3084 type ControlHandle = BrowseControllerControlHandle;
3085
3086 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3087 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3088 }
3089
3090 fn control_handle(&self) -> Self::ControlHandle {
3091 BrowseControllerControlHandle { inner: self.inner.clone() }
3092 }
3093
3094 fn into_inner(
3095 self,
3096 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3097 {
3098 (self.inner, self.is_terminated)
3099 }
3100
3101 fn from_inner(
3102 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3103 is_terminated: bool,
3104 ) -> Self {
3105 Self { inner, is_terminated }
3106 }
3107}
3108
3109impl futures::Stream for BrowseControllerRequestStream {
3110 type Item = Result<BrowseControllerRequest, fidl::Error>;
3111
3112 fn poll_next(
3113 mut self: std::pin::Pin<&mut Self>,
3114 cx: &mut std::task::Context<'_>,
3115 ) -> std::task::Poll<Option<Self::Item>> {
3116 let this = &mut *self;
3117 if this.inner.check_shutdown(cx) {
3118 this.is_terminated = true;
3119 return std::task::Poll::Ready(None);
3120 }
3121 if this.is_terminated {
3122 panic!("polled BrowseControllerRequestStream after completion");
3123 }
3124 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3125 |bytes, handles| {
3126 match this.inner.channel().read_etc(cx, bytes, handles) {
3127 std::task::Poll::Ready(Ok(())) => {}
3128 std::task::Poll::Pending => return std::task::Poll::Pending,
3129 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3130 this.is_terminated = true;
3131 return std::task::Poll::Ready(None);
3132 }
3133 std::task::Poll::Ready(Err(e)) => {
3134 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3135 e.into(),
3136 ))))
3137 }
3138 }
3139
3140 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3142
3143 std::task::Poll::Ready(Some(match header.ordinal {
3144 0x49c06d30a9aa02ba => {
3145 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3146 let mut req = fidl::new_empty!(
3147 BrowseControllerGetMediaPlayerItemsRequest,
3148 fidl::encoding::DefaultFuchsiaResourceDialect
3149 );
3150 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerGetMediaPlayerItemsRequest>(&header, _body_bytes, handles, &mut req)?;
3151 let control_handle =
3152 BrowseControllerControlHandle { inner: this.inner.clone() };
3153 Ok(BrowseControllerRequest::GetMediaPlayerItems {
3154 start_index: req.start_index,
3155 end_index: req.end_index,
3156
3157 responder: BrowseControllerGetMediaPlayerItemsResponder {
3158 control_handle: std::mem::ManuallyDrop::new(control_handle),
3159 tx_id: header.tx_id,
3160 },
3161 })
3162 }
3163 0x35f5a88695b46cf7 => {
3164 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3165 let mut req = fidl::new_empty!(
3166 BrowseControllerGetNowPlayingItemsRequest,
3167 fidl::encoding::DefaultFuchsiaResourceDialect
3168 );
3169 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerGetNowPlayingItemsRequest>(&header, _body_bytes, handles, &mut req)?;
3170 let control_handle =
3171 BrowseControllerControlHandle { inner: this.inner.clone() };
3172 Ok(BrowseControllerRequest::GetNowPlayingItems {
3173 start_index: req.start_index,
3174 end_index: req.end_index,
3175 attribute_option: req.attribute_option,
3176
3177 responder: BrowseControllerGetNowPlayingItemsResponder {
3178 control_handle: std::mem::ManuallyDrop::new(control_handle),
3179 tx_id: header.tx_id,
3180 },
3181 })
3182 }
3183 0x5d1415aecee72133 => {
3184 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3185 let mut req = fidl::new_empty!(
3186 BrowseControllerGetFileSystemItemsRequest,
3187 fidl::encoding::DefaultFuchsiaResourceDialect
3188 );
3189 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerGetFileSystemItemsRequest>(&header, _body_bytes, handles, &mut req)?;
3190 let control_handle =
3191 BrowseControllerControlHandle { inner: this.inner.clone() };
3192 Ok(BrowseControllerRequest::GetFileSystemItems {
3193 start_index: req.start_index,
3194 end_index: req.end_index,
3195 attribute_option: req.attribute_option,
3196
3197 responder: BrowseControllerGetFileSystemItemsResponder {
3198 control_handle: std::mem::ManuallyDrop::new(control_handle),
3199 tx_id: header.tx_id,
3200 },
3201 })
3202 }
3203 0x2e0600579d43b51e => {
3204 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3205 let mut req = fidl::new_empty!(
3206 BrowseControllerChangePathRequest,
3207 fidl::encoding::DefaultFuchsiaResourceDialect
3208 );
3209 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerChangePathRequest>(&header, _body_bytes, handles, &mut req)?;
3210 let control_handle =
3211 BrowseControllerControlHandle { inner: this.inner.clone() };
3212 Ok(BrowseControllerRequest::ChangePath {
3213 path: req.path,
3214
3215 responder: BrowseControllerChangePathResponder {
3216 control_handle: std::mem::ManuallyDrop::new(control_handle),
3217 tx_id: header.tx_id,
3218 },
3219 })
3220 }
3221 0x57075115ce25cf16 => {
3222 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3223 let mut req = fidl::new_empty!(
3224 BrowseControllerPlayFileSystemItemRequest,
3225 fidl::encoding::DefaultFuchsiaResourceDialect
3226 );
3227 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerPlayFileSystemItemRequest>(&header, _body_bytes, handles, &mut req)?;
3228 let control_handle =
3229 BrowseControllerControlHandle { inner: this.inner.clone() };
3230 Ok(BrowseControllerRequest::PlayFileSystemItem {
3231 uid: req.uid,
3232
3233 responder: BrowseControllerPlayFileSystemItemResponder {
3234 control_handle: std::mem::ManuallyDrop::new(control_handle),
3235 tx_id: header.tx_id,
3236 },
3237 })
3238 }
3239 0x116e151d547fd2d7 => {
3240 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3241 let mut req = fidl::new_empty!(
3242 BrowseControllerPlayNowPlayingItemRequest,
3243 fidl::encoding::DefaultFuchsiaResourceDialect
3244 );
3245 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerPlayNowPlayingItemRequest>(&header, _body_bytes, handles, &mut req)?;
3246 let control_handle =
3247 BrowseControllerControlHandle { inner: this.inner.clone() };
3248 Ok(BrowseControllerRequest::PlayNowPlayingItem {
3249 uid: req.uid,
3250
3251 responder: BrowseControllerPlayNowPlayingItemResponder {
3252 control_handle: std::mem::ManuallyDrop::new(control_handle),
3253 tx_id: header.tx_id,
3254 },
3255 })
3256 }
3257 0x3e3256f57f8848da => {
3258 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3259 let mut req = fidl::new_empty!(
3260 BrowseControllerSetBrowsedPlayerRequest,
3261 fidl::encoding::DefaultFuchsiaResourceDialect
3262 );
3263 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerSetBrowsedPlayerRequest>(&header, _body_bytes, handles, &mut req)?;
3264 let control_handle =
3265 BrowseControllerControlHandle { inner: this.inner.clone() };
3266 Ok(BrowseControllerRequest::SetBrowsedPlayer {
3267 player_id: req.player_id,
3268
3269 responder: BrowseControllerSetBrowsedPlayerResponder {
3270 control_handle: std::mem::ManuallyDrop::new(control_handle),
3271 tx_id: header.tx_id,
3272 },
3273 })
3274 }
3275 _ => Err(fidl::Error::UnknownOrdinal {
3276 ordinal: header.ordinal,
3277 protocol_name:
3278 <BrowseControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3279 }),
3280 }))
3281 },
3282 )
3283 }
3284}
3285
3286#[derive(Debug)]
3294pub enum BrowseControllerRequest {
3295 GetMediaPlayerItems {
3298 start_index: u32,
3299 end_index: u32,
3300 responder: BrowseControllerGetMediaPlayerItemsResponder,
3301 },
3302 GetNowPlayingItems {
3307 start_index: u32,
3308 end_index: u32,
3309 attribute_option: AttributeRequestOption,
3310 responder: BrowseControllerGetNowPlayingItemsResponder,
3311 },
3312 GetFileSystemItems {
3316 start_index: u32,
3317 end_index: u32,
3318 attribute_option: AttributeRequestOption,
3319 responder: BrowseControllerGetFileSystemItemsResponder,
3320 },
3321 ChangePath { path: Path, responder: BrowseControllerChangePathResponder },
3326 PlayFileSystemItem { uid: u64, responder: BrowseControllerPlayFileSystemItemResponder },
3328 PlayNowPlayingItem { uid: u64, responder: BrowseControllerPlayNowPlayingItemResponder },
3331 SetBrowsedPlayer { player_id: u16, responder: BrowseControllerSetBrowsedPlayerResponder },
3333}
3334
3335impl BrowseControllerRequest {
3336 #[allow(irrefutable_let_patterns)]
3337 pub fn into_get_media_player_items(
3338 self,
3339 ) -> Option<(u32, u32, BrowseControllerGetMediaPlayerItemsResponder)> {
3340 if let BrowseControllerRequest::GetMediaPlayerItems { start_index, end_index, responder } =
3341 self
3342 {
3343 Some((start_index, end_index, responder))
3344 } else {
3345 None
3346 }
3347 }
3348
3349 #[allow(irrefutable_let_patterns)]
3350 pub fn into_get_now_playing_items(
3351 self,
3352 ) -> Option<(u32, u32, AttributeRequestOption, BrowseControllerGetNowPlayingItemsResponder)>
3353 {
3354 if let BrowseControllerRequest::GetNowPlayingItems {
3355 start_index,
3356 end_index,
3357 attribute_option,
3358 responder,
3359 } = self
3360 {
3361 Some((start_index, end_index, attribute_option, responder))
3362 } else {
3363 None
3364 }
3365 }
3366
3367 #[allow(irrefutable_let_patterns)]
3368 pub fn into_get_file_system_items(
3369 self,
3370 ) -> Option<(u32, u32, AttributeRequestOption, BrowseControllerGetFileSystemItemsResponder)>
3371 {
3372 if let BrowseControllerRequest::GetFileSystemItems {
3373 start_index,
3374 end_index,
3375 attribute_option,
3376 responder,
3377 } = self
3378 {
3379 Some((start_index, end_index, attribute_option, responder))
3380 } else {
3381 None
3382 }
3383 }
3384
3385 #[allow(irrefutable_let_patterns)]
3386 pub fn into_change_path(self) -> Option<(Path, BrowseControllerChangePathResponder)> {
3387 if let BrowseControllerRequest::ChangePath { path, responder } = self {
3388 Some((path, responder))
3389 } else {
3390 None
3391 }
3392 }
3393
3394 #[allow(irrefutable_let_patterns)]
3395 pub fn into_play_file_system_item(
3396 self,
3397 ) -> Option<(u64, BrowseControllerPlayFileSystemItemResponder)> {
3398 if let BrowseControllerRequest::PlayFileSystemItem { uid, responder } = self {
3399 Some((uid, responder))
3400 } else {
3401 None
3402 }
3403 }
3404
3405 #[allow(irrefutable_let_patterns)]
3406 pub fn into_play_now_playing_item(
3407 self,
3408 ) -> Option<(u64, BrowseControllerPlayNowPlayingItemResponder)> {
3409 if let BrowseControllerRequest::PlayNowPlayingItem { uid, responder } = self {
3410 Some((uid, responder))
3411 } else {
3412 None
3413 }
3414 }
3415
3416 #[allow(irrefutable_let_patterns)]
3417 pub fn into_set_browsed_player(
3418 self,
3419 ) -> Option<(u16, BrowseControllerSetBrowsedPlayerResponder)> {
3420 if let BrowseControllerRequest::SetBrowsedPlayer { player_id, responder } = self {
3421 Some((player_id, responder))
3422 } else {
3423 None
3424 }
3425 }
3426
3427 pub fn method_name(&self) -> &'static str {
3429 match *self {
3430 BrowseControllerRequest::GetMediaPlayerItems { .. } => "get_media_player_items",
3431 BrowseControllerRequest::GetNowPlayingItems { .. } => "get_now_playing_items",
3432 BrowseControllerRequest::GetFileSystemItems { .. } => "get_file_system_items",
3433 BrowseControllerRequest::ChangePath { .. } => "change_path",
3434 BrowseControllerRequest::PlayFileSystemItem { .. } => "play_file_system_item",
3435 BrowseControllerRequest::PlayNowPlayingItem { .. } => "play_now_playing_item",
3436 BrowseControllerRequest::SetBrowsedPlayer { .. } => "set_browsed_player",
3437 }
3438 }
3439}
3440
3441#[derive(Debug, Clone)]
3442pub struct BrowseControllerControlHandle {
3443 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3444}
3445
3446impl fidl::endpoints::ControlHandle for BrowseControllerControlHandle {
3447 fn shutdown(&self) {
3448 self.inner.shutdown()
3449 }
3450 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
3451 self.inner.shutdown_with_epitaph(status)
3452 }
3453
3454 fn is_closed(&self) -> bool {
3455 self.inner.channel().is_closed()
3456 }
3457 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
3458 self.inner.channel().on_closed()
3459 }
3460
3461 #[cfg(target_os = "fuchsia")]
3462 fn signal_peer(
3463 &self,
3464 clear_mask: zx::Signals,
3465 set_mask: zx::Signals,
3466 ) -> Result<(), zx_status::Status> {
3467 use fidl::Peered;
3468 self.inner.channel().signal_peer(clear_mask, set_mask)
3469 }
3470}
3471
3472impl BrowseControllerControlHandle {}
3473
3474#[must_use = "FIDL methods require a response to be sent"]
3475#[derive(Debug)]
3476pub struct BrowseControllerGetMediaPlayerItemsResponder {
3477 control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
3478 tx_id: u32,
3479}
3480
3481impl std::ops::Drop for BrowseControllerGetMediaPlayerItemsResponder {
3485 fn drop(&mut self) {
3486 self.control_handle.shutdown();
3487 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3489 }
3490}
3491
3492impl fidl::endpoints::Responder for BrowseControllerGetMediaPlayerItemsResponder {
3493 type ControlHandle = BrowseControllerControlHandle;
3494
3495 fn control_handle(&self) -> &BrowseControllerControlHandle {
3496 &self.control_handle
3497 }
3498
3499 fn drop_without_shutdown(mut self) {
3500 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3502 std::mem::forget(self);
3504 }
3505}
3506
3507impl BrowseControllerGetMediaPlayerItemsResponder {
3508 pub fn send(
3512 self,
3513 mut result: Result<&[MediaPlayerItem], BrowseControllerError>,
3514 ) -> Result<(), fidl::Error> {
3515 let _result = self.send_raw(result);
3516 if _result.is_err() {
3517 self.control_handle.shutdown();
3518 }
3519 self.drop_without_shutdown();
3520 _result
3521 }
3522
3523 pub fn send_no_shutdown_on_err(
3525 self,
3526 mut result: Result<&[MediaPlayerItem], BrowseControllerError>,
3527 ) -> Result<(), fidl::Error> {
3528 let _result = self.send_raw(result);
3529 self.drop_without_shutdown();
3530 _result
3531 }
3532
3533 fn send_raw(
3534 &self,
3535 mut result: Result<&[MediaPlayerItem], BrowseControllerError>,
3536 ) -> Result<(), fidl::Error> {
3537 self.control_handle.inner.send::<fidl::encoding::ResultType<
3538 BrowseControllerGetMediaPlayerItemsResponse,
3539 BrowseControllerError,
3540 >>(
3541 result.map(|items| (items,)),
3542 self.tx_id,
3543 0x49c06d30a9aa02ba,
3544 fidl::encoding::DynamicFlags::empty(),
3545 )
3546 }
3547}
3548
3549#[must_use = "FIDL methods require a response to be sent"]
3550#[derive(Debug)]
3551pub struct BrowseControllerGetNowPlayingItemsResponder {
3552 control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
3553 tx_id: u32,
3554}
3555
3556impl std::ops::Drop for BrowseControllerGetNowPlayingItemsResponder {
3560 fn drop(&mut self) {
3561 self.control_handle.shutdown();
3562 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3564 }
3565}
3566
3567impl fidl::endpoints::Responder for BrowseControllerGetNowPlayingItemsResponder {
3568 type ControlHandle = BrowseControllerControlHandle;
3569
3570 fn control_handle(&self) -> &BrowseControllerControlHandle {
3571 &self.control_handle
3572 }
3573
3574 fn drop_without_shutdown(mut self) {
3575 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3577 std::mem::forget(self);
3579 }
3580}
3581
3582impl BrowseControllerGetNowPlayingItemsResponder {
3583 pub fn send(
3587 self,
3588 mut result: Result<&[MediaElementItem], BrowseControllerError>,
3589 ) -> Result<(), fidl::Error> {
3590 let _result = self.send_raw(result);
3591 if _result.is_err() {
3592 self.control_handle.shutdown();
3593 }
3594 self.drop_without_shutdown();
3595 _result
3596 }
3597
3598 pub fn send_no_shutdown_on_err(
3600 self,
3601 mut result: Result<&[MediaElementItem], BrowseControllerError>,
3602 ) -> Result<(), fidl::Error> {
3603 let _result = self.send_raw(result);
3604 self.drop_without_shutdown();
3605 _result
3606 }
3607
3608 fn send_raw(
3609 &self,
3610 mut result: Result<&[MediaElementItem], BrowseControllerError>,
3611 ) -> Result<(), fidl::Error> {
3612 self.control_handle.inner.send::<fidl::encoding::ResultType<
3613 BrowseControllerGetNowPlayingItemsResponse,
3614 BrowseControllerError,
3615 >>(
3616 result.map(|items| (items,)),
3617 self.tx_id,
3618 0x35f5a88695b46cf7,
3619 fidl::encoding::DynamicFlags::empty(),
3620 )
3621 }
3622}
3623
3624#[must_use = "FIDL methods require a response to be sent"]
3625#[derive(Debug)]
3626pub struct BrowseControllerGetFileSystemItemsResponder {
3627 control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
3628 tx_id: u32,
3629}
3630
3631impl std::ops::Drop for BrowseControllerGetFileSystemItemsResponder {
3635 fn drop(&mut self) {
3636 self.control_handle.shutdown();
3637 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3639 }
3640}
3641
3642impl fidl::endpoints::Responder for BrowseControllerGetFileSystemItemsResponder {
3643 type ControlHandle = BrowseControllerControlHandle;
3644
3645 fn control_handle(&self) -> &BrowseControllerControlHandle {
3646 &self.control_handle
3647 }
3648
3649 fn drop_without_shutdown(mut self) {
3650 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3652 std::mem::forget(self);
3654 }
3655}
3656
3657impl BrowseControllerGetFileSystemItemsResponder {
3658 pub fn send(
3662 self,
3663 mut result: Result<&[FileSystemItem], BrowseControllerError>,
3664 ) -> Result<(), fidl::Error> {
3665 let _result = self.send_raw(result);
3666 if _result.is_err() {
3667 self.control_handle.shutdown();
3668 }
3669 self.drop_without_shutdown();
3670 _result
3671 }
3672
3673 pub fn send_no_shutdown_on_err(
3675 self,
3676 mut result: Result<&[FileSystemItem], BrowseControllerError>,
3677 ) -> Result<(), fidl::Error> {
3678 let _result = self.send_raw(result);
3679 self.drop_without_shutdown();
3680 _result
3681 }
3682
3683 fn send_raw(
3684 &self,
3685 mut result: Result<&[FileSystemItem], BrowseControllerError>,
3686 ) -> Result<(), fidl::Error> {
3687 self.control_handle.inner.send::<fidl::encoding::ResultType<
3688 BrowseControllerGetFileSystemItemsResponse,
3689 BrowseControllerError,
3690 >>(
3691 result.map(|items| (items,)),
3692 self.tx_id,
3693 0x5d1415aecee72133,
3694 fidl::encoding::DynamicFlags::empty(),
3695 )
3696 }
3697}
3698
3699#[must_use = "FIDL methods require a response to be sent"]
3700#[derive(Debug)]
3701pub struct BrowseControllerChangePathResponder {
3702 control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
3703 tx_id: u32,
3704}
3705
3706impl std::ops::Drop for BrowseControllerChangePathResponder {
3710 fn drop(&mut self) {
3711 self.control_handle.shutdown();
3712 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3714 }
3715}
3716
3717impl fidl::endpoints::Responder for BrowseControllerChangePathResponder {
3718 type ControlHandle = BrowseControllerControlHandle;
3719
3720 fn control_handle(&self) -> &BrowseControllerControlHandle {
3721 &self.control_handle
3722 }
3723
3724 fn drop_without_shutdown(mut self) {
3725 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3727 std::mem::forget(self);
3729 }
3730}
3731
3732impl BrowseControllerChangePathResponder {
3733 pub fn send(self, mut result: Result<u32, BrowseControllerError>) -> Result<(), fidl::Error> {
3737 let _result = self.send_raw(result);
3738 if _result.is_err() {
3739 self.control_handle.shutdown();
3740 }
3741 self.drop_without_shutdown();
3742 _result
3743 }
3744
3745 pub fn send_no_shutdown_on_err(
3747 self,
3748 mut result: Result<u32, BrowseControllerError>,
3749 ) -> Result<(), fidl::Error> {
3750 let _result = self.send_raw(result);
3751 self.drop_without_shutdown();
3752 _result
3753 }
3754
3755 fn send_raw(&self, mut result: Result<u32, BrowseControllerError>) -> Result<(), fidl::Error> {
3756 self.control_handle.inner.send::<fidl::encoding::ResultType<
3757 BrowseControllerChangePathResponse,
3758 BrowseControllerError,
3759 >>(
3760 result.map(|num_items| (num_items,)),
3761 self.tx_id,
3762 0x2e0600579d43b51e,
3763 fidl::encoding::DynamicFlags::empty(),
3764 )
3765 }
3766}
3767
3768#[must_use = "FIDL methods require a response to be sent"]
3769#[derive(Debug)]
3770pub struct BrowseControllerPlayFileSystemItemResponder {
3771 control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
3772 tx_id: u32,
3773}
3774
3775impl std::ops::Drop for BrowseControllerPlayFileSystemItemResponder {
3779 fn drop(&mut self) {
3780 self.control_handle.shutdown();
3781 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3783 }
3784}
3785
3786impl fidl::endpoints::Responder for BrowseControllerPlayFileSystemItemResponder {
3787 type ControlHandle = BrowseControllerControlHandle;
3788
3789 fn control_handle(&self) -> &BrowseControllerControlHandle {
3790 &self.control_handle
3791 }
3792
3793 fn drop_without_shutdown(mut self) {
3794 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3796 std::mem::forget(self);
3798 }
3799}
3800
3801impl BrowseControllerPlayFileSystemItemResponder {
3802 pub fn send(self, mut result: Result<(), BrowseControllerError>) -> Result<(), fidl::Error> {
3806 let _result = self.send_raw(result);
3807 if _result.is_err() {
3808 self.control_handle.shutdown();
3809 }
3810 self.drop_without_shutdown();
3811 _result
3812 }
3813
3814 pub fn send_no_shutdown_on_err(
3816 self,
3817 mut result: Result<(), BrowseControllerError>,
3818 ) -> Result<(), fidl::Error> {
3819 let _result = self.send_raw(result);
3820 self.drop_without_shutdown();
3821 _result
3822 }
3823
3824 fn send_raw(&self, mut result: Result<(), BrowseControllerError>) -> Result<(), fidl::Error> {
3825 self.control_handle.inner.send::<fidl::encoding::ResultType<
3826 fidl::encoding::EmptyStruct,
3827 BrowseControllerError,
3828 >>(
3829 result,
3830 self.tx_id,
3831 0x57075115ce25cf16,
3832 fidl::encoding::DynamicFlags::empty(),
3833 )
3834 }
3835}
3836
3837#[must_use = "FIDL methods require a response to be sent"]
3838#[derive(Debug)]
3839pub struct BrowseControllerPlayNowPlayingItemResponder {
3840 control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
3841 tx_id: u32,
3842}
3843
3844impl std::ops::Drop for BrowseControllerPlayNowPlayingItemResponder {
3848 fn drop(&mut self) {
3849 self.control_handle.shutdown();
3850 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3852 }
3853}
3854
3855impl fidl::endpoints::Responder for BrowseControllerPlayNowPlayingItemResponder {
3856 type ControlHandle = BrowseControllerControlHandle;
3857
3858 fn control_handle(&self) -> &BrowseControllerControlHandle {
3859 &self.control_handle
3860 }
3861
3862 fn drop_without_shutdown(mut self) {
3863 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3865 std::mem::forget(self);
3867 }
3868}
3869
3870impl BrowseControllerPlayNowPlayingItemResponder {
3871 pub fn send(self, mut result: Result<(), BrowseControllerError>) -> Result<(), fidl::Error> {
3875 let _result = self.send_raw(result);
3876 if _result.is_err() {
3877 self.control_handle.shutdown();
3878 }
3879 self.drop_without_shutdown();
3880 _result
3881 }
3882
3883 pub fn send_no_shutdown_on_err(
3885 self,
3886 mut result: Result<(), BrowseControllerError>,
3887 ) -> Result<(), fidl::Error> {
3888 let _result = self.send_raw(result);
3889 self.drop_without_shutdown();
3890 _result
3891 }
3892
3893 fn send_raw(&self, mut result: Result<(), BrowseControllerError>) -> Result<(), fidl::Error> {
3894 self.control_handle.inner.send::<fidl::encoding::ResultType<
3895 fidl::encoding::EmptyStruct,
3896 BrowseControllerError,
3897 >>(
3898 result,
3899 self.tx_id,
3900 0x116e151d547fd2d7,
3901 fidl::encoding::DynamicFlags::empty(),
3902 )
3903 }
3904}
3905
3906#[must_use = "FIDL methods require a response to be sent"]
3907#[derive(Debug)]
3908pub struct BrowseControllerSetBrowsedPlayerResponder {
3909 control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
3910 tx_id: u32,
3911}
3912
3913impl std::ops::Drop for BrowseControllerSetBrowsedPlayerResponder {
3917 fn drop(&mut self) {
3918 self.control_handle.shutdown();
3919 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3921 }
3922}
3923
3924impl fidl::endpoints::Responder for BrowseControllerSetBrowsedPlayerResponder {
3925 type ControlHandle = BrowseControllerControlHandle;
3926
3927 fn control_handle(&self) -> &BrowseControllerControlHandle {
3928 &self.control_handle
3929 }
3930
3931 fn drop_without_shutdown(mut self) {
3932 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
3934 std::mem::forget(self);
3936 }
3937}
3938
3939impl BrowseControllerSetBrowsedPlayerResponder {
3940 pub fn send(self, mut result: Result<(), BrowseControllerError>) -> Result<(), fidl::Error> {
3944 let _result = self.send_raw(result);
3945 if _result.is_err() {
3946 self.control_handle.shutdown();
3947 }
3948 self.drop_without_shutdown();
3949 _result
3950 }
3951
3952 pub fn send_no_shutdown_on_err(
3954 self,
3955 mut result: Result<(), BrowseControllerError>,
3956 ) -> Result<(), fidl::Error> {
3957 let _result = self.send_raw(result);
3958 self.drop_without_shutdown();
3959 _result
3960 }
3961
3962 fn send_raw(&self, mut result: Result<(), BrowseControllerError>) -> Result<(), fidl::Error> {
3963 self.control_handle.inner.send::<fidl::encoding::ResultType<
3964 fidl::encoding::EmptyStruct,
3965 BrowseControllerError,
3966 >>(
3967 result,
3968 self.tx_id,
3969 0x3e3256f57f8848da,
3970 fidl::encoding::DynamicFlags::empty(),
3971 )
3972 }
3973}
3974
3975#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
3976pub struct ControllerMarker;
3977
3978impl fidl::endpoints::ProtocolMarker for ControllerMarker {
3979 type Proxy = ControllerProxy;
3980 type RequestStream = ControllerRequestStream;
3981 #[cfg(target_os = "fuchsia")]
3982 type SynchronousProxy = ControllerSynchronousProxy;
3983
3984 const DEBUG_NAME: &'static str = "(anonymous) Controller";
3985}
3986pub type ControllerGetPlayerApplicationSettingsResult =
3987 Result<PlayerApplicationSettings, ControllerError>;
3988pub type ControllerSetPlayerApplicationSettingsResult =
3989 Result<PlayerApplicationSettings, ControllerError>;
3990pub type ControllerGetMediaAttributesResult = Result<MediaAttributes, ControllerError>;
3991pub type ControllerGetPlayStatusResult = Result<PlayStatus, ControllerError>;
3992pub type ControllerSetAbsoluteVolumeResult = Result<u8, ControllerError>;
3993pub type ControllerInformBatteryStatusResult = Result<(), ControllerError>;
3994pub type ControllerSetAddressedPlayerResult = Result<(), ControllerError>;
3995pub type ControllerSendCommandResult = Result<(), ControllerError>;
3996
3997pub trait ControllerProxyInterface: Send + Sync {
3998 type GetPlayerApplicationSettingsResponseFut: std::future::Future<
3999 Output = Result<ControllerGetPlayerApplicationSettingsResult, fidl::Error>,
4000 > + Send;
4001 fn r#get_player_application_settings(
4002 &self,
4003 attribute_ids: &[PlayerApplicationSettingAttributeId],
4004 ) -> Self::GetPlayerApplicationSettingsResponseFut;
4005 type SetPlayerApplicationSettingsResponseFut: std::future::Future<
4006 Output = Result<ControllerSetPlayerApplicationSettingsResult, fidl::Error>,
4007 > + Send;
4008 fn r#set_player_application_settings(
4009 &self,
4010 requested_settings: &PlayerApplicationSettings,
4011 ) -> Self::SetPlayerApplicationSettingsResponseFut;
4012 type GetMediaAttributesResponseFut: std::future::Future<Output = Result<ControllerGetMediaAttributesResult, fidl::Error>>
4013 + Send;
4014 fn r#get_media_attributes(&self) -> Self::GetMediaAttributesResponseFut;
4015 type GetPlayStatusResponseFut: std::future::Future<Output = Result<ControllerGetPlayStatusResult, fidl::Error>>
4016 + Send;
4017 fn r#get_play_status(&self) -> Self::GetPlayStatusResponseFut;
4018 type SetAbsoluteVolumeResponseFut: std::future::Future<Output = Result<ControllerSetAbsoluteVolumeResult, fidl::Error>>
4019 + Send;
4020 fn r#set_absolute_volume(&self, requested_volume: u8) -> Self::SetAbsoluteVolumeResponseFut;
4021 type InformBatteryStatusResponseFut: std::future::Future<Output = Result<ControllerInformBatteryStatusResult, fidl::Error>>
4022 + Send;
4023 fn r#inform_battery_status(
4024 &self,
4025 battery_status: BatteryStatus,
4026 ) -> Self::InformBatteryStatusResponseFut;
4027 fn r#set_notification_filter(
4028 &self,
4029 notifications: Notifications,
4030 position_change_interval: u32,
4031 ) -> Result<(), fidl::Error>;
4032 fn r#notify_notification_handled(&self) -> Result<(), fidl::Error>;
4033 type SetAddressedPlayerResponseFut: std::future::Future<Output = Result<ControllerSetAddressedPlayerResult, fidl::Error>>
4034 + Send;
4035 fn r#set_addressed_player(&self, player_id: u16) -> Self::SetAddressedPlayerResponseFut;
4036 type SendCommandResponseFut: std::future::Future<Output = Result<ControllerSendCommandResult, fidl::Error>>
4037 + Send;
4038 fn r#send_command(&self, command: AvcPanelCommand) -> Self::SendCommandResponseFut;
4039}
4040#[derive(Debug)]
4041#[cfg(target_os = "fuchsia")]
4042pub struct ControllerSynchronousProxy {
4043 client: fidl::client::sync::Client,
4044}
4045
4046#[cfg(target_os = "fuchsia")]
4047impl fidl::endpoints::SynchronousProxy for ControllerSynchronousProxy {
4048 type Proxy = ControllerProxy;
4049 type Protocol = ControllerMarker;
4050
4051 fn from_channel(inner: fidl::Channel) -> Self {
4052 Self::new(inner)
4053 }
4054
4055 fn into_channel(self) -> fidl::Channel {
4056 self.client.into_channel()
4057 }
4058
4059 fn as_channel(&self) -> &fidl::Channel {
4060 self.client.as_channel()
4061 }
4062}
4063
4064#[cfg(target_os = "fuchsia")]
4065impl ControllerSynchronousProxy {
4066 pub fn new(channel: fidl::Channel) -> Self {
4067 let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4068 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
4069 }
4070
4071 pub fn into_channel(self) -> fidl::Channel {
4072 self.client.into_channel()
4073 }
4074
4075 pub fn wait_for_event(
4078 &self,
4079 deadline: zx::MonotonicInstant,
4080 ) -> Result<ControllerEvent, fidl::Error> {
4081 ControllerEvent::decode(self.client.wait_for_event(deadline)?)
4082 }
4083
4084 pub fn r#get_player_application_settings(
4088 &self,
4089 mut attribute_ids: &[PlayerApplicationSettingAttributeId],
4090 ___deadline: zx::MonotonicInstant,
4091 ) -> Result<ControllerGetPlayerApplicationSettingsResult, fidl::Error> {
4092 let _response = self
4093 .client
4094 .send_query::<ControllerGetPlayerApplicationSettingsRequest, fidl::encoding::ResultType<
4095 ControllerGetPlayerApplicationSettingsResponse,
4096 ControllerError,
4097 >>(
4098 (attribute_ids,),
4099 0x681de2da50670120,
4100 fidl::encoding::DynamicFlags::empty(),
4101 ___deadline,
4102 )?;
4103 Ok(_response.map(|x| x.current_settings))
4104 }
4105
4106 pub fn r#set_player_application_settings(
4113 &self,
4114 mut requested_settings: &PlayerApplicationSettings,
4115 ___deadline: zx::MonotonicInstant,
4116 ) -> Result<ControllerSetPlayerApplicationSettingsResult, fidl::Error> {
4117 let _response = self
4118 .client
4119 .send_query::<ControllerSetPlayerApplicationSettingsRequest, fidl::encoding::ResultType<
4120 ControllerSetPlayerApplicationSettingsResponse,
4121 ControllerError,
4122 >>(
4123 (requested_settings,),
4124 0x6a7c9689ea3a589a,
4125 fidl::encoding::DynamicFlags::empty(),
4126 ___deadline,
4127 )?;
4128 Ok(_response.map(|x| x.set_settings))
4129 }
4130
4131 pub fn r#get_media_attributes(
4135 &self,
4136 ___deadline: zx::MonotonicInstant,
4137 ) -> Result<ControllerGetMediaAttributesResult, fidl::Error> {
4138 let _response =
4139 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
4140 ControllerGetMediaAttributesResponse,
4141 ControllerError,
4142 >>(
4143 (),
4144 0x18bd14308ee3173d,
4145 fidl::encoding::DynamicFlags::empty(),
4146 ___deadline,
4147 )?;
4148 Ok(_response.map(|x| x.attributes))
4149 }
4150
4151 pub fn r#get_play_status(
4153 &self,
4154 ___deadline: zx::MonotonicInstant,
4155 ) -> Result<ControllerGetPlayStatusResult, fidl::Error> {
4156 let _response =
4157 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
4158 ControllerGetPlayStatusResponse,
4159 ControllerError,
4160 >>(
4161 (),
4162 0x120735bec709fc6d,
4163 fidl::encoding::DynamicFlags::empty(),
4164 ___deadline,
4165 )?;
4166 Ok(_response.map(|x| x.play_status))
4167 }
4168
4169 pub fn r#set_absolute_volume(
4173 &self,
4174 mut requested_volume: u8,
4175 ___deadline: zx::MonotonicInstant,
4176 ) -> Result<ControllerSetAbsoluteVolumeResult, fidl::Error> {
4177 let _response = self.client.send_query::<
4178 ControllerSetAbsoluteVolumeRequest,
4179 fidl::encoding::ResultType<ControllerSetAbsoluteVolumeResponse, ControllerError>,
4180 >(
4181 (requested_volume,),
4182 0x1b8d010e11d05957,
4183 fidl::encoding::DynamicFlags::empty(),
4184 ___deadline,
4185 )?;
4186 Ok(_response.map(|x| x.set_volume))
4187 }
4188
4189 pub fn r#inform_battery_status(
4191 &self,
4192 mut battery_status: BatteryStatus,
4193 ___deadline: zx::MonotonicInstant,
4194 ) -> Result<ControllerInformBatteryStatusResult, fidl::Error> {
4195 let _response = self.client.send_query::<
4196 ControllerInformBatteryStatusRequest,
4197 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControllerError>,
4198 >(
4199 (battery_status,),
4200 0x11d54fbe9d12c44d,
4201 fidl::encoding::DynamicFlags::empty(),
4202 ___deadline,
4203 )?;
4204 Ok(_response.map(|x| x))
4205 }
4206
4207 pub fn r#set_notification_filter(
4217 &self,
4218 mut notifications: Notifications,
4219 mut position_change_interval: u32,
4220 ) -> Result<(), fidl::Error> {
4221 self.client.send::<ControllerSetNotificationFilterRequest>(
4222 (notifications, position_change_interval),
4223 0x4d8a327745ccd73b,
4224 fidl::encoding::DynamicFlags::empty(),
4225 )
4226 }
4227
4228 pub fn r#notify_notification_handled(&self) -> Result<(), fidl::Error> {
4230 self.client.send::<fidl::encoding::EmptyPayload>(
4231 (),
4232 0x43d3e556557f3bc2,
4233 fidl::encoding::DynamicFlags::empty(),
4234 )
4235 }
4236
4237 pub fn r#set_addressed_player(
4239 &self,
4240 mut player_id: u16,
4241 ___deadline: zx::MonotonicInstant,
4242 ) -> Result<ControllerSetAddressedPlayerResult, fidl::Error> {
4243 let _response = self.client.send_query::<
4244 ControllerSetAddressedPlayerRequest,
4245 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControllerError>,
4246 >(
4247 (player_id,),
4248 0x7ffc261f10ee1da5,
4249 fidl::encoding::DynamicFlags::empty(),
4250 ___deadline,
4251 )?;
4252 Ok(_response.map(|x| x))
4253 }
4254
4255 pub fn r#send_command(
4257 &self,
4258 mut command: AvcPanelCommand,
4259 ___deadline: zx::MonotonicInstant,
4260 ) -> Result<ControllerSendCommandResult, fidl::Error> {
4261 let _response = self.client.send_query::<
4262 ControllerSendCommandRequest,
4263 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControllerError>,
4264 >(
4265 (command,),
4266 0x241324c56b5bc257,
4267 fidl::encoding::DynamicFlags::empty(),
4268 ___deadline,
4269 )?;
4270 Ok(_response.map(|x| x))
4271 }
4272}
4273
4274#[derive(Debug, Clone)]
4275pub struct ControllerProxy {
4276 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
4277}
4278
4279impl fidl::endpoints::Proxy for ControllerProxy {
4280 type Protocol = ControllerMarker;
4281
4282 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
4283 Self::new(inner)
4284 }
4285
4286 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
4287 self.client.into_channel().map_err(|client| Self { client })
4288 }
4289
4290 fn as_channel(&self) -> &::fidl::AsyncChannel {
4291 self.client.as_channel()
4292 }
4293}
4294
4295impl ControllerProxy {
4296 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
4298 let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
4299 Self { client: fidl::client::Client::new(channel, protocol_name) }
4300 }
4301
4302 pub fn take_event_stream(&self) -> ControllerEventStream {
4308 ControllerEventStream { event_receiver: self.client.take_event_receiver() }
4309 }
4310
4311 pub fn r#get_player_application_settings(
4315 &self,
4316 mut attribute_ids: &[PlayerApplicationSettingAttributeId],
4317 ) -> fidl::client::QueryResponseFut<
4318 ControllerGetPlayerApplicationSettingsResult,
4319 fidl::encoding::DefaultFuchsiaResourceDialect,
4320 > {
4321 ControllerProxyInterface::r#get_player_application_settings(self, attribute_ids)
4322 }
4323
4324 pub fn r#set_player_application_settings(
4331 &self,
4332 mut requested_settings: &PlayerApplicationSettings,
4333 ) -> fidl::client::QueryResponseFut<
4334 ControllerSetPlayerApplicationSettingsResult,
4335 fidl::encoding::DefaultFuchsiaResourceDialect,
4336 > {
4337 ControllerProxyInterface::r#set_player_application_settings(self, requested_settings)
4338 }
4339
4340 pub fn r#get_media_attributes(
4344 &self,
4345 ) -> fidl::client::QueryResponseFut<
4346 ControllerGetMediaAttributesResult,
4347 fidl::encoding::DefaultFuchsiaResourceDialect,
4348 > {
4349 ControllerProxyInterface::r#get_media_attributes(self)
4350 }
4351
4352 pub fn r#get_play_status(
4354 &self,
4355 ) -> fidl::client::QueryResponseFut<
4356 ControllerGetPlayStatusResult,
4357 fidl::encoding::DefaultFuchsiaResourceDialect,
4358 > {
4359 ControllerProxyInterface::r#get_play_status(self)
4360 }
4361
4362 pub fn r#set_absolute_volume(
4366 &self,
4367 mut requested_volume: u8,
4368 ) -> fidl::client::QueryResponseFut<
4369 ControllerSetAbsoluteVolumeResult,
4370 fidl::encoding::DefaultFuchsiaResourceDialect,
4371 > {
4372 ControllerProxyInterface::r#set_absolute_volume(self, requested_volume)
4373 }
4374
4375 pub fn r#inform_battery_status(
4377 &self,
4378 mut battery_status: BatteryStatus,
4379 ) -> fidl::client::QueryResponseFut<
4380 ControllerInformBatteryStatusResult,
4381 fidl::encoding::DefaultFuchsiaResourceDialect,
4382 > {
4383 ControllerProxyInterface::r#inform_battery_status(self, battery_status)
4384 }
4385
4386 pub fn r#set_notification_filter(
4396 &self,
4397 mut notifications: Notifications,
4398 mut position_change_interval: u32,
4399 ) -> Result<(), fidl::Error> {
4400 ControllerProxyInterface::r#set_notification_filter(
4401 self,
4402 notifications,
4403 position_change_interval,
4404 )
4405 }
4406
4407 pub fn r#notify_notification_handled(&self) -> Result<(), fidl::Error> {
4409 ControllerProxyInterface::r#notify_notification_handled(self)
4410 }
4411
4412 pub fn r#set_addressed_player(
4414 &self,
4415 mut player_id: u16,
4416 ) -> fidl::client::QueryResponseFut<
4417 ControllerSetAddressedPlayerResult,
4418 fidl::encoding::DefaultFuchsiaResourceDialect,
4419 > {
4420 ControllerProxyInterface::r#set_addressed_player(self, player_id)
4421 }
4422
4423 pub fn r#send_command(
4425 &self,
4426 mut command: AvcPanelCommand,
4427 ) -> fidl::client::QueryResponseFut<
4428 ControllerSendCommandResult,
4429 fidl::encoding::DefaultFuchsiaResourceDialect,
4430 > {
4431 ControllerProxyInterface::r#send_command(self, command)
4432 }
4433}
4434
4435impl ControllerProxyInterface for ControllerProxy {
4436 type GetPlayerApplicationSettingsResponseFut = fidl::client::QueryResponseFut<
4437 ControllerGetPlayerApplicationSettingsResult,
4438 fidl::encoding::DefaultFuchsiaResourceDialect,
4439 >;
4440 fn r#get_player_application_settings(
4441 &self,
4442 mut attribute_ids: &[PlayerApplicationSettingAttributeId],
4443 ) -> Self::GetPlayerApplicationSettingsResponseFut {
4444 fn _decode(
4445 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4446 ) -> Result<ControllerGetPlayerApplicationSettingsResult, fidl::Error> {
4447 let _response = fidl::client::decode_transaction_body::<
4448 fidl::encoding::ResultType<
4449 ControllerGetPlayerApplicationSettingsResponse,
4450 ControllerError,
4451 >,
4452 fidl::encoding::DefaultFuchsiaResourceDialect,
4453 0x681de2da50670120,
4454 >(_buf?)?;
4455 Ok(_response.map(|x| x.current_settings))
4456 }
4457 self.client.send_query_and_decode::<
4458 ControllerGetPlayerApplicationSettingsRequest,
4459 ControllerGetPlayerApplicationSettingsResult,
4460 >(
4461 (attribute_ids,),
4462 0x681de2da50670120,
4463 fidl::encoding::DynamicFlags::empty(),
4464 _decode,
4465 )
4466 }
4467
4468 type SetPlayerApplicationSettingsResponseFut = fidl::client::QueryResponseFut<
4469 ControllerSetPlayerApplicationSettingsResult,
4470 fidl::encoding::DefaultFuchsiaResourceDialect,
4471 >;
4472 fn r#set_player_application_settings(
4473 &self,
4474 mut requested_settings: &PlayerApplicationSettings,
4475 ) -> Self::SetPlayerApplicationSettingsResponseFut {
4476 fn _decode(
4477 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4478 ) -> Result<ControllerSetPlayerApplicationSettingsResult, fidl::Error> {
4479 let _response = fidl::client::decode_transaction_body::<
4480 fidl::encoding::ResultType<
4481 ControllerSetPlayerApplicationSettingsResponse,
4482 ControllerError,
4483 >,
4484 fidl::encoding::DefaultFuchsiaResourceDialect,
4485 0x6a7c9689ea3a589a,
4486 >(_buf?)?;
4487 Ok(_response.map(|x| x.set_settings))
4488 }
4489 self.client.send_query_and_decode::<
4490 ControllerSetPlayerApplicationSettingsRequest,
4491 ControllerSetPlayerApplicationSettingsResult,
4492 >(
4493 (requested_settings,),
4494 0x6a7c9689ea3a589a,
4495 fidl::encoding::DynamicFlags::empty(),
4496 _decode,
4497 )
4498 }
4499
4500 type GetMediaAttributesResponseFut = fidl::client::QueryResponseFut<
4501 ControllerGetMediaAttributesResult,
4502 fidl::encoding::DefaultFuchsiaResourceDialect,
4503 >;
4504 fn r#get_media_attributes(&self) -> Self::GetMediaAttributesResponseFut {
4505 fn _decode(
4506 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4507 ) -> Result<ControllerGetMediaAttributesResult, fidl::Error> {
4508 let _response = fidl::client::decode_transaction_body::<
4509 fidl::encoding::ResultType<ControllerGetMediaAttributesResponse, ControllerError>,
4510 fidl::encoding::DefaultFuchsiaResourceDialect,
4511 0x18bd14308ee3173d,
4512 >(_buf?)?;
4513 Ok(_response.map(|x| x.attributes))
4514 }
4515 self.client.send_query_and_decode::<
4516 fidl::encoding::EmptyPayload,
4517 ControllerGetMediaAttributesResult,
4518 >(
4519 (),
4520 0x18bd14308ee3173d,
4521 fidl::encoding::DynamicFlags::empty(),
4522 _decode,
4523 )
4524 }
4525
4526 type GetPlayStatusResponseFut = fidl::client::QueryResponseFut<
4527 ControllerGetPlayStatusResult,
4528 fidl::encoding::DefaultFuchsiaResourceDialect,
4529 >;
4530 fn r#get_play_status(&self) -> Self::GetPlayStatusResponseFut {
4531 fn _decode(
4532 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4533 ) -> Result<ControllerGetPlayStatusResult, fidl::Error> {
4534 let _response = fidl::client::decode_transaction_body::<
4535 fidl::encoding::ResultType<ControllerGetPlayStatusResponse, ControllerError>,
4536 fidl::encoding::DefaultFuchsiaResourceDialect,
4537 0x120735bec709fc6d,
4538 >(_buf?)?;
4539 Ok(_response.map(|x| x.play_status))
4540 }
4541 self.client
4542 .send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerGetPlayStatusResult>(
4543 (),
4544 0x120735bec709fc6d,
4545 fidl::encoding::DynamicFlags::empty(),
4546 _decode,
4547 )
4548 }
4549
4550 type SetAbsoluteVolumeResponseFut = fidl::client::QueryResponseFut<
4551 ControllerSetAbsoluteVolumeResult,
4552 fidl::encoding::DefaultFuchsiaResourceDialect,
4553 >;
4554 fn r#set_absolute_volume(
4555 &self,
4556 mut requested_volume: u8,
4557 ) -> Self::SetAbsoluteVolumeResponseFut {
4558 fn _decode(
4559 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4560 ) -> Result<ControllerSetAbsoluteVolumeResult, fidl::Error> {
4561 let _response = fidl::client::decode_transaction_body::<
4562 fidl::encoding::ResultType<ControllerSetAbsoluteVolumeResponse, ControllerError>,
4563 fidl::encoding::DefaultFuchsiaResourceDialect,
4564 0x1b8d010e11d05957,
4565 >(_buf?)?;
4566 Ok(_response.map(|x| x.set_volume))
4567 }
4568 self.client.send_query_and_decode::<
4569 ControllerSetAbsoluteVolumeRequest,
4570 ControllerSetAbsoluteVolumeResult,
4571 >(
4572 (requested_volume,),
4573 0x1b8d010e11d05957,
4574 fidl::encoding::DynamicFlags::empty(),
4575 _decode,
4576 )
4577 }
4578
4579 type InformBatteryStatusResponseFut = fidl::client::QueryResponseFut<
4580 ControllerInformBatteryStatusResult,
4581 fidl::encoding::DefaultFuchsiaResourceDialect,
4582 >;
4583 fn r#inform_battery_status(
4584 &self,
4585 mut battery_status: BatteryStatus,
4586 ) -> Self::InformBatteryStatusResponseFut {
4587 fn _decode(
4588 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4589 ) -> Result<ControllerInformBatteryStatusResult, fidl::Error> {
4590 let _response = fidl::client::decode_transaction_body::<
4591 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControllerError>,
4592 fidl::encoding::DefaultFuchsiaResourceDialect,
4593 0x11d54fbe9d12c44d,
4594 >(_buf?)?;
4595 Ok(_response.map(|x| x))
4596 }
4597 self.client.send_query_and_decode::<
4598 ControllerInformBatteryStatusRequest,
4599 ControllerInformBatteryStatusResult,
4600 >(
4601 (battery_status,),
4602 0x11d54fbe9d12c44d,
4603 fidl::encoding::DynamicFlags::empty(),
4604 _decode,
4605 )
4606 }
4607
4608 fn r#set_notification_filter(
4609 &self,
4610 mut notifications: Notifications,
4611 mut position_change_interval: u32,
4612 ) -> Result<(), fidl::Error> {
4613 self.client.send::<ControllerSetNotificationFilterRequest>(
4614 (notifications, position_change_interval),
4615 0x4d8a327745ccd73b,
4616 fidl::encoding::DynamicFlags::empty(),
4617 )
4618 }
4619
4620 fn r#notify_notification_handled(&self) -> Result<(), fidl::Error> {
4621 self.client.send::<fidl::encoding::EmptyPayload>(
4622 (),
4623 0x43d3e556557f3bc2,
4624 fidl::encoding::DynamicFlags::empty(),
4625 )
4626 }
4627
4628 type SetAddressedPlayerResponseFut = fidl::client::QueryResponseFut<
4629 ControllerSetAddressedPlayerResult,
4630 fidl::encoding::DefaultFuchsiaResourceDialect,
4631 >;
4632 fn r#set_addressed_player(&self, mut player_id: u16) -> Self::SetAddressedPlayerResponseFut {
4633 fn _decode(
4634 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4635 ) -> Result<ControllerSetAddressedPlayerResult, fidl::Error> {
4636 let _response = fidl::client::decode_transaction_body::<
4637 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControllerError>,
4638 fidl::encoding::DefaultFuchsiaResourceDialect,
4639 0x7ffc261f10ee1da5,
4640 >(_buf?)?;
4641 Ok(_response.map(|x| x))
4642 }
4643 self.client.send_query_and_decode::<
4644 ControllerSetAddressedPlayerRequest,
4645 ControllerSetAddressedPlayerResult,
4646 >(
4647 (player_id,),
4648 0x7ffc261f10ee1da5,
4649 fidl::encoding::DynamicFlags::empty(),
4650 _decode,
4651 )
4652 }
4653
4654 type SendCommandResponseFut = fidl::client::QueryResponseFut<
4655 ControllerSendCommandResult,
4656 fidl::encoding::DefaultFuchsiaResourceDialect,
4657 >;
4658 fn r#send_command(&self, mut command: AvcPanelCommand) -> Self::SendCommandResponseFut {
4659 fn _decode(
4660 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
4661 ) -> Result<ControllerSendCommandResult, fidl::Error> {
4662 let _response = fidl::client::decode_transaction_body::<
4663 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControllerError>,
4664 fidl::encoding::DefaultFuchsiaResourceDialect,
4665 0x241324c56b5bc257,
4666 >(_buf?)?;
4667 Ok(_response.map(|x| x))
4668 }
4669 self.client
4670 .send_query_and_decode::<ControllerSendCommandRequest, ControllerSendCommandResult>(
4671 (command,),
4672 0x241324c56b5bc257,
4673 fidl::encoding::DynamicFlags::empty(),
4674 _decode,
4675 )
4676 }
4677}
4678
4679pub struct ControllerEventStream {
4680 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
4681}
4682
4683impl std::marker::Unpin for ControllerEventStream {}
4684
4685impl futures::stream::FusedStream for ControllerEventStream {
4686 fn is_terminated(&self) -> bool {
4687 self.event_receiver.is_terminated()
4688 }
4689}
4690
4691impl futures::Stream for ControllerEventStream {
4692 type Item = Result<ControllerEvent, fidl::Error>;
4693
4694 fn poll_next(
4695 mut self: std::pin::Pin<&mut Self>,
4696 cx: &mut std::task::Context<'_>,
4697 ) -> std::task::Poll<Option<Self::Item>> {
4698 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
4699 &mut self.event_receiver,
4700 cx
4701 )?) {
4702 Some(buf) => std::task::Poll::Ready(Some(ControllerEvent::decode(buf))),
4703 None => std::task::Poll::Ready(None),
4704 }
4705 }
4706}
4707
4708#[derive(Debug)]
4709pub enum ControllerEvent {
4710 OnNotification { timestamp: i64, notification: Notification },
4711}
4712
4713impl ControllerEvent {
4714 #[allow(irrefutable_let_patterns)]
4715 pub fn into_on_notification(self) -> Option<(i64, Notification)> {
4716 if let ControllerEvent::OnNotification { timestamp, notification } = self {
4717 Some((timestamp, notification))
4718 } else {
4719 None
4720 }
4721 }
4722
4723 fn decode(
4725 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
4726 ) -> Result<ControllerEvent, fidl::Error> {
4727 let (bytes, _handles) = buf.split_mut();
4728 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4729 debug_assert_eq!(tx_header.tx_id, 0);
4730 match tx_header.ordinal {
4731 0x796259451db67281 => {
4732 let mut out = fidl::new_empty!(
4733 ControllerOnNotificationRequest,
4734 fidl::encoding::DefaultFuchsiaResourceDialect
4735 );
4736 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerOnNotificationRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
4737 Ok((ControllerEvent::OnNotification {
4738 timestamp: out.timestamp,
4739 notification: out.notification,
4740 }))
4741 }
4742 _ => Err(fidl::Error::UnknownOrdinal {
4743 ordinal: tx_header.ordinal,
4744 protocol_name: <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4745 }),
4746 }
4747 }
4748}
4749
4750pub struct ControllerRequestStream {
4752 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4753 is_terminated: bool,
4754}
4755
4756impl std::marker::Unpin for ControllerRequestStream {}
4757
4758impl futures::stream::FusedStream for ControllerRequestStream {
4759 fn is_terminated(&self) -> bool {
4760 self.is_terminated
4761 }
4762}
4763
4764impl fidl::endpoints::RequestStream for ControllerRequestStream {
4765 type Protocol = ControllerMarker;
4766 type ControlHandle = ControllerControlHandle;
4767
4768 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
4769 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
4770 }
4771
4772 fn control_handle(&self) -> Self::ControlHandle {
4773 ControllerControlHandle { inner: self.inner.clone() }
4774 }
4775
4776 fn into_inner(
4777 self,
4778 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
4779 {
4780 (self.inner, self.is_terminated)
4781 }
4782
4783 fn from_inner(
4784 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4785 is_terminated: bool,
4786 ) -> Self {
4787 Self { inner, is_terminated }
4788 }
4789}
4790
4791impl futures::Stream for ControllerRequestStream {
4792 type Item = Result<ControllerRequest, fidl::Error>;
4793
4794 fn poll_next(
4795 mut self: std::pin::Pin<&mut Self>,
4796 cx: &mut std::task::Context<'_>,
4797 ) -> std::task::Poll<Option<Self::Item>> {
4798 let this = &mut *self;
4799 if this.inner.check_shutdown(cx) {
4800 this.is_terminated = true;
4801 return std::task::Poll::Ready(None);
4802 }
4803 if this.is_terminated {
4804 panic!("polled ControllerRequestStream after completion");
4805 }
4806 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
4807 |bytes, handles| {
4808 match this.inner.channel().read_etc(cx, bytes, handles) {
4809 std::task::Poll::Ready(Ok(())) => {}
4810 std::task::Poll::Pending => return std::task::Poll::Pending,
4811 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
4812 this.is_terminated = true;
4813 return std::task::Poll::Ready(None);
4814 }
4815 std::task::Poll::Ready(Err(e)) => {
4816 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
4817 e.into(),
4818 ))))
4819 }
4820 }
4821
4822 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
4824
4825 std::task::Poll::Ready(Some(match header.ordinal {
4826 0x681de2da50670120 => {
4827 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4828 let mut req = fidl::new_empty!(
4829 ControllerGetPlayerApplicationSettingsRequest,
4830 fidl::encoding::DefaultFuchsiaResourceDialect
4831 );
4832 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerGetPlayerApplicationSettingsRequest>(&header, _body_bytes, handles, &mut req)?;
4833 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
4834 Ok(ControllerRequest::GetPlayerApplicationSettings {
4835 attribute_ids: req.attribute_ids,
4836
4837 responder: ControllerGetPlayerApplicationSettingsResponder {
4838 control_handle: std::mem::ManuallyDrop::new(control_handle),
4839 tx_id: header.tx_id,
4840 },
4841 })
4842 }
4843 0x6a7c9689ea3a589a => {
4844 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4845 let mut req = fidl::new_empty!(
4846 ControllerSetPlayerApplicationSettingsRequest,
4847 fidl::encoding::DefaultFuchsiaResourceDialect
4848 );
4849 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerSetPlayerApplicationSettingsRequest>(&header, _body_bytes, handles, &mut req)?;
4850 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
4851 Ok(ControllerRequest::SetPlayerApplicationSettings {
4852 requested_settings: req.requested_settings,
4853
4854 responder: ControllerSetPlayerApplicationSettingsResponder {
4855 control_handle: std::mem::ManuallyDrop::new(control_handle),
4856 tx_id: header.tx_id,
4857 },
4858 })
4859 }
4860 0x18bd14308ee3173d => {
4861 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4862 let mut req = fidl::new_empty!(
4863 fidl::encoding::EmptyPayload,
4864 fidl::encoding::DefaultFuchsiaResourceDialect
4865 );
4866 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4867 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
4868 Ok(ControllerRequest::GetMediaAttributes {
4869 responder: ControllerGetMediaAttributesResponder {
4870 control_handle: std::mem::ManuallyDrop::new(control_handle),
4871 tx_id: header.tx_id,
4872 },
4873 })
4874 }
4875 0x120735bec709fc6d => {
4876 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4877 let mut req = fidl::new_empty!(
4878 fidl::encoding::EmptyPayload,
4879 fidl::encoding::DefaultFuchsiaResourceDialect
4880 );
4881 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4882 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
4883 Ok(ControllerRequest::GetPlayStatus {
4884 responder: ControllerGetPlayStatusResponder {
4885 control_handle: std::mem::ManuallyDrop::new(control_handle),
4886 tx_id: header.tx_id,
4887 },
4888 })
4889 }
4890 0x1b8d010e11d05957 => {
4891 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4892 let mut req = fidl::new_empty!(
4893 ControllerSetAbsoluteVolumeRequest,
4894 fidl::encoding::DefaultFuchsiaResourceDialect
4895 );
4896 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerSetAbsoluteVolumeRequest>(&header, _body_bytes, handles, &mut req)?;
4897 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
4898 Ok(ControllerRequest::SetAbsoluteVolume {
4899 requested_volume: req.requested_volume,
4900
4901 responder: ControllerSetAbsoluteVolumeResponder {
4902 control_handle: std::mem::ManuallyDrop::new(control_handle),
4903 tx_id: header.tx_id,
4904 },
4905 })
4906 }
4907 0x11d54fbe9d12c44d => {
4908 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4909 let mut req = fidl::new_empty!(
4910 ControllerInformBatteryStatusRequest,
4911 fidl::encoding::DefaultFuchsiaResourceDialect
4912 );
4913 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerInformBatteryStatusRequest>(&header, _body_bytes, handles, &mut req)?;
4914 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
4915 Ok(ControllerRequest::InformBatteryStatus {
4916 battery_status: req.battery_status,
4917
4918 responder: ControllerInformBatteryStatusResponder {
4919 control_handle: std::mem::ManuallyDrop::new(control_handle),
4920 tx_id: header.tx_id,
4921 },
4922 })
4923 }
4924 0x4d8a327745ccd73b => {
4925 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4926 let mut req = fidl::new_empty!(
4927 ControllerSetNotificationFilterRequest,
4928 fidl::encoding::DefaultFuchsiaResourceDialect
4929 );
4930 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerSetNotificationFilterRequest>(&header, _body_bytes, handles, &mut req)?;
4931 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
4932 Ok(ControllerRequest::SetNotificationFilter {
4933 notifications: req.notifications,
4934 position_change_interval: req.position_change_interval,
4935
4936 control_handle,
4937 })
4938 }
4939 0x43d3e556557f3bc2 => {
4940 header.validate_request_tx_id(fidl::MethodType::OneWay)?;
4941 let mut req = fidl::new_empty!(
4942 fidl::encoding::EmptyPayload,
4943 fidl::encoding::DefaultFuchsiaResourceDialect
4944 );
4945 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
4946 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
4947 Ok(ControllerRequest::NotifyNotificationHandled { control_handle })
4948 }
4949 0x7ffc261f10ee1da5 => {
4950 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4951 let mut req = fidl::new_empty!(
4952 ControllerSetAddressedPlayerRequest,
4953 fidl::encoding::DefaultFuchsiaResourceDialect
4954 );
4955 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerSetAddressedPlayerRequest>(&header, _body_bytes, handles, &mut req)?;
4956 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
4957 Ok(ControllerRequest::SetAddressedPlayer {
4958 player_id: req.player_id,
4959
4960 responder: ControllerSetAddressedPlayerResponder {
4961 control_handle: std::mem::ManuallyDrop::new(control_handle),
4962 tx_id: header.tx_id,
4963 },
4964 })
4965 }
4966 0x241324c56b5bc257 => {
4967 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
4968 let mut req = fidl::new_empty!(
4969 ControllerSendCommandRequest,
4970 fidl::encoding::DefaultFuchsiaResourceDialect
4971 );
4972 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerSendCommandRequest>(&header, _body_bytes, handles, &mut req)?;
4973 let control_handle = ControllerControlHandle { inner: this.inner.clone() };
4974 Ok(ControllerRequest::SendCommand {
4975 command: req.command,
4976
4977 responder: ControllerSendCommandResponder {
4978 control_handle: std::mem::ManuallyDrop::new(control_handle),
4979 tx_id: header.tx_id,
4980 },
4981 })
4982 }
4983 _ => Err(fidl::Error::UnknownOrdinal {
4984 ordinal: header.ordinal,
4985 protocol_name:
4986 <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
4987 }),
4988 }))
4989 },
4990 )
4991 }
4992}
4993
4994#[derive(Debug)]
5000pub enum ControllerRequest {
5001 GetPlayerApplicationSettings {
5005 attribute_ids: Vec<PlayerApplicationSettingAttributeId>,
5006 responder: ControllerGetPlayerApplicationSettingsResponder,
5007 },
5008 SetPlayerApplicationSettings {
5015 requested_settings: PlayerApplicationSettings,
5016 responder: ControllerSetPlayerApplicationSettingsResponder,
5017 },
5018 GetMediaAttributes { responder: ControllerGetMediaAttributesResponder },
5022 GetPlayStatus { responder: ControllerGetPlayStatusResponder },
5024 SetAbsoluteVolume { requested_volume: u8, responder: ControllerSetAbsoluteVolumeResponder },
5028 InformBatteryStatus {
5030 battery_status: BatteryStatus,
5031 responder: ControllerInformBatteryStatusResponder,
5032 },
5033 SetNotificationFilter {
5043 notifications: Notifications,
5044 position_change_interval: u32,
5045 control_handle: ControllerControlHandle,
5046 },
5047 NotifyNotificationHandled { control_handle: ControllerControlHandle },
5049 SetAddressedPlayer { player_id: u16, responder: ControllerSetAddressedPlayerResponder },
5051 SendCommand { command: AvcPanelCommand, responder: ControllerSendCommandResponder },
5053}
5054
5055impl ControllerRequest {
5056 #[allow(irrefutable_let_patterns)]
5057 pub fn into_get_player_application_settings(
5058 self,
5059 ) -> Option<(
5060 Vec<PlayerApplicationSettingAttributeId>,
5061 ControllerGetPlayerApplicationSettingsResponder,
5062 )> {
5063 if let ControllerRequest::GetPlayerApplicationSettings { attribute_ids, responder } = self {
5064 Some((attribute_ids, responder))
5065 } else {
5066 None
5067 }
5068 }
5069
5070 #[allow(irrefutable_let_patterns)]
5071 pub fn into_set_player_application_settings(
5072 self,
5073 ) -> Option<(PlayerApplicationSettings, ControllerSetPlayerApplicationSettingsResponder)> {
5074 if let ControllerRequest::SetPlayerApplicationSettings { requested_settings, responder } =
5075 self
5076 {
5077 Some((requested_settings, responder))
5078 } else {
5079 None
5080 }
5081 }
5082
5083 #[allow(irrefutable_let_patterns)]
5084 pub fn into_get_media_attributes(self) -> Option<(ControllerGetMediaAttributesResponder)> {
5085 if let ControllerRequest::GetMediaAttributes { responder } = self {
5086 Some((responder))
5087 } else {
5088 None
5089 }
5090 }
5091
5092 #[allow(irrefutable_let_patterns)]
5093 pub fn into_get_play_status(self) -> Option<(ControllerGetPlayStatusResponder)> {
5094 if let ControllerRequest::GetPlayStatus { responder } = self {
5095 Some((responder))
5096 } else {
5097 None
5098 }
5099 }
5100
5101 #[allow(irrefutable_let_patterns)]
5102 pub fn into_set_absolute_volume(self) -> Option<(u8, ControllerSetAbsoluteVolumeResponder)> {
5103 if let ControllerRequest::SetAbsoluteVolume { requested_volume, responder } = self {
5104 Some((requested_volume, responder))
5105 } else {
5106 None
5107 }
5108 }
5109
5110 #[allow(irrefutable_let_patterns)]
5111 pub fn into_inform_battery_status(
5112 self,
5113 ) -> Option<(BatteryStatus, ControllerInformBatteryStatusResponder)> {
5114 if let ControllerRequest::InformBatteryStatus { battery_status, responder } = self {
5115 Some((battery_status, responder))
5116 } else {
5117 None
5118 }
5119 }
5120
5121 #[allow(irrefutable_let_patterns)]
5122 pub fn into_set_notification_filter(
5123 self,
5124 ) -> Option<(Notifications, u32, ControllerControlHandle)> {
5125 if let ControllerRequest::SetNotificationFilter {
5126 notifications,
5127 position_change_interval,
5128 control_handle,
5129 } = self
5130 {
5131 Some((notifications, position_change_interval, control_handle))
5132 } else {
5133 None
5134 }
5135 }
5136
5137 #[allow(irrefutable_let_patterns)]
5138 pub fn into_notify_notification_handled(self) -> Option<(ControllerControlHandle)> {
5139 if let ControllerRequest::NotifyNotificationHandled { control_handle } = self {
5140 Some((control_handle))
5141 } else {
5142 None
5143 }
5144 }
5145
5146 #[allow(irrefutable_let_patterns)]
5147 pub fn into_set_addressed_player(self) -> Option<(u16, ControllerSetAddressedPlayerResponder)> {
5148 if let ControllerRequest::SetAddressedPlayer { player_id, responder } = self {
5149 Some((player_id, responder))
5150 } else {
5151 None
5152 }
5153 }
5154
5155 #[allow(irrefutable_let_patterns)]
5156 pub fn into_send_command(self) -> Option<(AvcPanelCommand, ControllerSendCommandResponder)> {
5157 if let ControllerRequest::SendCommand { command, responder } = self {
5158 Some((command, responder))
5159 } else {
5160 None
5161 }
5162 }
5163
5164 pub fn method_name(&self) -> &'static str {
5166 match *self {
5167 ControllerRequest::GetPlayerApplicationSettings { .. } => {
5168 "get_player_application_settings"
5169 }
5170 ControllerRequest::SetPlayerApplicationSettings { .. } => {
5171 "set_player_application_settings"
5172 }
5173 ControllerRequest::GetMediaAttributes { .. } => "get_media_attributes",
5174 ControllerRequest::GetPlayStatus { .. } => "get_play_status",
5175 ControllerRequest::SetAbsoluteVolume { .. } => "set_absolute_volume",
5176 ControllerRequest::InformBatteryStatus { .. } => "inform_battery_status",
5177 ControllerRequest::SetNotificationFilter { .. } => "set_notification_filter",
5178 ControllerRequest::NotifyNotificationHandled { .. } => "notify_notification_handled",
5179 ControllerRequest::SetAddressedPlayer { .. } => "set_addressed_player",
5180 ControllerRequest::SendCommand { .. } => "send_command",
5181 }
5182 }
5183}
5184
5185#[derive(Debug, Clone)]
5186pub struct ControllerControlHandle {
5187 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
5188}
5189
5190impl fidl::endpoints::ControlHandle for ControllerControlHandle {
5191 fn shutdown(&self) {
5192 self.inner.shutdown()
5193 }
5194 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
5195 self.inner.shutdown_with_epitaph(status)
5196 }
5197
5198 fn is_closed(&self) -> bool {
5199 self.inner.channel().is_closed()
5200 }
5201 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
5202 self.inner.channel().on_closed()
5203 }
5204
5205 #[cfg(target_os = "fuchsia")]
5206 fn signal_peer(
5207 &self,
5208 clear_mask: zx::Signals,
5209 set_mask: zx::Signals,
5210 ) -> Result<(), zx_status::Status> {
5211 use fidl::Peered;
5212 self.inner.channel().signal_peer(clear_mask, set_mask)
5213 }
5214}
5215
5216impl ControllerControlHandle {
5217 pub fn send_on_notification(
5218 &self,
5219 mut timestamp: i64,
5220 mut notification: &Notification,
5221 ) -> Result<(), fidl::Error> {
5222 self.inner.send::<ControllerOnNotificationRequest>(
5223 (timestamp, notification),
5224 0,
5225 0x796259451db67281,
5226 fidl::encoding::DynamicFlags::empty(),
5227 )
5228 }
5229}
5230
5231#[must_use = "FIDL methods require a response to be sent"]
5232#[derive(Debug)]
5233pub struct ControllerGetPlayerApplicationSettingsResponder {
5234 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
5235 tx_id: u32,
5236}
5237
5238impl std::ops::Drop for ControllerGetPlayerApplicationSettingsResponder {
5242 fn drop(&mut self) {
5243 self.control_handle.shutdown();
5244 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5246 }
5247}
5248
5249impl fidl::endpoints::Responder for ControllerGetPlayerApplicationSettingsResponder {
5250 type ControlHandle = ControllerControlHandle;
5251
5252 fn control_handle(&self) -> &ControllerControlHandle {
5253 &self.control_handle
5254 }
5255
5256 fn drop_without_shutdown(mut self) {
5257 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5259 std::mem::forget(self);
5261 }
5262}
5263
5264impl ControllerGetPlayerApplicationSettingsResponder {
5265 pub fn send(
5269 self,
5270 mut result: Result<&PlayerApplicationSettings, ControllerError>,
5271 ) -> Result<(), fidl::Error> {
5272 let _result = self.send_raw(result);
5273 if _result.is_err() {
5274 self.control_handle.shutdown();
5275 }
5276 self.drop_without_shutdown();
5277 _result
5278 }
5279
5280 pub fn send_no_shutdown_on_err(
5282 self,
5283 mut result: Result<&PlayerApplicationSettings, ControllerError>,
5284 ) -> Result<(), fidl::Error> {
5285 let _result = self.send_raw(result);
5286 self.drop_without_shutdown();
5287 _result
5288 }
5289
5290 fn send_raw(
5291 &self,
5292 mut result: Result<&PlayerApplicationSettings, ControllerError>,
5293 ) -> Result<(), fidl::Error> {
5294 self.control_handle.inner.send::<fidl::encoding::ResultType<
5295 ControllerGetPlayerApplicationSettingsResponse,
5296 ControllerError,
5297 >>(
5298 result.map(|current_settings| (current_settings,)),
5299 self.tx_id,
5300 0x681de2da50670120,
5301 fidl::encoding::DynamicFlags::empty(),
5302 )
5303 }
5304}
5305
5306#[must_use = "FIDL methods require a response to be sent"]
5307#[derive(Debug)]
5308pub struct ControllerSetPlayerApplicationSettingsResponder {
5309 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
5310 tx_id: u32,
5311}
5312
5313impl std::ops::Drop for ControllerSetPlayerApplicationSettingsResponder {
5317 fn drop(&mut self) {
5318 self.control_handle.shutdown();
5319 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5321 }
5322}
5323
5324impl fidl::endpoints::Responder for ControllerSetPlayerApplicationSettingsResponder {
5325 type ControlHandle = ControllerControlHandle;
5326
5327 fn control_handle(&self) -> &ControllerControlHandle {
5328 &self.control_handle
5329 }
5330
5331 fn drop_without_shutdown(mut self) {
5332 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5334 std::mem::forget(self);
5336 }
5337}
5338
5339impl ControllerSetPlayerApplicationSettingsResponder {
5340 pub fn send(
5344 self,
5345 mut result: Result<&PlayerApplicationSettings, ControllerError>,
5346 ) -> Result<(), fidl::Error> {
5347 let _result = self.send_raw(result);
5348 if _result.is_err() {
5349 self.control_handle.shutdown();
5350 }
5351 self.drop_without_shutdown();
5352 _result
5353 }
5354
5355 pub fn send_no_shutdown_on_err(
5357 self,
5358 mut result: Result<&PlayerApplicationSettings, ControllerError>,
5359 ) -> Result<(), fidl::Error> {
5360 let _result = self.send_raw(result);
5361 self.drop_without_shutdown();
5362 _result
5363 }
5364
5365 fn send_raw(
5366 &self,
5367 mut result: Result<&PlayerApplicationSettings, ControllerError>,
5368 ) -> Result<(), fidl::Error> {
5369 self.control_handle.inner.send::<fidl::encoding::ResultType<
5370 ControllerSetPlayerApplicationSettingsResponse,
5371 ControllerError,
5372 >>(
5373 result.map(|set_settings| (set_settings,)),
5374 self.tx_id,
5375 0x6a7c9689ea3a589a,
5376 fidl::encoding::DynamicFlags::empty(),
5377 )
5378 }
5379}
5380
5381#[must_use = "FIDL methods require a response to be sent"]
5382#[derive(Debug)]
5383pub struct ControllerGetMediaAttributesResponder {
5384 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
5385 tx_id: u32,
5386}
5387
5388impl std::ops::Drop for ControllerGetMediaAttributesResponder {
5392 fn drop(&mut self) {
5393 self.control_handle.shutdown();
5394 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5396 }
5397}
5398
5399impl fidl::endpoints::Responder for ControllerGetMediaAttributesResponder {
5400 type ControlHandle = ControllerControlHandle;
5401
5402 fn control_handle(&self) -> &ControllerControlHandle {
5403 &self.control_handle
5404 }
5405
5406 fn drop_without_shutdown(mut self) {
5407 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5409 std::mem::forget(self);
5411 }
5412}
5413
5414impl ControllerGetMediaAttributesResponder {
5415 pub fn send(
5419 self,
5420 mut result: Result<&MediaAttributes, ControllerError>,
5421 ) -> Result<(), fidl::Error> {
5422 let _result = self.send_raw(result);
5423 if _result.is_err() {
5424 self.control_handle.shutdown();
5425 }
5426 self.drop_without_shutdown();
5427 _result
5428 }
5429
5430 pub fn send_no_shutdown_on_err(
5432 self,
5433 mut result: Result<&MediaAttributes, ControllerError>,
5434 ) -> Result<(), fidl::Error> {
5435 let _result = self.send_raw(result);
5436 self.drop_without_shutdown();
5437 _result
5438 }
5439
5440 fn send_raw(
5441 &self,
5442 mut result: Result<&MediaAttributes, ControllerError>,
5443 ) -> Result<(), fidl::Error> {
5444 self.control_handle.inner.send::<fidl::encoding::ResultType<
5445 ControllerGetMediaAttributesResponse,
5446 ControllerError,
5447 >>(
5448 result.map(|attributes| (attributes,)),
5449 self.tx_id,
5450 0x18bd14308ee3173d,
5451 fidl::encoding::DynamicFlags::empty(),
5452 )
5453 }
5454}
5455
5456#[must_use = "FIDL methods require a response to be sent"]
5457#[derive(Debug)]
5458pub struct ControllerGetPlayStatusResponder {
5459 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
5460 tx_id: u32,
5461}
5462
5463impl std::ops::Drop for ControllerGetPlayStatusResponder {
5467 fn drop(&mut self) {
5468 self.control_handle.shutdown();
5469 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5471 }
5472}
5473
5474impl fidl::endpoints::Responder for ControllerGetPlayStatusResponder {
5475 type ControlHandle = ControllerControlHandle;
5476
5477 fn control_handle(&self) -> &ControllerControlHandle {
5478 &self.control_handle
5479 }
5480
5481 fn drop_without_shutdown(mut self) {
5482 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5484 std::mem::forget(self);
5486 }
5487}
5488
5489impl ControllerGetPlayStatusResponder {
5490 pub fn send(self, mut result: Result<&PlayStatus, ControllerError>) -> Result<(), fidl::Error> {
5494 let _result = self.send_raw(result);
5495 if _result.is_err() {
5496 self.control_handle.shutdown();
5497 }
5498 self.drop_without_shutdown();
5499 _result
5500 }
5501
5502 pub fn send_no_shutdown_on_err(
5504 self,
5505 mut result: Result<&PlayStatus, ControllerError>,
5506 ) -> Result<(), fidl::Error> {
5507 let _result = self.send_raw(result);
5508 self.drop_without_shutdown();
5509 _result
5510 }
5511
5512 fn send_raw(
5513 &self,
5514 mut result: Result<&PlayStatus, ControllerError>,
5515 ) -> Result<(), fidl::Error> {
5516 self.control_handle.inner.send::<fidl::encoding::ResultType<
5517 ControllerGetPlayStatusResponse,
5518 ControllerError,
5519 >>(
5520 result.map(|play_status| (play_status,)),
5521 self.tx_id,
5522 0x120735bec709fc6d,
5523 fidl::encoding::DynamicFlags::empty(),
5524 )
5525 }
5526}
5527
5528#[must_use = "FIDL methods require a response to be sent"]
5529#[derive(Debug)]
5530pub struct ControllerSetAbsoluteVolumeResponder {
5531 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
5532 tx_id: u32,
5533}
5534
5535impl std::ops::Drop for ControllerSetAbsoluteVolumeResponder {
5539 fn drop(&mut self) {
5540 self.control_handle.shutdown();
5541 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5543 }
5544}
5545
5546impl fidl::endpoints::Responder for ControllerSetAbsoluteVolumeResponder {
5547 type ControlHandle = ControllerControlHandle;
5548
5549 fn control_handle(&self) -> &ControllerControlHandle {
5550 &self.control_handle
5551 }
5552
5553 fn drop_without_shutdown(mut self) {
5554 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5556 std::mem::forget(self);
5558 }
5559}
5560
5561impl ControllerSetAbsoluteVolumeResponder {
5562 pub fn send(self, mut result: Result<u8, ControllerError>) -> Result<(), fidl::Error> {
5566 let _result = self.send_raw(result);
5567 if _result.is_err() {
5568 self.control_handle.shutdown();
5569 }
5570 self.drop_without_shutdown();
5571 _result
5572 }
5573
5574 pub fn send_no_shutdown_on_err(
5576 self,
5577 mut result: Result<u8, ControllerError>,
5578 ) -> Result<(), fidl::Error> {
5579 let _result = self.send_raw(result);
5580 self.drop_without_shutdown();
5581 _result
5582 }
5583
5584 fn send_raw(&self, mut result: Result<u8, ControllerError>) -> Result<(), fidl::Error> {
5585 self.control_handle.inner.send::<fidl::encoding::ResultType<
5586 ControllerSetAbsoluteVolumeResponse,
5587 ControllerError,
5588 >>(
5589 result.map(|set_volume| (set_volume,)),
5590 self.tx_id,
5591 0x1b8d010e11d05957,
5592 fidl::encoding::DynamicFlags::empty(),
5593 )
5594 }
5595}
5596
5597#[must_use = "FIDL methods require a response to be sent"]
5598#[derive(Debug)]
5599pub struct ControllerInformBatteryStatusResponder {
5600 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
5601 tx_id: u32,
5602}
5603
5604impl std::ops::Drop for ControllerInformBatteryStatusResponder {
5608 fn drop(&mut self) {
5609 self.control_handle.shutdown();
5610 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5612 }
5613}
5614
5615impl fidl::endpoints::Responder for ControllerInformBatteryStatusResponder {
5616 type ControlHandle = ControllerControlHandle;
5617
5618 fn control_handle(&self) -> &ControllerControlHandle {
5619 &self.control_handle
5620 }
5621
5622 fn drop_without_shutdown(mut self) {
5623 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5625 std::mem::forget(self);
5627 }
5628}
5629
5630impl ControllerInformBatteryStatusResponder {
5631 pub fn send(self, mut result: Result<(), ControllerError>) -> Result<(), fidl::Error> {
5635 let _result = self.send_raw(result);
5636 if _result.is_err() {
5637 self.control_handle.shutdown();
5638 }
5639 self.drop_without_shutdown();
5640 _result
5641 }
5642
5643 pub fn send_no_shutdown_on_err(
5645 self,
5646 mut result: Result<(), ControllerError>,
5647 ) -> Result<(), fidl::Error> {
5648 let _result = self.send_raw(result);
5649 self.drop_without_shutdown();
5650 _result
5651 }
5652
5653 fn send_raw(&self, mut result: Result<(), ControllerError>) -> Result<(), fidl::Error> {
5654 self.control_handle.inner.send::<fidl::encoding::ResultType<
5655 fidl::encoding::EmptyStruct,
5656 ControllerError,
5657 >>(
5658 result,
5659 self.tx_id,
5660 0x11d54fbe9d12c44d,
5661 fidl::encoding::DynamicFlags::empty(),
5662 )
5663 }
5664}
5665
5666#[must_use = "FIDL methods require a response to be sent"]
5667#[derive(Debug)]
5668pub struct ControllerSetAddressedPlayerResponder {
5669 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
5670 tx_id: u32,
5671}
5672
5673impl std::ops::Drop for ControllerSetAddressedPlayerResponder {
5677 fn drop(&mut self) {
5678 self.control_handle.shutdown();
5679 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5681 }
5682}
5683
5684impl fidl::endpoints::Responder for ControllerSetAddressedPlayerResponder {
5685 type ControlHandle = ControllerControlHandle;
5686
5687 fn control_handle(&self) -> &ControllerControlHandle {
5688 &self.control_handle
5689 }
5690
5691 fn drop_without_shutdown(mut self) {
5692 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5694 std::mem::forget(self);
5696 }
5697}
5698
5699impl ControllerSetAddressedPlayerResponder {
5700 pub fn send(self, mut result: Result<(), ControllerError>) -> Result<(), fidl::Error> {
5704 let _result = self.send_raw(result);
5705 if _result.is_err() {
5706 self.control_handle.shutdown();
5707 }
5708 self.drop_without_shutdown();
5709 _result
5710 }
5711
5712 pub fn send_no_shutdown_on_err(
5714 self,
5715 mut result: Result<(), ControllerError>,
5716 ) -> Result<(), fidl::Error> {
5717 let _result = self.send_raw(result);
5718 self.drop_without_shutdown();
5719 _result
5720 }
5721
5722 fn send_raw(&self, mut result: Result<(), ControllerError>) -> Result<(), fidl::Error> {
5723 self.control_handle.inner.send::<fidl::encoding::ResultType<
5724 fidl::encoding::EmptyStruct,
5725 ControllerError,
5726 >>(
5727 result,
5728 self.tx_id,
5729 0x7ffc261f10ee1da5,
5730 fidl::encoding::DynamicFlags::empty(),
5731 )
5732 }
5733}
5734
5735#[must_use = "FIDL methods require a response to be sent"]
5736#[derive(Debug)]
5737pub struct ControllerSendCommandResponder {
5738 control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
5739 tx_id: u32,
5740}
5741
5742impl std::ops::Drop for ControllerSendCommandResponder {
5746 fn drop(&mut self) {
5747 self.control_handle.shutdown();
5748 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5750 }
5751}
5752
5753impl fidl::endpoints::Responder for ControllerSendCommandResponder {
5754 type ControlHandle = ControllerControlHandle;
5755
5756 fn control_handle(&self) -> &ControllerControlHandle {
5757 &self.control_handle
5758 }
5759
5760 fn drop_without_shutdown(mut self) {
5761 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5763 std::mem::forget(self);
5765 }
5766}
5767
5768impl ControllerSendCommandResponder {
5769 pub fn send(self, mut result: Result<(), ControllerError>) -> Result<(), fidl::Error> {
5773 let _result = self.send_raw(result);
5774 if _result.is_err() {
5775 self.control_handle.shutdown();
5776 }
5777 self.drop_without_shutdown();
5778 _result
5779 }
5780
5781 pub fn send_no_shutdown_on_err(
5783 self,
5784 mut result: Result<(), ControllerError>,
5785 ) -> Result<(), fidl::Error> {
5786 let _result = self.send_raw(result);
5787 self.drop_without_shutdown();
5788 _result
5789 }
5790
5791 fn send_raw(&self, mut result: Result<(), ControllerError>) -> Result<(), fidl::Error> {
5792 self.control_handle.inner.send::<fidl::encoding::ResultType<
5793 fidl::encoding::EmptyStruct,
5794 ControllerError,
5795 >>(
5796 result,
5797 self.tx_id,
5798 0x241324c56b5bc257,
5799 fidl::encoding::DynamicFlags::empty(),
5800 )
5801 }
5802}
5803
5804#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5805pub struct PeerManagerMarker;
5806
5807impl fidl::endpoints::ProtocolMarker for PeerManagerMarker {
5808 type Proxy = PeerManagerProxy;
5809 type RequestStream = PeerManagerRequestStream;
5810 #[cfg(target_os = "fuchsia")]
5811 type SynchronousProxy = PeerManagerSynchronousProxy;
5812
5813 const DEBUG_NAME: &'static str = "fuchsia.bluetooth.avrcp.PeerManager";
5814}
5815impl fidl::endpoints::DiscoverableProtocolMarker for PeerManagerMarker {}
5816pub type PeerManagerGetBrowseControllerForTargetResult = Result<(), i32>;
5817pub type PeerManagerGetControllerForTargetResult = Result<(), i32>;
5818pub type PeerManagerSetAbsoluteVolumeHandlerResult = Result<(), i32>;
5819pub type PeerManagerRegisterTargetHandlerResult = Result<(), i32>;
5820
5821pub trait PeerManagerProxyInterface: Send + Sync {
5822 type GetBrowseControllerForTargetResponseFut: std::future::Future<
5823 Output = Result<PeerManagerGetBrowseControllerForTargetResult, fidl::Error>,
5824 > + Send;
5825 fn r#get_browse_controller_for_target(
5826 &self,
5827 peer_id: &fidl_fuchsia_bluetooth::PeerId,
5828 client: fidl::endpoints::ServerEnd<BrowseControllerMarker>,
5829 ) -> Self::GetBrowseControllerForTargetResponseFut;
5830 type GetControllerForTargetResponseFut: std::future::Future<Output = Result<PeerManagerGetControllerForTargetResult, fidl::Error>>
5831 + Send;
5832 fn r#get_controller_for_target(
5833 &self,
5834 peer_id: &fidl_fuchsia_bluetooth::PeerId,
5835 client: fidl::endpoints::ServerEnd<ControllerMarker>,
5836 ) -> Self::GetControllerForTargetResponseFut;
5837 type SetAbsoluteVolumeHandlerResponseFut: std::future::Future<Output = Result<PeerManagerSetAbsoluteVolumeHandlerResult, fidl::Error>>
5838 + Send;
5839 fn r#set_absolute_volume_handler(
5840 &self,
5841 handler: fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
5842 ) -> Self::SetAbsoluteVolumeHandlerResponseFut;
5843 type RegisterTargetHandlerResponseFut: std::future::Future<Output = Result<PeerManagerRegisterTargetHandlerResult, fidl::Error>>
5844 + Send;
5845 fn r#register_target_handler(
5846 &self,
5847 handler: fidl::endpoints::ClientEnd<TargetHandlerMarker>,
5848 ) -> Self::RegisterTargetHandlerResponseFut;
5849}
5850#[derive(Debug)]
5851#[cfg(target_os = "fuchsia")]
5852pub struct PeerManagerSynchronousProxy {
5853 client: fidl::client::sync::Client,
5854}
5855
5856#[cfg(target_os = "fuchsia")]
5857impl fidl::endpoints::SynchronousProxy for PeerManagerSynchronousProxy {
5858 type Proxy = PeerManagerProxy;
5859 type Protocol = PeerManagerMarker;
5860
5861 fn from_channel(inner: fidl::Channel) -> Self {
5862 Self::new(inner)
5863 }
5864
5865 fn into_channel(self) -> fidl::Channel {
5866 self.client.into_channel()
5867 }
5868
5869 fn as_channel(&self) -> &fidl::Channel {
5870 self.client.as_channel()
5871 }
5872}
5873
5874#[cfg(target_os = "fuchsia")]
5875impl PeerManagerSynchronousProxy {
5876 pub fn new(channel: fidl::Channel) -> Self {
5877 let protocol_name = <PeerManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5878 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5879 }
5880
5881 pub fn into_channel(self) -> fidl::Channel {
5882 self.client.into_channel()
5883 }
5884
5885 pub fn wait_for_event(
5888 &self,
5889 deadline: zx::MonotonicInstant,
5890 ) -> Result<PeerManagerEvent, fidl::Error> {
5891 PeerManagerEvent::decode(self.client.wait_for_event(deadline)?)
5892 }
5893
5894 pub fn r#get_browse_controller_for_target(
5897 &self,
5898 mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
5899 mut client: fidl::endpoints::ServerEnd<BrowseControllerMarker>,
5900 ___deadline: zx::MonotonicInstant,
5901 ) -> Result<PeerManagerGetBrowseControllerForTargetResult, fidl::Error> {
5902 let _response = self.client.send_query::<
5903 PeerManagerGetBrowseControllerForTargetRequest,
5904 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5905 >(
5906 (peer_id, client,),
5907 0x5b75bbb8d58a6d49,
5908 fidl::encoding::DynamicFlags::empty(),
5909 ___deadline,
5910 )?;
5911 Ok(_response.map(|x| x))
5912 }
5913
5914 pub fn r#get_controller_for_target(
5917 &self,
5918 mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
5919 mut client: fidl::endpoints::ServerEnd<ControllerMarker>,
5920 ___deadline: zx::MonotonicInstant,
5921 ) -> Result<PeerManagerGetControllerForTargetResult, fidl::Error> {
5922 let _response = self.client.send_query::<
5923 PeerManagerGetControllerForTargetRequest,
5924 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5925 >(
5926 (peer_id, client,),
5927 0x25d36e51516bc3b4,
5928 fidl::encoding::DynamicFlags::empty(),
5929 ___deadline,
5930 )?;
5931 Ok(_response.map(|x| x))
5932 }
5933
5934 pub fn r#set_absolute_volume_handler(
5938 &self,
5939 mut handler: fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
5940 ___deadline: zx::MonotonicInstant,
5941 ) -> Result<PeerManagerSetAbsoluteVolumeHandlerResult, fidl::Error> {
5942 let _response = self.client.send_query::<
5943 PeerManagerSetAbsoluteVolumeHandlerRequest,
5944 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5945 >(
5946 (handler,),
5947 0x39a465c63e9f918c,
5948 fidl::encoding::DynamicFlags::empty(),
5949 ___deadline,
5950 )?;
5951 Ok(_response.map(|x| x))
5952 }
5953
5954 pub fn r#register_target_handler(
5957 &self,
5958 mut handler: fidl::endpoints::ClientEnd<TargetHandlerMarker>,
5959 ___deadline: zx::MonotonicInstant,
5960 ) -> Result<PeerManagerRegisterTargetHandlerResult, fidl::Error> {
5961 let _response = self.client.send_query::<
5962 PeerManagerRegisterTargetHandlerRequest,
5963 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5964 >(
5965 (handler,),
5966 0x4bc919acb791bdb3,
5967 fidl::encoding::DynamicFlags::empty(),
5968 ___deadline,
5969 )?;
5970 Ok(_response.map(|x| x))
5971 }
5972}
5973
5974#[derive(Debug, Clone)]
5975pub struct PeerManagerProxy {
5976 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5977}
5978
5979impl fidl::endpoints::Proxy for PeerManagerProxy {
5980 type Protocol = PeerManagerMarker;
5981
5982 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5983 Self::new(inner)
5984 }
5985
5986 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5987 self.client.into_channel().map_err(|client| Self { client })
5988 }
5989
5990 fn as_channel(&self) -> &::fidl::AsyncChannel {
5991 self.client.as_channel()
5992 }
5993}
5994
5995impl PeerManagerProxy {
5996 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5998 let protocol_name = <PeerManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5999 Self { client: fidl::client::Client::new(channel, protocol_name) }
6000 }
6001
6002 pub fn take_event_stream(&self) -> PeerManagerEventStream {
6008 PeerManagerEventStream { event_receiver: self.client.take_event_receiver() }
6009 }
6010
6011 pub fn r#get_browse_controller_for_target(
6014 &self,
6015 mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
6016 mut client: fidl::endpoints::ServerEnd<BrowseControllerMarker>,
6017 ) -> fidl::client::QueryResponseFut<
6018 PeerManagerGetBrowseControllerForTargetResult,
6019 fidl::encoding::DefaultFuchsiaResourceDialect,
6020 > {
6021 PeerManagerProxyInterface::r#get_browse_controller_for_target(self, peer_id, client)
6022 }
6023
6024 pub fn r#get_controller_for_target(
6027 &self,
6028 mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
6029 mut client: fidl::endpoints::ServerEnd<ControllerMarker>,
6030 ) -> fidl::client::QueryResponseFut<
6031 PeerManagerGetControllerForTargetResult,
6032 fidl::encoding::DefaultFuchsiaResourceDialect,
6033 > {
6034 PeerManagerProxyInterface::r#get_controller_for_target(self, peer_id, client)
6035 }
6036
6037 pub fn r#set_absolute_volume_handler(
6041 &self,
6042 mut handler: fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
6043 ) -> fidl::client::QueryResponseFut<
6044 PeerManagerSetAbsoluteVolumeHandlerResult,
6045 fidl::encoding::DefaultFuchsiaResourceDialect,
6046 > {
6047 PeerManagerProxyInterface::r#set_absolute_volume_handler(self, handler)
6048 }
6049
6050 pub fn r#register_target_handler(
6053 &self,
6054 mut handler: fidl::endpoints::ClientEnd<TargetHandlerMarker>,
6055 ) -> fidl::client::QueryResponseFut<
6056 PeerManagerRegisterTargetHandlerResult,
6057 fidl::encoding::DefaultFuchsiaResourceDialect,
6058 > {
6059 PeerManagerProxyInterface::r#register_target_handler(self, handler)
6060 }
6061}
6062
6063impl PeerManagerProxyInterface for PeerManagerProxy {
6064 type GetBrowseControllerForTargetResponseFut = fidl::client::QueryResponseFut<
6065 PeerManagerGetBrowseControllerForTargetResult,
6066 fidl::encoding::DefaultFuchsiaResourceDialect,
6067 >;
6068 fn r#get_browse_controller_for_target(
6069 &self,
6070 mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
6071 mut client: fidl::endpoints::ServerEnd<BrowseControllerMarker>,
6072 ) -> Self::GetBrowseControllerForTargetResponseFut {
6073 fn _decode(
6074 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6075 ) -> Result<PeerManagerGetBrowseControllerForTargetResult, fidl::Error> {
6076 let _response = fidl::client::decode_transaction_body::<
6077 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6078 fidl::encoding::DefaultFuchsiaResourceDialect,
6079 0x5b75bbb8d58a6d49,
6080 >(_buf?)?;
6081 Ok(_response.map(|x| x))
6082 }
6083 self.client.send_query_and_decode::<
6084 PeerManagerGetBrowseControllerForTargetRequest,
6085 PeerManagerGetBrowseControllerForTargetResult,
6086 >(
6087 (peer_id, client,),
6088 0x5b75bbb8d58a6d49,
6089 fidl::encoding::DynamicFlags::empty(),
6090 _decode,
6091 )
6092 }
6093
6094 type GetControllerForTargetResponseFut = fidl::client::QueryResponseFut<
6095 PeerManagerGetControllerForTargetResult,
6096 fidl::encoding::DefaultFuchsiaResourceDialect,
6097 >;
6098 fn r#get_controller_for_target(
6099 &self,
6100 mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
6101 mut client: fidl::endpoints::ServerEnd<ControllerMarker>,
6102 ) -> Self::GetControllerForTargetResponseFut {
6103 fn _decode(
6104 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6105 ) -> Result<PeerManagerGetControllerForTargetResult, fidl::Error> {
6106 let _response = fidl::client::decode_transaction_body::<
6107 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6108 fidl::encoding::DefaultFuchsiaResourceDialect,
6109 0x25d36e51516bc3b4,
6110 >(_buf?)?;
6111 Ok(_response.map(|x| x))
6112 }
6113 self.client.send_query_and_decode::<
6114 PeerManagerGetControllerForTargetRequest,
6115 PeerManagerGetControllerForTargetResult,
6116 >(
6117 (peer_id, client,),
6118 0x25d36e51516bc3b4,
6119 fidl::encoding::DynamicFlags::empty(),
6120 _decode,
6121 )
6122 }
6123
6124 type SetAbsoluteVolumeHandlerResponseFut = fidl::client::QueryResponseFut<
6125 PeerManagerSetAbsoluteVolumeHandlerResult,
6126 fidl::encoding::DefaultFuchsiaResourceDialect,
6127 >;
6128 fn r#set_absolute_volume_handler(
6129 &self,
6130 mut handler: fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
6131 ) -> Self::SetAbsoluteVolumeHandlerResponseFut {
6132 fn _decode(
6133 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6134 ) -> Result<PeerManagerSetAbsoluteVolumeHandlerResult, fidl::Error> {
6135 let _response = fidl::client::decode_transaction_body::<
6136 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6137 fidl::encoding::DefaultFuchsiaResourceDialect,
6138 0x39a465c63e9f918c,
6139 >(_buf?)?;
6140 Ok(_response.map(|x| x))
6141 }
6142 self.client.send_query_and_decode::<
6143 PeerManagerSetAbsoluteVolumeHandlerRequest,
6144 PeerManagerSetAbsoluteVolumeHandlerResult,
6145 >(
6146 (handler,),
6147 0x39a465c63e9f918c,
6148 fidl::encoding::DynamicFlags::empty(),
6149 _decode,
6150 )
6151 }
6152
6153 type RegisterTargetHandlerResponseFut = fidl::client::QueryResponseFut<
6154 PeerManagerRegisterTargetHandlerResult,
6155 fidl::encoding::DefaultFuchsiaResourceDialect,
6156 >;
6157 fn r#register_target_handler(
6158 &self,
6159 mut handler: fidl::endpoints::ClientEnd<TargetHandlerMarker>,
6160 ) -> Self::RegisterTargetHandlerResponseFut {
6161 fn _decode(
6162 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6163 ) -> Result<PeerManagerRegisterTargetHandlerResult, fidl::Error> {
6164 let _response = fidl::client::decode_transaction_body::<
6165 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6166 fidl::encoding::DefaultFuchsiaResourceDialect,
6167 0x4bc919acb791bdb3,
6168 >(_buf?)?;
6169 Ok(_response.map(|x| x))
6170 }
6171 self.client.send_query_and_decode::<
6172 PeerManagerRegisterTargetHandlerRequest,
6173 PeerManagerRegisterTargetHandlerResult,
6174 >(
6175 (handler,),
6176 0x4bc919acb791bdb3,
6177 fidl::encoding::DynamicFlags::empty(),
6178 _decode,
6179 )
6180 }
6181}
6182
6183pub struct PeerManagerEventStream {
6184 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6185}
6186
6187impl std::marker::Unpin for PeerManagerEventStream {}
6188
6189impl futures::stream::FusedStream for PeerManagerEventStream {
6190 fn is_terminated(&self) -> bool {
6191 self.event_receiver.is_terminated()
6192 }
6193}
6194
6195impl futures::Stream for PeerManagerEventStream {
6196 type Item = Result<PeerManagerEvent, fidl::Error>;
6197
6198 fn poll_next(
6199 mut self: std::pin::Pin<&mut Self>,
6200 cx: &mut std::task::Context<'_>,
6201 ) -> std::task::Poll<Option<Self::Item>> {
6202 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6203 &mut self.event_receiver,
6204 cx
6205 )?) {
6206 Some(buf) => std::task::Poll::Ready(Some(PeerManagerEvent::decode(buf))),
6207 None => std::task::Poll::Ready(None),
6208 }
6209 }
6210}
6211
6212#[derive(Debug)]
6213pub enum PeerManagerEvent {}
6214
6215impl PeerManagerEvent {
6216 fn decode(
6218 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6219 ) -> Result<PeerManagerEvent, fidl::Error> {
6220 let (bytes, _handles) = buf.split_mut();
6221 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6222 debug_assert_eq!(tx_header.tx_id, 0);
6223 match tx_header.ordinal {
6224 _ => Err(fidl::Error::UnknownOrdinal {
6225 ordinal: tx_header.ordinal,
6226 protocol_name: <PeerManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6227 }),
6228 }
6229 }
6230}
6231
6232pub struct PeerManagerRequestStream {
6234 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6235 is_terminated: bool,
6236}
6237
6238impl std::marker::Unpin for PeerManagerRequestStream {}
6239
6240impl futures::stream::FusedStream for PeerManagerRequestStream {
6241 fn is_terminated(&self) -> bool {
6242 self.is_terminated
6243 }
6244}
6245
6246impl fidl::endpoints::RequestStream for PeerManagerRequestStream {
6247 type Protocol = PeerManagerMarker;
6248 type ControlHandle = PeerManagerControlHandle;
6249
6250 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6251 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6252 }
6253
6254 fn control_handle(&self) -> Self::ControlHandle {
6255 PeerManagerControlHandle { inner: self.inner.clone() }
6256 }
6257
6258 fn into_inner(
6259 self,
6260 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6261 {
6262 (self.inner, self.is_terminated)
6263 }
6264
6265 fn from_inner(
6266 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6267 is_terminated: bool,
6268 ) -> Self {
6269 Self { inner, is_terminated }
6270 }
6271}
6272
6273impl futures::Stream for PeerManagerRequestStream {
6274 type Item = Result<PeerManagerRequest, fidl::Error>;
6275
6276 fn poll_next(
6277 mut self: std::pin::Pin<&mut Self>,
6278 cx: &mut std::task::Context<'_>,
6279 ) -> std::task::Poll<Option<Self::Item>> {
6280 let this = &mut *self;
6281 if this.inner.check_shutdown(cx) {
6282 this.is_terminated = true;
6283 return std::task::Poll::Ready(None);
6284 }
6285 if this.is_terminated {
6286 panic!("polled PeerManagerRequestStream after completion");
6287 }
6288 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6289 |bytes, handles| {
6290 match this.inner.channel().read_etc(cx, bytes, handles) {
6291 std::task::Poll::Ready(Ok(())) => {}
6292 std::task::Poll::Pending => return std::task::Poll::Pending,
6293 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6294 this.is_terminated = true;
6295 return std::task::Poll::Ready(None);
6296 }
6297 std::task::Poll::Ready(Err(e)) => {
6298 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6299 e.into(),
6300 ))))
6301 }
6302 }
6303
6304 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6306
6307 std::task::Poll::Ready(Some(match header.ordinal {
6308 0x5b75bbb8d58a6d49 => {
6309 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6310 let mut req = fidl::new_empty!(
6311 PeerManagerGetBrowseControllerForTargetRequest,
6312 fidl::encoding::DefaultFuchsiaResourceDialect
6313 );
6314 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PeerManagerGetBrowseControllerForTargetRequest>(&header, _body_bytes, handles, &mut req)?;
6315 let control_handle = PeerManagerControlHandle { inner: this.inner.clone() };
6316 Ok(PeerManagerRequest::GetBrowseControllerForTarget {
6317 peer_id: req.peer_id,
6318 client: req.client,
6319
6320 responder: PeerManagerGetBrowseControllerForTargetResponder {
6321 control_handle: std::mem::ManuallyDrop::new(control_handle),
6322 tx_id: header.tx_id,
6323 },
6324 })
6325 }
6326 0x25d36e51516bc3b4 => {
6327 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6328 let mut req = fidl::new_empty!(
6329 PeerManagerGetControllerForTargetRequest,
6330 fidl::encoding::DefaultFuchsiaResourceDialect
6331 );
6332 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PeerManagerGetControllerForTargetRequest>(&header, _body_bytes, handles, &mut req)?;
6333 let control_handle = PeerManagerControlHandle { inner: this.inner.clone() };
6334 Ok(PeerManagerRequest::GetControllerForTarget {
6335 peer_id: req.peer_id,
6336 client: req.client,
6337
6338 responder: PeerManagerGetControllerForTargetResponder {
6339 control_handle: std::mem::ManuallyDrop::new(control_handle),
6340 tx_id: header.tx_id,
6341 },
6342 })
6343 }
6344 0x39a465c63e9f918c => {
6345 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6346 let mut req = fidl::new_empty!(
6347 PeerManagerSetAbsoluteVolumeHandlerRequest,
6348 fidl::encoding::DefaultFuchsiaResourceDialect
6349 );
6350 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PeerManagerSetAbsoluteVolumeHandlerRequest>(&header, _body_bytes, handles, &mut req)?;
6351 let control_handle = PeerManagerControlHandle { inner: this.inner.clone() };
6352 Ok(PeerManagerRequest::SetAbsoluteVolumeHandler {
6353 handler: req.handler,
6354
6355 responder: PeerManagerSetAbsoluteVolumeHandlerResponder {
6356 control_handle: std::mem::ManuallyDrop::new(control_handle),
6357 tx_id: header.tx_id,
6358 },
6359 })
6360 }
6361 0x4bc919acb791bdb3 => {
6362 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6363 let mut req = fidl::new_empty!(
6364 PeerManagerRegisterTargetHandlerRequest,
6365 fidl::encoding::DefaultFuchsiaResourceDialect
6366 );
6367 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PeerManagerRegisterTargetHandlerRequest>(&header, _body_bytes, handles, &mut req)?;
6368 let control_handle = PeerManagerControlHandle { inner: this.inner.clone() };
6369 Ok(PeerManagerRequest::RegisterTargetHandler {
6370 handler: req.handler,
6371
6372 responder: PeerManagerRegisterTargetHandlerResponder {
6373 control_handle: std::mem::ManuallyDrop::new(control_handle),
6374 tx_id: header.tx_id,
6375 },
6376 })
6377 }
6378 _ => Err(fidl::Error::UnknownOrdinal {
6379 ordinal: header.ordinal,
6380 protocol_name:
6381 <PeerManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6382 }),
6383 }))
6384 },
6385 )
6386 }
6387}
6388
6389#[derive(Debug)]
6390pub enum PeerManagerRequest {
6391 GetBrowseControllerForTarget {
6394 peer_id: fidl_fuchsia_bluetooth::PeerId,
6395 client: fidl::endpoints::ServerEnd<BrowseControllerMarker>,
6396 responder: PeerManagerGetBrowseControllerForTargetResponder,
6397 },
6398 GetControllerForTarget {
6401 peer_id: fidl_fuchsia_bluetooth::PeerId,
6402 client: fidl::endpoints::ServerEnd<ControllerMarker>,
6403 responder: PeerManagerGetControllerForTargetResponder,
6404 },
6405 SetAbsoluteVolumeHandler {
6409 handler: fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
6410 responder: PeerManagerSetAbsoluteVolumeHandlerResponder,
6411 },
6412 RegisterTargetHandler {
6415 handler: fidl::endpoints::ClientEnd<TargetHandlerMarker>,
6416 responder: PeerManagerRegisterTargetHandlerResponder,
6417 },
6418}
6419
6420impl PeerManagerRequest {
6421 #[allow(irrefutable_let_patterns)]
6422 pub fn into_get_browse_controller_for_target(
6423 self,
6424 ) -> Option<(
6425 fidl_fuchsia_bluetooth::PeerId,
6426 fidl::endpoints::ServerEnd<BrowseControllerMarker>,
6427 PeerManagerGetBrowseControllerForTargetResponder,
6428 )> {
6429 if let PeerManagerRequest::GetBrowseControllerForTarget { peer_id, client, responder } =
6430 self
6431 {
6432 Some((peer_id, client, responder))
6433 } else {
6434 None
6435 }
6436 }
6437
6438 #[allow(irrefutable_let_patterns)]
6439 pub fn into_get_controller_for_target(
6440 self,
6441 ) -> Option<(
6442 fidl_fuchsia_bluetooth::PeerId,
6443 fidl::endpoints::ServerEnd<ControllerMarker>,
6444 PeerManagerGetControllerForTargetResponder,
6445 )> {
6446 if let PeerManagerRequest::GetControllerForTarget { peer_id, client, responder } = self {
6447 Some((peer_id, client, responder))
6448 } else {
6449 None
6450 }
6451 }
6452
6453 #[allow(irrefutable_let_patterns)]
6454 pub fn into_set_absolute_volume_handler(
6455 self,
6456 ) -> Option<(
6457 fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
6458 PeerManagerSetAbsoluteVolumeHandlerResponder,
6459 )> {
6460 if let PeerManagerRequest::SetAbsoluteVolumeHandler { handler, responder } = self {
6461 Some((handler, responder))
6462 } else {
6463 None
6464 }
6465 }
6466
6467 #[allow(irrefutable_let_patterns)]
6468 pub fn into_register_target_handler(
6469 self,
6470 ) -> Option<(
6471 fidl::endpoints::ClientEnd<TargetHandlerMarker>,
6472 PeerManagerRegisterTargetHandlerResponder,
6473 )> {
6474 if let PeerManagerRequest::RegisterTargetHandler { handler, responder } = self {
6475 Some((handler, responder))
6476 } else {
6477 None
6478 }
6479 }
6480
6481 pub fn method_name(&self) -> &'static str {
6483 match *self {
6484 PeerManagerRequest::GetBrowseControllerForTarget { .. } => {
6485 "get_browse_controller_for_target"
6486 }
6487 PeerManagerRequest::GetControllerForTarget { .. } => "get_controller_for_target",
6488 PeerManagerRequest::SetAbsoluteVolumeHandler { .. } => "set_absolute_volume_handler",
6489 PeerManagerRequest::RegisterTargetHandler { .. } => "register_target_handler",
6490 }
6491 }
6492}
6493
6494#[derive(Debug, Clone)]
6495pub struct PeerManagerControlHandle {
6496 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6497}
6498
6499impl fidl::endpoints::ControlHandle for PeerManagerControlHandle {
6500 fn shutdown(&self) {
6501 self.inner.shutdown()
6502 }
6503 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
6504 self.inner.shutdown_with_epitaph(status)
6505 }
6506
6507 fn is_closed(&self) -> bool {
6508 self.inner.channel().is_closed()
6509 }
6510 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
6511 self.inner.channel().on_closed()
6512 }
6513
6514 #[cfg(target_os = "fuchsia")]
6515 fn signal_peer(
6516 &self,
6517 clear_mask: zx::Signals,
6518 set_mask: zx::Signals,
6519 ) -> Result<(), zx_status::Status> {
6520 use fidl::Peered;
6521 self.inner.channel().signal_peer(clear_mask, set_mask)
6522 }
6523}
6524
6525impl PeerManagerControlHandle {}
6526
6527#[must_use = "FIDL methods require a response to be sent"]
6528#[derive(Debug)]
6529pub struct PeerManagerGetBrowseControllerForTargetResponder {
6530 control_handle: std::mem::ManuallyDrop<PeerManagerControlHandle>,
6531 tx_id: u32,
6532}
6533
6534impl std::ops::Drop for PeerManagerGetBrowseControllerForTargetResponder {
6538 fn drop(&mut self) {
6539 self.control_handle.shutdown();
6540 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6542 }
6543}
6544
6545impl fidl::endpoints::Responder for PeerManagerGetBrowseControllerForTargetResponder {
6546 type ControlHandle = PeerManagerControlHandle;
6547
6548 fn control_handle(&self) -> &PeerManagerControlHandle {
6549 &self.control_handle
6550 }
6551
6552 fn drop_without_shutdown(mut self) {
6553 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6555 std::mem::forget(self);
6557 }
6558}
6559
6560impl PeerManagerGetBrowseControllerForTargetResponder {
6561 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6565 let _result = self.send_raw(result);
6566 if _result.is_err() {
6567 self.control_handle.shutdown();
6568 }
6569 self.drop_without_shutdown();
6570 _result
6571 }
6572
6573 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6575 let _result = self.send_raw(result);
6576 self.drop_without_shutdown();
6577 _result
6578 }
6579
6580 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6581 self.control_handle
6582 .inner
6583 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6584 result,
6585 self.tx_id,
6586 0x5b75bbb8d58a6d49,
6587 fidl::encoding::DynamicFlags::empty(),
6588 )
6589 }
6590}
6591
6592#[must_use = "FIDL methods require a response to be sent"]
6593#[derive(Debug)]
6594pub struct PeerManagerGetControllerForTargetResponder {
6595 control_handle: std::mem::ManuallyDrop<PeerManagerControlHandle>,
6596 tx_id: u32,
6597}
6598
6599impl std::ops::Drop for PeerManagerGetControllerForTargetResponder {
6603 fn drop(&mut self) {
6604 self.control_handle.shutdown();
6605 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6607 }
6608}
6609
6610impl fidl::endpoints::Responder for PeerManagerGetControllerForTargetResponder {
6611 type ControlHandle = PeerManagerControlHandle;
6612
6613 fn control_handle(&self) -> &PeerManagerControlHandle {
6614 &self.control_handle
6615 }
6616
6617 fn drop_without_shutdown(mut self) {
6618 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6620 std::mem::forget(self);
6622 }
6623}
6624
6625impl PeerManagerGetControllerForTargetResponder {
6626 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6630 let _result = self.send_raw(result);
6631 if _result.is_err() {
6632 self.control_handle.shutdown();
6633 }
6634 self.drop_without_shutdown();
6635 _result
6636 }
6637
6638 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6640 let _result = self.send_raw(result);
6641 self.drop_without_shutdown();
6642 _result
6643 }
6644
6645 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6646 self.control_handle
6647 .inner
6648 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6649 result,
6650 self.tx_id,
6651 0x25d36e51516bc3b4,
6652 fidl::encoding::DynamicFlags::empty(),
6653 )
6654 }
6655}
6656
6657#[must_use = "FIDL methods require a response to be sent"]
6658#[derive(Debug)]
6659pub struct PeerManagerSetAbsoluteVolumeHandlerResponder {
6660 control_handle: std::mem::ManuallyDrop<PeerManagerControlHandle>,
6661 tx_id: u32,
6662}
6663
6664impl std::ops::Drop for PeerManagerSetAbsoluteVolumeHandlerResponder {
6668 fn drop(&mut self) {
6669 self.control_handle.shutdown();
6670 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6672 }
6673}
6674
6675impl fidl::endpoints::Responder for PeerManagerSetAbsoluteVolumeHandlerResponder {
6676 type ControlHandle = PeerManagerControlHandle;
6677
6678 fn control_handle(&self) -> &PeerManagerControlHandle {
6679 &self.control_handle
6680 }
6681
6682 fn drop_without_shutdown(mut self) {
6683 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6685 std::mem::forget(self);
6687 }
6688}
6689
6690impl PeerManagerSetAbsoluteVolumeHandlerResponder {
6691 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6695 let _result = self.send_raw(result);
6696 if _result.is_err() {
6697 self.control_handle.shutdown();
6698 }
6699 self.drop_without_shutdown();
6700 _result
6701 }
6702
6703 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6705 let _result = self.send_raw(result);
6706 self.drop_without_shutdown();
6707 _result
6708 }
6709
6710 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6711 self.control_handle
6712 .inner
6713 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6714 result,
6715 self.tx_id,
6716 0x39a465c63e9f918c,
6717 fidl::encoding::DynamicFlags::empty(),
6718 )
6719 }
6720}
6721
6722#[must_use = "FIDL methods require a response to be sent"]
6723#[derive(Debug)]
6724pub struct PeerManagerRegisterTargetHandlerResponder {
6725 control_handle: std::mem::ManuallyDrop<PeerManagerControlHandle>,
6726 tx_id: u32,
6727}
6728
6729impl std::ops::Drop for PeerManagerRegisterTargetHandlerResponder {
6733 fn drop(&mut self) {
6734 self.control_handle.shutdown();
6735 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6737 }
6738}
6739
6740impl fidl::endpoints::Responder for PeerManagerRegisterTargetHandlerResponder {
6741 type ControlHandle = PeerManagerControlHandle;
6742
6743 fn control_handle(&self) -> &PeerManagerControlHandle {
6744 &self.control_handle
6745 }
6746
6747 fn drop_without_shutdown(mut self) {
6748 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
6750 std::mem::forget(self);
6752 }
6753}
6754
6755impl PeerManagerRegisterTargetHandlerResponder {
6756 pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6760 let _result = self.send_raw(result);
6761 if _result.is_err() {
6762 self.control_handle.shutdown();
6763 }
6764 self.drop_without_shutdown();
6765 _result
6766 }
6767
6768 pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6770 let _result = self.send_raw(result);
6771 self.drop_without_shutdown();
6772 _result
6773 }
6774
6775 fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
6776 self.control_handle
6777 .inner
6778 .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
6779 result,
6780 self.tx_id,
6781 0x4bc919acb791bdb3,
6782 fidl::encoding::DynamicFlags::empty(),
6783 )
6784 }
6785}
6786
6787#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
6788pub struct TargetHandlerMarker;
6789
6790impl fidl::endpoints::ProtocolMarker for TargetHandlerMarker {
6791 type Proxy = TargetHandlerProxy;
6792 type RequestStream = TargetHandlerRequestStream;
6793 #[cfg(target_os = "fuchsia")]
6794 type SynchronousProxy = TargetHandlerSynchronousProxy;
6795
6796 const DEBUG_NAME: &'static str = "(anonymous) TargetHandler";
6797}
6798pub type TargetHandlerGetEventsSupportedResult = Result<Vec<NotificationEvent>, TargetAvcError>;
6799pub type TargetHandlerGetMediaAttributesResult = Result<MediaAttributes, TargetAvcError>;
6800pub type TargetHandlerGetPlayStatusResult = Result<PlayStatus, TargetAvcError>;
6801pub type TargetHandlerSendCommandResult = Result<(), TargetPassthroughError>;
6802pub type TargetHandlerListPlayerApplicationSettingAttributesResult =
6803 Result<Vec<PlayerApplicationSettingAttributeId>, TargetAvcError>;
6804pub type TargetHandlerGetPlayerApplicationSettingsResult =
6805 Result<PlayerApplicationSettings, TargetAvcError>;
6806pub type TargetHandlerSetPlayerApplicationSettingsResult =
6807 Result<PlayerApplicationSettings, TargetAvcError>;
6808pub type TargetHandlerGetNotificationResult = Result<Notification, TargetAvcError>;
6809pub type TargetHandlerWatchNotificationResult = Result<Notification, TargetAvcError>;
6810pub type TargetHandlerSetAddressedPlayerResult = Result<(), TargetAvcError>;
6811pub type TargetHandlerGetMediaPlayerItemsResult = Result<Vec<MediaPlayerItem>, TargetAvcError>;
6812
6813pub trait TargetHandlerProxyInterface: Send + Sync {
6814 type GetEventsSupportedResponseFut: std::future::Future<Output = Result<TargetHandlerGetEventsSupportedResult, fidl::Error>>
6815 + Send;
6816 fn r#get_events_supported(&self) -> Self::GetEventsSupportedResponseFut;
6817 type GetMediaAttributesResponseFut: std::future::Future<Output = Result<TargetHandlerGetMediaAttributesResult, fidl::Error>>
6818 + Send;
6819 fn r#get_media_attributes(&self) -> Self::GetMediaAttributesResponseFut;
6820 type GetPlayStatusResponseFut: std::future::Future<Output = Result<TargetHandlerGetPlayStatusResult, fidl::Error>>
6821 + Send;
6822 fn r#get_play_status(&self) -> Self::GetPlayStatusResponseFut;
6823 type SendCommandResponseFut: std::future::Future<Output = Result<TargetHandlerSendCommandResult, fidl::Error>>
6824 + Send;
6825 fn r#send_command(
6826 &self,
6827 command: AvcPanelCommand,
6828 pressed: bool,
6829 ) -> Self::SendCommandResponseFut;
6830 type ListPlayerApplicationSettingAttributesResponseFut: std::future::Future<
6831 Output = Result<TargetHandlerListPlayerApplicationSettingAttributesResult, fidl::Error>,
6832 > + Send;
6833 fn r#list_player_application_setting_attributes(
6834 &self,
6835 ) -> Self::ListPlayerApplicationSettingAttributesResponseFut;
6836 type GetPlayerApplicationSettingsResponseFut: std::future::Future<
6837 Output = Result<TargetHandlerGetPlayerApplicationSettingsResult, fidl::Error>,
6838 > + Send;
6839 fn r#get_player_application_settings(
6840 &self,
6841 attribute_ids: &[PlayerApplicationSettingAttributeId],
6842 ) -> Self::GetPlayerApplicationSettingsResponseFut;
6843 type SetPlayerApplicationSettingsResponseFut: std::future::Future<
6844 Output = Result<TargetHandlerSetPlayerApplicationSettingsResult, fidl::Error>,
6845 > + Send;
6846 fn r#set_player_application_settings(
6847 &self,
6848 requested_settings: &PlayerApplicationSettings,
6849 ) -> Self::SetPlayerApplicationSettingsResponseFut;
6850 type GetNotificationResponseFut: std::future::Future<Output = Result<TargetHandlerGetNotificationResult, fidl::Error>>
6851 + Send;
6852 fn r#get_notification(&self, event_id: NotificationEvent) -> Self::GetNotificationResponseFut;
6853 type WatchNotificationResponseFut: std::future::Future<Output = Result<TargetHandlerWatchNotificationResult, fidl::Error>>
6854 + Send;
6855 fn r#watch_notification(
6856 &self,
6857 event_id: NotificationEvent,
6858 current: &Notification,
6859 pos_change_interval: u32,
6860 ) -> Self::WatchNotificationResponseFut;
6861 type SetAddressedPlayerResponseFut: std::future::Future<Output = Result<TargetHandlerSetAddressedPlayerResult, fidl::Error>>
6862 + Send;
6863 fn r#set_addressed_player(
6864 &self,
6865 player_id: &AddressedPlayerId,
6866 ) -> Self::SetAddressedPlayerResponseFut;
6867 type GetMediaPlayerItemsResponseFut: std::future::Future<Output = Result<TargetHandlerGetMediaPlayerItemsResult, fidl::Error>>
6868 + Send;
6869 fn r#get_media_player_items(&self) -> Self::GetMediaPlayerItemsResponseFut;
6870}
6871#[derive(Debug)]
6872#[cfg(target_os = "fuchsia")]
6873pub struct TargetHandlerSynchronousProxy {
6874 client: fidl::client::sync::Client,
6875}
6876
6877#[cfg(target_os = "fuchsia")]
6878impl fidl::endpoints::SynchronousProxy for TargetHandlerSynchronousProxy {
6879 type Proxy = TargetHandlerProxy;
6880 type Protocol = TargetHandlerMarker;
6881
6882 fn from_channel(inner: fidl::Channel) -> Self {
6883 Self::new(inner)
6884 }
6885
6886 fn into_channel(self) -> fidl::Channel {
6887 self.client.into_channel()
6888 }
6889
6890 fn as_channel(&self) -> &fidl::Channel {
6891 self.client.as_channel()
6892 }
6893}
6894
6895#[cfg(target_os = "fuchsia")]
6896impl TargetHandlerSynchronousProxy {
6897 pub fn new(channel: fidl::Channel) -> Self {
6898 let protocol_name = <TargetHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
6899 Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
6900 }
6901
6902 pub fn into_channel(self) -> fidl::Channel {
6903 self.client.into_channel()
6904 }
6905
6906 pub fn wait_for_event(
6909 &self,
6910 deadline: zx::MonotonicInstant,
6911 ) -> Result<TargetHandlerEvent, fidl::Error> {
6912 TargetHandlerEvent::decode(self.client.wait_for_event(deadline)?)
6913 }
6914
6915 pub fn r#get_events_supported(
6917 &self,
6918 ___deadline: zx::MonotonicInstant,
6919 ) -> Result<TargetHandlerGetEventsSupportedResult, fidl::Error> {
6920 let _response =
6921 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
6922 TargetHandlerGetEventsSupportedResponse,
6923 TargetAvcError,
6924 >>(
6925 (),
6926 0x54bb8d817d5e1257,
6927 fidl::encoding::DynamicFlags::empty(),
6928 ___deadline,
6929 )?;
6930 Ok(_response.map(|x| x.notification_ids))
6931 }
6932
6933 pub fn r#get_media_attributes(
6937 &self,
6938 ___deadline: zx::MonotonicInstant,
6939 ) -> Result<TargetHandlerGetMediaAttributesResult, fidl::Error> {
6940 let _response =
6941 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
6942 TargetHandlerGetMediaAttributesResponse,
6943 TargetAvcError,
6944 >>(
6945 (),
6946 0x629f354d2805daf5,
6947 fidl::encoding::DynamicFlags::empty(),
6948 ___deadline,
6949 )?;
6950 Ok(_response.map(|x| x.attributes))
6951 }
6952
6953 pub fn r#get_play_status(
6955 &self,
6956 ___deadline: zx::MonotonicInstant,
6957 ) -> Result<TargetHandlerGetPlayStatusResult, fidl::Error> {
6958 let _response =
6959 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
6960 TargetHandlerGetPlayStatusResponse,
6961 TargetAvcError,
6962 >>(
6963 (),
6964 0x24a4816300e14d89,
6965 fidl::encoding::DynamicFlags::empty(),
6966 ___deadline,
6967 )?;
6968 Ok(_response.map(|x| x.play_status))
6969 }
6970
6971 pub fn r#send_command(
6975 &self,
6976 mut command: AvcPanelCommand,
6977 mut pressed: bool,
6978 ___deadline: zx::MonotonicInstant,
6979 ) -> Result<TargetHandlerSendCommandResult, fidl::Error> {
6980 let _response =
6981 self.client.send_query::<TargetHandlerSendCommandRequest, fidl::encoding::ResultType<
6982 fidl::encoding::EmptyStruct,
6983 TargetPassthroughError,
6984 >>(
6985 (command, pressed),
6986 0x69e063a8f6ab7b87,
6987 fidl::encoding::DynamicFlags::empty(),
6988 ___deadline,
6989 )?;
6990 Ok(_response.map(|x| x))
6991 }
6992
6993 pub fn r#list_player_application_setting_attributes(
6996 &self,
6997 ___deadline: zx::MonotonicInstant,
6998 ) -> Result<TargetHandlerListPlayerApplicationSettingAttributesResult, fidl::Error> {
6999 let _response =
7000 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
7001 TargetHandlerListPlayerApplicationSettingAttributesResponse,
7002 TargetAvcError,
7003 >>(
7004 (), 0xdfa38da6a60b2, fidl::encoding::DynamicFlags::empty(), ___deadline
7005 )?;
7006 Ok(_response.map(|x| x.attributes))
7007 }
7008
7009 pub fn r#get_player_application_settings(
7013 &self,
7014 mut attribute_ids: &[PlayerApplicationSettingAttributeId],
7015 ___deadline: zx::MonotonicInstant,
7016 ) -> Result<TargetHandlerGetPlayerApplicationSettingsResult, fidl::Error> {
7017 let _response = self.client.send_query::<
7018 TargetHandlerGetPlayerApplicationSettingsRequest,
7019 fidl::encoding::ResultType<TargetHandlerGetPlayerApplicationSettingsResponse, TargetAvcError>,
7020 >(
7021 (attribute_ids,),
7022 0x4273f96bdb752751,
7023 fidl::encoding::DynamicFlags::empty(),
7024 ___deadline,
7025 )?;
7026 Ok(_response.map(|x| x.current_settings))
7027 }
7028
7029 pub fn r#set_player_application_settings(
7037 &self,
7038 mut requested_settings: &PlayerApplicationSettings,
7039 ___deadline: zx::MonotonicInstant,
7040 ) -> Result<TargetHandlerSetPlayerApplicationSettingsResult, fidl::Error> {
7041 let _response = self.client.send_query::<
7042 TargetHandlerSetPlayerApplicationSettingsRequest,
7043 fidl::encoding::ResultType<TargetHandlerSetPlayerApplicationSettingsResponse, TargetAvcError>,
7044 >(
7045 (requested_settings,),
7046 0x636dd18255e01998,
7047 fidl::encoding::DynamicFlags::empty(),
7048 ___deadline,
7049 )?;
7050 Ok(_response.map(|x| x.set_settings))
7051 }
7052
7053 pub fn r#get_notification(
7055 &self,
7056 mut event_id: NotificationEvent,
7057 ___deadline: zx::MonotonicInstant,
7058 ) -> Result<TargetHandlerGetNotificationResult, fidl::Error> {
7059 let _response = self.client.send_query::<
7060 TargetHandlerGetNotificationRequest,
7061 fidl::encoding::ResultType<TargetHandlerGetNotificationResponse, TargetAvcError>,
7062 >(
7063 (event_id,),
7064 0x60c7792539a032f1,
7065 fidl::encoding::DynamicFlags::empty(),
7066 ___deadline,
7067 )?;
7068 Ok(_response.map(|x| x.current_value))
7069 }
7070
7071 pub fn r#watch_notification(
7077 &self,
7078 mut event_id: NotificationEvent,
7079 mut current: &Notification,
7080 mut pos_change_interval: u32,
7081 ___deadline: zx::MonotonicInstant,
7082 ) -> Result<TargetHandlerWatchNotificationResult, fidl::Error> {
7083 let _response =
7084 self.client
7085 .send_query::<TargetHandlerWatchNotificationRequest, fidl::encoding::ResultType<
7086 TargetHandlerWatchNotificationResponse,
7087 TargetAvcError,
7088 >>(
7089 (event_id, current, pos_change_interval),
7090 0x2a513434cf256e5f,
7091 fidl::encoding::DynamicFlags::empty(),
7092 ___deadline,
7093 )?;
7094 Ok(_response.map(|x| x.new_value))
7095 }
7096
7097 pub fn r#set_addressed_player(
7099 &self,
7100 mut player_id: &AddressedPlayerId,
7101 ___deadline: zx::MonotonicInstant,
7102 ) -> Result<TargetHandlerSetAddressedPlayerResult, fidl::Error> {
7103 let _response = self.client.send_query::<
7104 TargetHandlerSetAddressedPlayerRequest,
7105 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, TargetAvcError>,
7106 >(
7107 (player_id,),
7108 0x6724ae8288c34d2f,
7109 fidl::encoding::DynamicFlags::empty(),
7110 ___deadline,
7111 )?;
7112 Ok(_response.map(|x| x))
7113 }
7114
7115 pub fn r#get_media_player_items(
7117 &self,
7118 ___deadline: zx::MonotonicInstant,
7119 ) -> Result<TargetHandlerGetMediaPlayerItemsResult, fidl::Error> {
7120 let _response =
7121 self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
7122 TargetHandlerGetMediaPlayerItemsResponse,
7123 TargetAvcError,
7124 >>(
7125 (),
7126 0x736668f5aa3a8246,
7127 fidl::encoding::DynamicFlags::empty(),
7128 ___deadline,
7129 )?;
7130 Ok(_response.map(|x| x.items))
7131 }
7132}
7133
7134#[derive(Debug, Clone)]
7135pub struct TargetHandlerProxy {
7136 client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
7137}
7138
7139impl fidl::endpoints::Proxy for TargetHandlerProxy {
7140 type Protocol = TargetHandlerMarker;
7141
7142 fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
7143 Self::new(inner)
7144 }
7145
7146 fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
7147 self.client.into_channel().map_err(|client| Self { client })
7148 }
7149
7150 fn as_channel(&self) -> &::fidl::AsyncChannel {
7151 self.client.as_channel()
7152 }
7153}
7154
7155impl TargetHandlerProxy {
7156 pub fn new(channel: ::fidl::AsyncChannel) -> Self {
7158 let protocol_name = <TargetHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
7159 Self { client: fidl::client::Client::new(channel, protocol_name) }
7160 }
7161
7162 pub fn take_event_stream(&self) -> TargetHandlerEventStream {
7168 TargetHandlerEventStream { event_receiver: self.client.take_event_receiver() }
7169 }
7170
7171 pub fn r#get_events_supported(
7173 &self,
7174 ) -> fidl::client::QueryResponseFut<
7175 TargetHandlerGetEventsSupportedResult,
7176 fidl::encoding::DefaultFuchsiaResourceDialect,
7177 > {
7178 TargetHandlerProxyInterface::r#get_events_supported(self)
7179 }
7180
7181 pub fn r#get_media_attributes(
7185 &self,
7186 ) -> fidl::client::QueryResponseFut<
7187 TargetHandlerGetMediaAttributesResult,
7188 fidl::encoding::DefaultFuchsiaResourceDialect,
7189 > {
7190 TargetHandlerProxyInterface::r#get_media_attributes(self)
7191 }
7192
7193 pub fn r#get_play_status(
7195 &self,
7196 ) -> fidl::client::QueryResponseFut<
7197 TargetHandlerGetPlayStatusResult,
7198 fidl::encoding::DefaultFuchsiaResourceDialect,
7199 > {
7200 TargetHandlerProxyInterface::r#get_play_status(self)
7201 }
7202
7203 pub fn r#send_command(
7207 &self,
7208 mut command: AvcPanelCommand,
7209 mut pressed: bool,
7210 ) -> fidl::client::QueryResponseFut<
7211 TargetHandlerSendCommandResult,
7212 fidl::encoding::DefaultFuchsiaResourceDialect,
7213 > {
7214 TargetHandlerProxyInterface::r#send_command(self, command, pressed)
7215 }
7216
7217 pub fn r#list_player_application_setting_attributes(
7220 &self,
7221 ) -> fidl::client::QueryResponseFut<
7222 TargetHandlerListPlayerApplicationSettingAttributesResult,
7223 fidl::encoding::DefaultFuchsiaResourceDialect,
7224 > {
7225 TargetHandlerProxyInterface::r#list_player_application_setting_attributes(self)
7226 }
7227
7228 pub fn r#get_player_application_settings(
7232 &self,
7233 mut attribute_ids: &[PlayerApplicationSettingAttributeId],
7234 ) -> fidl::client::QueryResponseFut<
7235 TargetHandlerGetPlayerApplicationSettingsResult,
7236 fidl::encoding::DefaultFuchsiaResourceDialect,
7237 > {
7238 TargetHandlerProxyInterface::r#get_player_application_settings(self, attribute_ids)
7239 }
7240
7241 pub fn r#set_player_application_settings(
7249 &self,
7250 mut requested_settings: &PlayerApplicationSettings,
7251 ) -> fidl::client::QueryResponseFut<
7252 TargetHandlerSetPlayerApplicationSettingsResult,
7253 fidl::encoding::DefaultFuchsiaResourceDialect,
7254 > {
7255 TargetHandlerProxyInterface::r#set_player_application_settings(self, requested_settings)
7256 }
7257
7258 pub fn r#get_notification(
7260 &self,
7261 mut event_id: NotificationEvent,
7262 ) -> fidl::client::QueryResponseFut<
7263 TargetHandlerGetNotificationResult,
7264 fidl::encoding::DefaultFuchsiaResourceDialect,
7265 > {
7266 TargetHandlerProxyInterface::r#get_notification(self, event_id)
7267 }
7268
7269 pub fn r#watch_notification(
7275 &self,
7276 mut event_id: NotificationEvent,
7277 mut current: &Notification,
7278 mut pos_change_interval: u32,
7279 ) -> fidl::client::QueryResponseFut<
7280 TargetHandlerWatchNotificationResult,
7281 fidl::encoding::DefaultFuchsiaResourceDialect,
7282 > {
7283 TargetHandlerProxyInterface::r#watch_notification(
7284 self,
7285 event_id,
7286 current,
7287 pos_change_interval,
7288 )
7289 }
7290
7291 pub fn r#set_addressed_player(
7293 &self,
7294 mut player_id: &AddressedPlayerId,
7295 ) -> fidl::client::QueryResponseFut<
7296 TargetHandlerSetAddressedPlayerResult,
7297 fidl::encoding::DefaultFuchsiaResourceDialect,
7298 > {
7299 TargetHandlerProxyInterface::r#set_addressed_player(self, player_id)
7300 }
7301
7302 pub fn r#get_media_player_items(
7304 &self,
7305 ) -> fidl::client::QueryResponseFut<
7306 TargetHandlerGetMediaPlayerItemsResult,
7307 fidl::encoding::DefaultFuchsiaResourceDialect,
7308 > {
7309 TargetHandlerProxyInterface::r#get_media_player_items(self)
7310 }
7311}
7312
7313impl TargetHandlerProxyInterface for TargetHandlerProxy {
7314 type GetEventsSupportedResponseFut = fidl::client::QueryResponseFut<
7315 TargetHandlerGetEventsSupportedResult,
7316 fidl::encoding::DefaultFuchsiaResourceDialect,
7317 >;
7318 fn r#get_events_supported(&self) -> Self::GetEventsSupportedResponseFut {
7319 fn _decode(
7320 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7321 ) -> Result<TargetHandlerGetEventsSupportedResult, fidl::Error> {
7322 let _response = fidl::client::decode_transaction_body::<
7323 fidl::encoding::ResultType<TargetHandlerGetEventsSupportedResponse, TargetAvcError>,
7324 fidl::encoding::DefaultFuchsiaResourceDialect,
7325 0x54bb8d817d5e1257,
7326 >(_buf?)?;
7327 Ok(_response.map(|x| x.notification_ids))
7328 }
7329 self.client.send_query_and_decode::<
7330 fidl::encoding::EmptyPayload,
7331 TargetHandlerGetEventsSupportedResult,
7332 >(
7333 (),
7334 0x54bb8d817d5e1257,
7335 fidl::encoding::DynamicFlags::empty(),
7336 _decode,
7337 )
7338 }
7339
7340 type GetMediaAttributesResponseFut = fidl::client::QueryResponseFut<
7341 TargetHandlerGetMediaAttributesResult,
7342 fidl::encoding::DefaultFuchsiaResourceDialect,
7343 >;
7344 fn r#get_media_attributes(&self) -> Self::GetMediaAttributesResponseFut {
7345 fn _decode(
7346 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7347 ) -> Result<TargetHandlerGetMediaAttributesResult, fidl::Error> {
7348 let _response = fidl::client::decode_transaction_body::<
7349 fidl::encoding::ResultType<TargetHandlerGetMediaAttributesResponse, TargetAvcError>,
7350 fidl::encoding::DefaultFuchsiaResourceDialect,
7351 0x629f354d2805daf5,
7352 >(_buf?)?;
7353 Ok(_response.map(|x| x.attributes))
7354 }
7355 self.client.send_query_and_decode::<
7356 fidl::encoding::EmptyPayload,
7357 TargetHandlerGetMediaAttributesResult,
7358 >(
7359 (),
7360 0x629f354d2805daf5,
7361 fidl::encoding::DynamicFlags::empty(),
7362 _decode,
7363 )
7364 }
7365
7366 type GetPlayStatusResponseFut = fidl::client::QueryResponseFut<
7367 TargetHandlerGetPlayStatusResult,
7368 fidl::encoding::DefaultFuchsiaResourceDialect,
7369 >;
7370 fn r#get_play_status(&self) -> Self::GetPlayStatusResponseFut {
7371 fn _decode(
7372 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7373 ) -> Result<TargetHandlerGetPlayStatusResult, fidl::Error> {
7374 let _response = fidl::client::decode_transaction_body::<
7375 fidl::encoding::ResultType<TargetHandlerGetPlayStatusResponse, TargetAvcError>,
7376 fidl::encoding::DefaultFuchsiaResourceDialect,
7377 0x24a4816300e14d89,
7378 >(_buf?)?;
7379 Ok(_response.map(|x| x.play_status))
7380 }
7381 self.client.send_query_and_decode::<
7382 fidl::encoding::EmptyPayload,
7383 TargetHandlerGetPlayStatusResult,
7384 >(
7385 (),
7386 0x24a4816300e14d89,
7387 fidl::encoding::DynamicFlags::empty(),
7388 _decode,
7389 )
7390 }
7391
7392 type SendCommandResponseFut = fidl::client::QueryResponseFut<
7393 TargetHandlerSendCommandResult,
7394 fidl::encoding::DefaultFuchsiaResourceDialect,
7395 >;
7396 fn r#send_command(
7397 &self,
7398 mut command: AvcPanelCommand,
7399 mut pressed: bool,
7400 ) -> Self::SendCommandResponseFut {
7401 fn _decode(
7402 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7403 ) -> Result<TargetHandlerSendCommandResult, fidl::Error> {
7404 let _response = fidl::client::decode_transaction_body::<
7405 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, TargetPassthroughError>,
7406 fidl::encoding::DefaultFuchsiaResourceDialect,
7407 0x69e063a8f6ab7b87,
7408 >(_buf?)?;
7409 Ok(_response.map(|x| x))
7410 }
7411 self.client.send_query_and_decode::<
7412 TargetHandlerSendCommandRequest,
7413 TargetHandlerSendCommandResult,
7414 >(
7415 (command, pressed,),
7416 0x69e063a8f6ab7b87,
7417 fidl::encoding::DynamicFlags::empty(),
7418 _decode,
7419 )
7420 }
7421
7422 type ListPlayerApplicationSettingAttributesResponseFut = fidl::client::QueryResponseFut<
7423 TargetHandlerListPlayerApplicationSettingAttributesResult,
7424 fidl::encoding::DefaultFuchsiaResourceDialect,
7425 >;
7426 fn r#list_player_application_setting_attributes(
7427 &self,
7428 ) -> Self::ListPlayerApplicationSettingAttributesResponseFut {
7429 fn _decode(
7430 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7431 ) -> Result<TargetHandlerListPlayerApplicationSettingAttributesResult, fidl::Error>
7432 {
7433 let _response = fidl::client::decode_transaction_body::<
7434 fidl::encoding::ResultType<
7435 TargetHandlerListPlayerApplicationSettingAttributesResponse,
7436 TargetAvcError,
7437 >,
7438 fidl::encoding::DefaultFuchsiaResourceDialect,
7439 0xdfa38da6a60b2,
7440 >(_buf?)?;
7441 Ok(_response.map(|x| x.attributes))
7442 }
7443 self.client.send_query_and_decode::<
7444 fidl::encoding::EmptyPayload,
7445 TargetHandlerListPlayerApplicationSettingAttributesResult,
7446 >(
7447 (),
7448 0xdfa38da6a60b2,
7449 fidl::encoding::DynamicFlags::empty(),
7450 _decode,
7451 )
7452 }
7453
7454 type GetPlayerApplicationSettingsResponseFut = fidl::client::QueryResponseFut<
7455 TargetHandlerGetPlayerApplicationSettingsResult,
7456 fidl::encoding::DefaultFuchsiaResourceDialect,
7457 >;
7458 fn r#get_player_application_settings(
7459 &self,
7460 mut attribute_ids: &[PlayerApplicationSettingAttributeId],
7461 ) -> Self::GetPlayerApplicationSettingsResponseFut {
7462 fn _decode(
7463 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7464 ) -> Result<TargetHandlerGetPlayerApplicationSettingsResult, fidl::Error> {
7465 let _response = fidl::client::decode_transaction_body::<
7466 fidl::encoding::ResultType<
7467 TargetHandlerGetPlayerApplicationSettingsResponse,
7468 TargetAvcError,
7469 >,
7470 fidl::encoding::DefaultFuchsiaResourceDialect,
7471 0x4273f96bdb752751,
7472 >(_buf?)?;
7473 Ok(_response.map(|x| x.current_settings))
7474 }
7475 self.client.send_query_and_decode::<
7476 TargetHandlerGetPlayerApplicationSettingsRequest,
7477 TargetHandlerGetPlayerApplicationSettingsResult,
7478 >(
7479 (attribute_ids,),
7480 0x4273f96bdb752751,
7481 fidl::encoding::DynamicFlags::empty(),
7482 _decode,
7483 )
7484 }
7485
7486 type SetPlayerApplicationSettingsResponseFut = fidl::client::QueryResponseFut<
7487 TargetHandlerSetPlayerApplicationSettingsResult,
7488 fidl::encoding::DefaultFuchsiaResourceDialect,
7489 >;
7490 fn r#set_player_application_settings(
7491 &self,
7492 mut requested_settings: &PlayerApplicationSettings,
7493 ) -> Self::SetPlayerApplicationSettingsResponseFut {
7494 fn _decode(
7495 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7496 ) -> Result<TargetHandlerSetPlayerApplicationSettingsResult, fidl::Error> {
7497 let _response = fidl::client::decode_transaction_body::<
7498 fidl::encoding::ResultType<
7499 TargetHandlerSetPlayerApplicationSettingsResponse,
7500 TargetAvcError,
7501 >,
7502 fidl::encoding::DefaultFuchsiaResourceDialect,
7503 0x636dd18255e01998,
7504 >(_buf?)?;
7505 Ok(_response.map(|x| x.set_settings))
7506 }
7507 self.client.send_query_and_decode::<
7508 TargetHandlerSetPlayerApplicationSettingsRequest,
7509 TargetHandlerSetPlayerApplicationSettingsResult,
7510 >(
7511 (requested_settings,),
7512 0x636dd18255e01998,
7513 fidl::encoding::DynamicFlags::empty(),
7514 _decode,
7515 )
7516 }
7517
7518 type GetNotificationResponseFut = fidl::client::QueryResponseFut<
7519 TargetHandlerGetNotificationResult,
7520 fidl::encoding::DefaultFuchsiaResourceDialect,
7521 >;
7522 fn r#get_notification(
7523 &self,
7524 mut event_id: NotificationEvent,
7525 ) -> Self::GetNotificationResponseFut {
7526 fn _decode(
7527 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7528 ) -> Result<TargetHandlerGetNotificationResult, fidl::Error> {
7529 let _response = fidl::client::decode_transaction_body::<
7530 fidl::encoding::ResultType<TargetHandlerGetNotificationResponse, TargetAvcError>,
7531 fidl::encoding::DefaultFuchsiaResourceDialect,
7532 0x60c7792539a032f1,
7533 >(_buf?)?;
7534 Ok(_response.map(|x| x.current_value))
7535 }
7536 self.client.send_query_and_decode::<
7537 TargetHandlerGetNotificationRequest,
7538 TargetHandlerGetNotificationResult,
7539 >(
7540 (event_id,),
7541 0x60c7792539a032f1,
7542 fidl::encoding::DynamicFlags::empty(),
7543 _decode,
7544 )
7545 }
7546
7547 type WatchNotificationResponseFut = fidl::client::QueryResponseFut<
7548 TargetHandlerWatchNotificationResult,
7549 fidl::encoding::DefaultFuchsiaResourceDialect,
7550 >;
7551 fn r#watch_notification(
7552 &self,
7553 mut event_id: NotificationEvent,
7554 mut current: &Notification,
7555 mut pos_change_interval: u32,
7556 ) -> Self::WatchNotificationResponseFut {
7557 fn _decode(
7558 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7559 ) -> Result<TargetHandlerWatchNotificationResult, fidl::Error> {
7560 let _response = fidl::client::decode_transaction_body::<
7561 fidl::encoding::ResultType<TargetHandlerWatchNotificationResponse, TargetAvcError>,
7562 fidl::encoding::DefaultFuchsiaResourceDialect,
7563 0x2a513434cf256e5f,
7564 >(_buf?)?;
7565 Ok(_response.map(|x| x.new_value))
7566 }
7567 self.client.send_query_and_decode::<
7568 TargetHandlerWatchNotificationRequest,
7569 TargetHandlerWatchNotificationResult,
7570 >(
7571 (event_id, current, pos_change_interval,),
7572 0x2a513434cf256e5f,
7573 fidl::encoding::DynamicFlags::empty(),
7574 _decode,
7575 )
7576 }
7577
7578 type SetAddressedPlayerResponseFut = fidl::client::QueryResponseFut<
7579 TargetHandlerSetAddressedPlayerResult,
7580 fidl::encoding::DefaultFuchsiaResourceDialect,
7581 >;
7582 fn r#set_addressed_player(
7583 &self,
7584 mut player_id: &AddressedPlayerId,
7585 ) -> Self::SetAddressedPlayerResponseFut {
7586 fn _decode(
7587 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7588 ) -> Result<TargetHandlerSetAddressedPlayerResult, fidl::Error> {
7589 let _response = fidl::client::decode_transaction_body::<
7590 fidl::encoding::ResultType<fidl::encoding::EmptyStruct, TargetAvcError>,
7591 fidl::encoding::DefaultFuchsiaResourceDialect,
7592 0x6724ae8288c34d2f,
7593 >(_buf?)?;
7594 Ok(_response.map(|x| x))
7595 }
7596 self.client.send_query_and_decode::<
7597 TargetHandlerSetAddressedPlayerRequest,
7598 TargetHandlerSetAddressedPlayerResult,
7599 >(
7600 (player_id,),
7601 0x6724ae8288c34d2f,
7602 fidl::encoding::DynamicFlags::empty(),
7603 _decode,
7604 )
7605 }
7606
7607 type GetMediaPlayerItemsResponseFut = fidl::client::QueryResponseFut<
7608 TargetHandlerGetMediaPlayerItemsResult,
7609 fidl::encoding::DefaultFuchsiaResourceDialect,
7610 >;
7611 fn r#get_media_player_items(&self) -> Self::GetMediaPlayerItemsResponseFut {
7612 fn _decode(
7613 mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
7614 ) -> Result<TargetHandlerGetMediaPlayerItemsResult, fidl::Error> {
7615 let _response = fidl::client::decode_transaction_body::<
7616 fidl::encoding::ResultType<
7617 TargetHandlerGetMediaPlayerItemsResponse,
7618 TargetAvcError,
7619 >,
7620 fidl::encoding::DefaultFuchsiaResourceDialect,
7621 0x736668f5aa3a8246,
7622 >(_buf?)?;
7623 Ok(_response.map(|x| x.items))
7624 }
7625 self.client.send_query_and_decode::<
7626 fidl::encoding::EmptyPayload,
7627 TargetHandlerGetMediaPlayerItemsResult,
7628 >(
7629 (),
7630 0x736668f5aa3a8246,
7631 fidl::encoding::DynamicFlags::empty(),
7632 _decode,
7633 )
7634 }
7635}
7636
7637pub struct TargetHandlerEventStream {
7638 event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
7639}
7640
7641impl std::marker::Unpin for TargetHandlerEventStream {}
7642
7643impl futures::stream::FusedStream for TargetHandlerEventStream {
7644 fn is_terminated(&self) -> bool {
7645 self.event_receiver.is_terminated()
7646 }
7647}
7648
7649impl futures::Stream for TargetHandlerEventStream {
7650 type Item = Result<TargetHandlerEvent, fidl::Error>;
7651
7652 fn poll_next(
7653 mut self: std::pin::Pin<&mut Self>,
7654 cx: &mut std::task::Context<'_>,
7655 ) -> std::task::Poll<Option<Self::Item>> {
7656 match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
7657 &mut self.event_receiver,
7658 cx
7659 )?) {
7660 Some(buf) => std::task::Poll::Ready(Some(TargetHandlerEvent::decode(buf))),
7661 None => std::task::Poll::Ready(None),
7662 }
7663 }
7664}
7665
7666#[derive(Debug)]
7667pub enum TargetHandlerEvent {}
7668
7669impl TargetHandlerEvent {
7670 fn decode(
7672 mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
7673 ) -> Result<TargetHandlerEvent, fidl::Error> {
7674 let (bytes, _handles) = buf.split_mut();
7675 let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7676 debug_assert_eq!(tx_header.tx_id, 0);
7677 match tx_header.ordinal {
7678 _ => Err(fidl::Error::UnknownOrdinal {
7679 ordinal: tx_header.ordinal,
7680 protocol_name: <TargetHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7681 }),
7682 }
7683 }
7684}
7685
7686pub struct TargetHandlerRequestStream {
7688 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7689 is_terminated: bool,
7690}
7691
7692impl std::marker::Unpin for TargetHandlerRequestStream {}
7693
7694impl futures::stream::FusedStream for TargetHandlerRequestStream {
7695 fn is_terminated(&self) -> bool {
7696 self.is_terminated
7697 }
7698}
7699
7700impl fidl::endpoints::RequestStream for TargetHandlerRequestStream {
7701 type Protocol = TargetHandlerMarker;
7702 type ControlHandle = TargetHandlerControlHandle;
7703
7704 fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
7705 Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
7706 }
7707
7708 fn control_handle(&self) -> Self::ControlHandle {
7709 TargetHandlerControlHandle { inner: self.inner.clone() }
7710 }
7711
7712 fn into_inner(
7713 self,
7714 ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
7715 {
7716 (self.inner, self.is_terminated)
7717 }
7718
7719 fn from_inner(
7720 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7721 is_terminated: bool,
7722 ) -> Self {
7723 Self { inner, is_terminated }
7724 }
7725}
7726
7727impl futures::Stream for TargetHandlerRequestStream {
7728 type Item = Result<TargetHandlerRequest, fidl::Error>;
7729
7730 fn poll_next(
7731 mut self: std::pin::Pin<&mut Self>,
7732 cx: &mut std::task::Context<'_>,
7733 ) -> std::task::Poll<Option<Self::Item>> {
7734 let this = &mut *self;
7735 if this.inner.check_shutdown(cx) {
7736 this.is_terminated = true;
7737 return std::task::Poll::Ready(None);
7738 }
7739 if this.is_terminated {
7740 panic!("polled TargetHandlerRequestStream after completion");
7741 }
7742 fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
7743 |bytes, handles| {
7744 match this.inner.channel().read_etc(cx, bytes, handles) {
7745 std::task::Poll::Ready(Ok(())) => {}
7746 std::task::Poll::Pending => return std::task::Poll::Pending,
7747 std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
7748 this.is_terminated = true;
7749 return std::task::Poll::Ready(None);
7750 }
7751 std::task::Poll::Ready(Err(e)) => {
7752 return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
7753 e.into(),
7754 ))))
7755 }
7756 }
7757
7758 let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
7760
7761 std::task::Poll::Ready(Some(match header.ordinal {
7762 0x54bb8d817d5e1257 => {
7763 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7764 let mut req = fidl::new_empty!(
7765 fidl::encoding::EmptyPayload,
7766 fidl::encoding::DefaultFuchsiaResourceDialect
7767 );
7768 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7769 let control_handle =
7770 TargetHandlerControlHandle { inner: this.inner.clone() };
7771 Ok(TargetHandlerRequest::GetEventsSupported {
7772 responder: TargetHandlerGetEventsSupportedResponder {
7773 control_handle: std::mem::ManuallyDrop::new(control_handle),
7774 tx_id: header.tx_id,
7775 },
7776 })
7777 }
7778 0x629f354d2805daf5 => {
7779 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7780 let mut req = fidl::new_empty!(
7781 fidl::encoding::EmptyPayload,
7782 fidl::encoding::DefaultFuchsiaResourceDialect
7783 );
7784 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7785 let control_handle =
7786 TargetHandlerControlHandle { inner: this.inner.clone() };
7787 Ok(TargetHandlerRequest::GetMediaAttributes {
7788 responder: TargetHandlerGetMediaAttributesResponder {
7789 control_handle: std::mem::ManuallyDrop::new(control_handle),
7790 tx_id: header.tx_id,
7791 },
7792 })
7793 }
7794 0x24a4816300e14d89 => {
7795 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7796 let mut req = fidl::new_empty!(
7797 fidl::encoding::EmptyPayload,
7798 fidl::encoding::DefaultFuchsiaResourceDialect
7799 );
7800 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7801 let control_handle =
7802 TargetHandlerControlHandle { inner: this.inner.clone() };
7803 Ok(TargetHandlerRequest::GetPlayStatus {
7804 responder: TargetHandlerGetPlayStatusResponder {
7805 control_handle: std::mem::ManuallyDrop::new(control_handle),
7806 tx_id: header.tx_id,
7807 },
7808 })
7809 }
7810 0x69e063a8f6ab7b87 => {
7811 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7812 let mut req = fidl::new_empty!(
7813 TargetHandlerSendCommandRequest,
7814 fidl::encoding::DefaultFuchsiaResourceDialect
7815 );
7816 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TargetHandlerSendCommandRequest>(&header, _body_bytes, handles, &mut req)?;
7817 let control_handle =
7818 TargetHandlerControlHandle { inner: this.inner.clone() };
7819 Ok(TargetHandlerRequest::SendCommand {
7820 command: req.command,
7821 pressed: req.pressed,
7822
7823 responder: TargetHandlerSendCommandResponder {
7824 control_handle: std::mem::ManuallyDrop::new(control_handle),
7825 tx_id: header.tx_id,
7826 },
7827 })
7828 }
7829 0xdfa38da6a60b2 => {
7830 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7831 let mut req = fidl::new_empty!(
7832 fidl::encoding::EmptyPayload,
7833 fidl::encoding::DefaultFuchsiaResourceDialect
7834 );
7835 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7836 let control_handle =
7837 TargetHandlerControlHandle { inner: this.inner.clone() };
7838 Ok(TargetHandlerRequest::ListPlayerApplicationSettingAttributes {
7839 responder:
7840 TargetHandlerListPlayerApplicationSettingAttributesResponder {
7841 control_handle: std::mem::ManuallyDrop::new(control_handle),
7842 tx_id: header.tx_id,
7843 },
7844 })
7845 }
7846 0x4273f96bdb752751 => {
7847 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7848 let mut req = fidl::new_empty!(
7849 TargetHandlerGetPlayerApplicationSettingsRequest,
7850 fidl::encoding::DefaultFuchsiaResourceDialect
7851 );
7852 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TargetHandlerGetPlayerApplicationSettingsRequest>(&header, _body_bytes, handles, &mut req)?;
7853 let control_handle =
7854 TargetHandlerControlHandle { inner: this.inner.clone() };
7855 Ok(TargetHandlerRequest::GetPlayerApplicationSettings {
7856 attribute_ids: req.attribute_ids,
7857
7858 responder: TargetHandlerGetPlayerApplicationSettingsResponder {
7859 control_handle: std::mem::ManuallyDrop::new(control_handle),
7860 tx_id: header.tx_id,
7861 },
7862 })
7863 }
7864 0x636dd18255e01998 => {
7865 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7866 let mut req = fidl::new_empty!(
7867 TargetHandlerSetPlayerApplicationSettingsRequest,
7868 fidl::encoding::DefaultFuchsiaResourceDialect
7869 );
7870 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TargetHandlerSetPlayerApplicationSettingsRequest>(&header, _body_bytes, handles, &mut req)?;
7871 let control_handle =
7872 TargetHandlerControlHandle { inner: this.inner.clone() };
7873 Ok(TargetHandlerRequest::SetPlayerApplicationSettings {
7874 requested_settings: req.requested_settings,
7875
7876 responder: TargetHandlerSetPlayerApplicationSettingsResponder {
7877 control_handle: std::mem::ManuallyDrop::new(control_handle),
7878 tx_id: header.tx_id,
7879 },
7880 })
7881 }
7882 0x60c7792539a032f1 => {
7883 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7884 let mut req = fidl::new_empty!(
7885 TargetHandlerGetNotificationRequest,
7886 fidl::encoding::DefaultFuchsiaResourceDialect
7887 );
7888 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TargetHandlerGetNotificationRequest>(&header, _body_bytes, handles, &mut req)?;
7889 let control_handle =
7890 TargetHandlerControlHandle { inner: this.inner.clone() };
7891 Ok(TargetHandlerRequest::GetNotification {
7892 event_id: req.event_id,
7893
7894 responder: TargetHandlerGetNotificationResponder {
7895 control_handle: std::mem::ManuallyDrop::new(control_handle),
7896 tx_id: header.tx_id,
7897 },
7898 })
7899 }
7900 0x2a513434cf256e5f => {
7901 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7902 let mut req = fidl::new_empty!(
7903 TargetHandlerWatchNotificationRequest,
7904 fidl::encoding::DefaultFuchsiaResourceDialect
7905 );
7906 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TargetHandlerWatchNotificationRequest>(&header, _body_bytes, handles, &mut req)?;
7907 let control_handle =
7908 TargetHandlerControlHandle { inner: this.inner.clone() };
7909 Ok(TargetHandlerRequest::WatchNotification {
7910 event_id: req.event_id,
7911 current: req.current,
7912 pos_change_interval: req.pos_change_interval,
7913
7914 responder: TargetHandlerWatchNotificationResponder {
7915 control_handle: std::mem::ManuallyDrop::new(control_handle),
7916 tx_id: header.tx_id,
7917 },
7918 })
7919 }
7920 0x6724ae8288c34d2f => {
7921 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7922 let mut req = fidl::new_empty!(
7923 TargetHandlerSetAddressedPlayerRequest,
7924 fidl::encoding::DefaultFuchsiaResourceDialect
7925 );
7926 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TargetHandlerSetAddressedPlayerRequest>(&header, _body_bytes, handles, &mut req)?;
7927 let control_handle =
7928 TargetHandlerControlHandle { inner: this.inner.clone() };
7929 Ok(TargetHandlerRequest::SetAddressedPlayer {
7930 player_id: req.player_id,
7931
7932 responder: TargetHandlerSetAddressedPlayerResponder {
7933 control_handle: std::mem::ManuallyDrop::new(control_handle),
7934 tx_id: header.tx_id,
7935 },
7936 })
7937 }
7938 0x736668f5aa3a8246 => {
7939 header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7940 let mut req = fidl::new_empty!(
7941 fidl::encoding::EmptyPayload,
7942 fidl::encoding::DefaultFuchsiaResourceDialect
7943 );
7944 fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
7945 let control_handle =
7946 TargetHandlerControlHandle { inner: this.inner.clone() };
7947 Ok(TargetHandlerRequest::GetMediaPlayerItems {
7948 responder: TargetHandlerGetMediaPlayerItemsResponder {
7949 control_handle: std::mem::ManuallyDrop::new(control_handle),
7950 tx_id: header.tx_id,
7951 },
7952 })
7953 }
7954 _ => Err(fidl::Error::UnknownOrdinal {
7955 ordinal: header.ordinal,
7956 protocol_name:
7957 <TargetHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7958 }),
7959 }))
7960 },
7961 )
7962 }
7963}
7964
7965#[derive(Debug)]
7968pub enum TargetHandlerRequest {
7969 GetEventsSupported { responder: TargetHandlerGetEventsSupportedResponder },
7971 GetMediaAttributes { responder: TargetHandlerGetMediaAttributesResponder },
7975 GetPlayStatus { responder: TargetHandlerGetPlayStatusResponder },
7977 SendCommand {
7981 command: AvcPanelCommand,
7982 pressed: bool,
7983 responder: TargetHandlerSendCommandResponder,
7984 },
7985 ListPlayerApplicationSettingAttributes {
7988 responder: TargetHandlerListPlayerApplicationSettingAttributesResponder,
7989 },
7990 GetPlayerApplicationSettings {
7994 attribute_ids: Vec<PlayerApplicationSettingAttributeId>,
7995 responder: TargetHandlerGetPlayerApplicationSettingsResponder,
7996 },
7997 SetPlayerApplicationSettings {
8005 requested_settings: PlayerApplicationSettings,
8006 responder: TargetHandlerSetPlayerApplicationSettingsResponder,
8007 },
8008 GetNotification {
8010 event_id: NotificationEvent,
8011 responder: TargetHandlerGetNotificationResponder,
8012 },
8013 WatchNotification {
8019 event_id: NotificationEvent,
8020 current: Notification,
8021 pos_change_interval: u32,
8022 responder: TargetHandlerWatchNotificationResponder,
8023 },
8024 SetAddressedPlayer {
8026 player_id: AddressedPlayerId,
8027 responder: TargetHandlerSetAddressedPlayerResponder,
8028 },
8029 GetMediaPlayerItems { responder: TargetHandlerGetMediaPlayerItemsResponder },
8031}
8032
8033impl TargetHandlerRequest {
8034 #[allow(irrefutable_let_patterns)]
8035 pub fn into_get_events_supported(self) -> Option<(TargetHandlerGetEventsSupportedResponder)> {
8036 if let TargetHandlerRequest::GetEventsSupported { responder } = self {
8037 Some((responder))
8038 } else {
8039 None
8040 }
8041 }
8042
8043 #[allow(irrefutable_let_patterns)]
8044 pub fn into_get_media_attributes(self) -> Option<(TargetHandlerGetMediaAttributesResponder)> {
8045 if let TargetHandlerRequest::GetMediaAttributes { responder } = self {
8046 Some((responder))
8047 } else {
8048 None
8049 }
8050 }
8051
8052 #[allow(irrefutable_let_patterns)]
8053 pub fn into_get_play_status(self) -> Option<(TargetHandlerGetPlayStatusResponder)> {
8054 if let TargetHandlerRequest::GetPlayStatus { responder } = self {
8055 Some((responder))
8056 } else {
8057 None
8058 }
8059 }
8060
8061 #[allow(irrefutable_let_patterns)]
8062 pub fn into_send_command(
8063 self,
8064 ) -> Option<(AvcPanelCommand, bool, TargetHandlerSendCommandResponder)> {
8065 if let TargetHandlerRequest::SendCommand { command, pressed, responder } = self {
8066 Some((command, pressed, responder))
8067 } else {
8068 None
8069 }
8070 }
8071
8072 #[allow(irrefutable_let_patterns)]
8073 pub fn into_list_player_application_setting_attributes(
8074 self,
8075 ) -> Option<(TargetHandlerListPlayerApplicationSettingAttributesResponder)> {
8076 if let TargetHandlerRequest::ListPlayerApplicationSettingAttributes { responder } = self {
8077 Some((responder))
8078 } else {
8079 None
8080 }
8081 }
8082
8083 #[allow(irrefutable_let_patterns)]
8084 pub fn into_get_player_application_settings(
8085 self,
8086 ) -> Option<(
8087 Vec<PlayerApplicationSettingAttributeId>,
8088 TargetHandlerGetPlayerApplicationSettingsResponder,
8089 )> {
8090 if let TargetHandlerRequest::GetPlayerApplicationSettings { attribute_ids, responder } =
8091 self
8092 {
8093 Some((attribute_ids, responder))
8094 } else {
8095 None
8096 }
8097 }
8098
8099 #[allow(irrefutable_let_patterns)]
8100 pub fn into_set_player_application_settings(
8101 self,
8102 ) -> Option<(PlayerApplicationSettings, TargetHandlerSetPlayerApplicationSettingsResponder)>
8103 {
8104 if let TargetHandlerRequest::SetPlayerApplicationSettings {
8105 requested_settings,
8106 responder,
8107 } = self
8108 {
8109 Some((requested_settings, responder))
8110 } else {
8111 None
8112 }
8113 }
8114
8115 #[allow(irrefutable_let_patterns)]
8116 pub fn into_get_notification(
8117 self,
8118 ) -> Option<(NotificationEvent, TargetHandlerGetNotificationResponder)> {
8119 if let TargetHandlerRequest::GetNotification { event_id, responder } = self {
8120 Some((event_id, responder))
8121 } else {
8122 None
8123 }
8124 }
8125
8126 #[allow(irrefutable_let_patterns)]
8127 pub fn into_watch_notification(
8128 self,
8129 ) -> Option<(NotificationEvent, Notification, u32, TargetHandlerWatchNotificationResponder)>
8130 {
8131 if let TargetHandlerRequest::WatchNotification {
8132 event_id,
8133 current,
8134 pos_change_interval,
8135 responder,
8136 } = self
8137 {
8138 Some((event_id, current, pos_change_interval, responder))
8139 } else {
8140 None
8141 }
8142 }
8143
8144 #[allow(irrefutable_let_patterns)]
8145 pub fn into_set_addressed_player(
8146 self,
8147 ) -> Option<(AddressedPlayerId, TargetHandlerSetAddressedPlayerResponder)> {
8148 if let TargetHandlerRequest::SetAddressedPlayer { player_id, responder } = self {
8149 Some((player_id, responder))
8150 } else {
8151 None
8152 }
8153 }
8154
8155 #[allow(irrefutable_let_patterns)]
8156 pub fn into_get_media_player_items(
8157 self,
8158 ) -> Option<(TargetHandlerGetMediaPlayerItemsResponder)> {
8159 if let TargetHandlerRequest::GetMediaPlayerItems { responder } = self {
8160 Some((responder))
8161 } else {
8162 None
8163 }
8164 }
8165
8166 pub fn method_name(&self) -> &'static str {
8168 match *self {
8169 TargetHandlerRequest::GetEventsSupported { .. } => "get_events_supported",
8170 TargetHandlerRequest::GetMediaAttributes { .. } => "get_media_attributes",
8171 TargetHandlerRequest::GetPlayStatus { .. } => "get_play_status",
8172 TargetHandlerRequest::SendCommand { .. } => "send_command",
8173 TargetHandlerRequest::ListPlayerApplicationSettingAttributes { .. } => {
8174 "list_player_application_setting_attributes"
8175 }
8176 TargetHandlerRequest::GetPlayerApplicationSettings { .. } => {
8177 "get_player_application_settings"
8178 }
8179 TargetHandlerRequest::SetPlayerApplicationSettings { .. } => {
8180 "set_player_application_settings"
8181 }
8182 TargetHandlerRequest::GetNotification { .. } => "get_notification",
8183 TargetHandlerRequest::WatchNotification { .. } => "watch_notification",
8184 TargetHandlerRequest::SetAddressedPlayer { .. } => "set_addressed_player",
8185 TargetHandlerRequest::GetMediaPlayerItems { .. } => "get_media_player_items",
8186 }
8187 }
8188}
8189
8190#[derive(Debug, Clone)]
8191pub struct TargetHandlerControlHandle {
8192 inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
8193}
8194
8195impl fidl::endpoints::ControlHandle for TargetHandlerControlHandle {
8196 fn shutdown(&self) {
8197 self.inner.shutdown()
8198 }
8199 fn shutdown_with_epitaph(&self, status: zx_status::Status) {
8200 self.inner.shutdown_with_epitaph(status)
8201 }
8202
8203 fn is_closed(&self) -> bool {
8204 self.inner.channel().is_closed()
8205 }
8206 fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
8207 self.inner.channel().on_closed()
8208 }
8209
8210 #[cfg(target_os = "fuchsia")]
8211 fn signal_peer(
8212 &self,
8213 clear_mask: zx::Signals,
8214 set_mask: zx::Signals,
8215 ) -> Result<(), zx_status::Status> {
8216 use fidl::Peered;
8217 self.inner.channel().signal_peer(clear_mask, set_mask)
8218 }
8219}
8220
8221impl TargetHandlerControlHandle {}
8222
8223#[must_use = "FIDL methods require a response to be sent"]
8224#[derive(Debug)]
8225pub struct TargetHandlerGetEventsSupportedResponder {
8226 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
8227 tx_id: u32,
8228}
8229
8230impl std::ops::Drop for TargetHandlerGetEventsSupportedResponder {
8234 fn drop(&mut self) {
8235 self.control_handle.shutdown();
8236 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8238 }
8239}
8240
8241impl fidl::endpoints::Responder for TargetHandlerGetEventsSupportedResponder {
8242 type ControlHandle = TargetHandlerControlHandle;
8243
8244 fn control_handle(&self) -> &TargetHandlerControlHandle {
8245 &self.control_handle
8246 }
8247
8248 fn drop_without_shutdown(mut self) {
8249 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8251 std::mem::forget(self);
8253 }
8254}
8255
8256impl TargetHandlerGetEventsSupportedResponder {
8257 pub fn send(
8261 self,
8262 mut result: Result<&[NotificationEvent], TargetAvcError>,
8263 ) -> Result<(), fidl::Error> {
8264 let _result = self.send_raw(result);
8265 if _result.is_err() {
8266 self.control_handle.shutdown();
8267 }
8268 self.drop_without_shutdown();
8269 _result
8270 }
8271
8272 pub fn send_no_shutdown_on_err(
8274 self,
8275 mut result: Result<&[NotificationEvent], TargetAvcError>,
8276 ) -> Result<(), fidl::Error> {
8277 let _result = self.send_raw(result);
8278 self.drop_without_shutdown();
8279 _result
8280 }
8281
8282 fn send_raw(
8283 &self,
8284 mut result: Result<&[NotificationEvent], TargetAvcError>,
8285 ) -> Result<(), fidl::Error> {
8286 self.control_handle.inner.send::<fidl::encoding::ResultType<
8287 TargetHandlerGetEventsSupportedResponse,
8288 TargetAvcError,
8289 >>(
8290 result.map(|notification_ids| (notification_ids,)),
8291 self.tx_id,
8292 0x54bb8d817d5e1257,
8293 fidl::encoding::DynamicFlags::empty(),
8294 )
8295 }
8296}
8297
8298#[must_use = "FIDL methods require a response to be sent"]
8299#[derive(Debug)]
8300pub struct TargetHandlerGetMediaAttributesResponder {
8301 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
8302 tx_id: u32,
8303}
8304
8305impl std::ops::Drop for TargetHandlerGetMediaAttributesResponder {
8309 fn drop(&mut self) {
8310 self.control_handle.shutdown();
8311 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8313 }
8314}
8315
8316impl fidl::endpoints::Responder for TargetHandlerGetMediaAttributesResponder {
8317 type ControlHandle = TargetHandlerControlHandle;
8318
8319 fn control_handle(&self) -> &TargetHandlerControlHandle {
8320 &self.control_handle
8321 }
8322
8323 fn drop_without_shutdown(mut self) {
8324 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8326 std::mem::forget(self);
8328 }
8329}
8330
8331impl TargetHandlerGetMediaAttributesResponder {
8332 pub fn send(
8336 self,
8337 mut result: Result<&MediaAttributes, TargetAvcError>,
8338 ) -> Result<(), fidl::Error> {
8339 let _result = self.send_raw(result);
8340 if _result.is_err() {
8341 self.control_handle.shutdown();
8342 }
8343 self.drop_without_shutdown();
8344 _result
8345 }
8346
8347 pub fn send_no_shutdown_on_err(
8349 self,
8350 mut result: Result<&MediaAttributes, TargetAvcError>,
8351 ) -> Result<(), fidl::Error> {
8352 let _result = self.send_raw(result);
8353 self.drop_without_shutdown();
8354 _result
8355 }
8356
8357 fn send_raw(
8358 &self,
8359 mut result: Result<&MediaAttributes, TargetAvcError>,
8360 ) -> Result<(), fidl::Error> {
8361 self.control_handle.inner.send::<fidl::encoding::ResultType<
8362 TargetHandlerGetMediaAttributesResponse,
8363 TargetAvcError,
8364 >>(
8365 result.map(|attributes| (attributes,)),
8366 self.tx_id,
8367 0x629f354d2805daf5,
8368 fidl::encoding::DynamicFlags::empty(),
8369 )
8370 }
8371}
8372
8373#[must_use = "FIDL methods require a response to be sent"]
8374#[derive(Debug)]
8375pub struct TargetHandlerGetPlayStatusResponder {
8376 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
8377 tx_id: u32,
8378}
8379
8380impl std::ops::Drop for TargetHandlerGetPlayStatusResponder {
8384 fn drop(&mut self) {
8385 self.control_handle.shutdown();
8386 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8388 }
8389}
8390
8391impl fidl::endpoints::Responder for TargetHandlerGetPlayStatusResponder {
8392 type ControlHandle = TargetHandlerControlHandle;
8393
8394 fn control_handle(&self) -> &TargetHandlerControlHandle {
8395 &self.control_handle
8396 }
8397
8398 fn drop_without_shutdown(mut self) {
8399 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8401 std::mem::forget(self);
8403 }
8404}
8405
8406impl TargetHandlerGetPlayStatusResponder {
8407 pub fn send(self, mut result: Result<&PlayStatus, TargetAvcError>) -> Result<(), fidl::Error> {
8411 let _result = self.send_raw(result);
8412 if _result.is_err() {
8413 self.control_handle.shutdown();
8414 }
8415 self.drop_without_shutdown();
8416 _result
8417 }
8418
8419 pub fn send_no_shutdown_on_err(
8421 self,
8422 mut result: Result<&PlayStatus, TargetAvcError>,
8423 ) -> Result<(), fidl::Error> {
8424 let _result = self.send_raw(result);
8425 self.drop_without_shutdown();
8426 _result
8427 }
8428
8429 fn send_raw(&self, mut result: Result<&PlayStatus, TargetAvcError>) -> Result<(), fidl::Error> {
8430 self.control_handle.inner.send::<fidl::encoding::ResultType<
8431 TargetHandlerGetPlayStatusResponse,
8432 TargetAvcError,
8433 >>(
8434 result.map(|play_status| (play_status,)),
8435 self.tx_id,
8436 0x24a4816300e14d89,
8437 fidl::encoding::DynamicFlags::empty(),
8438 )
8439 }
8440}
8441
8442#[must_use = "FIDL methods require a response to be sent"]
8443#[derive(Debug)]
8444pub struct TargetHandlerSendCommandResponder {
8445 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
8446 tx_id: u32,
8447}
8448
8449impl std::ops::Drop for TargetHandlerSendCommandResponder {
8453 fn drop(&mut self) {
8454 self.control_handle.shutdown();
8455 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8457 }
8458}
8459
8460impl fidl::endpoints::Responder for TargetHandlerSendCommandResponder {
8461 type ControlHandle = TargetHandlerControlHandle;
8462
8463 fn control_handle(&self) -> &TargetHandlerControlHandle {
8464 &self.control_handle
8465 }
8466
8467 fn drop_without_shutdown(mut self) {
8468 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8470 std::mem::forget(self);
8472 }
8473}
8474
8475impl TargetHandlerSendCommandResponder {
8476 pub fn send(self, mut result: Result<(), TargetPassthroughError>) -> Result<(), fidl::Error> {
8480 let _result = self.send_raw(result);
8481 if _result.is_err() {
8482 self.control_handle.shutdown();
8483 }
8484 self.drop_without_shutdown();
8485 _result
8486 }
8487
8488 pub fn send_no_shutdown_on_err(
8490 self,
8491 mut result: Result<(), TargetPassthroughError>,
8492 ) -> Result<(), fidl::Error> {
8493 let _result = self.send_raw(result);
8494 self.drop_without_shutdown();
8495 _result
8496 }
8497
8498 fn send_raw(&self, mut result: Result<(), TargetPassthroughError>) -> Result<(), fidl::Error> {
8499 self.control_handle.inner.send::<fidl::encoding::ResultType<
8500 fidl::encoding::EmptyStruct,
8501 TargetPassthroughError,
8502 >>(
8503 result,
8504 self.tx_id,
8505 0x69e063a8f6ab7b87,
8506 fidl::encoding::DynamicFlags::empty(),
8507 )
8508 }
8509}
8510
8511#[must_use = "FIDL methods require a response to be sent"]
8512#[derive(Debug)]
8513pub struct TargetHandlerListPlayerApplicationSettingAttributesResponder {
8514 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
8515 tx_id: u32,
8516}
8517
8518impl std::ops::Drop for TargetHandlerListPlayerApplicationSettingAttributesResponder {
8522 fn drop(&mut self) {
8523 self.control_handle.shutdown();
8524 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8526 }
8527}
8528
8529impl fidl::endpoints::Responder for TargetHandlerListPlayerApplicationSettingAttributesResponder {
8530 type ControlHandle = TargetHandlerControlHandle;
8531
8532 fn control_handle(&self) -> &TargetHandlerControlHandle {
8533 &self.control_handle
8534 }
8535
8536 fn drop_without_shutdown(mut self) {
8537 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8539 std::mem::forget(self);
8541 }
8542}
8543
8544impl TargetHandlerListPlayerApplicationSettingAttributesResponder {
8545 pub fn send(
8549 self,
8550 mut result: Result<&[PlayerApplicationSettingAttributeId], TargetAvcError>,
8551 ) -> Result<(), fidl::Error> {
8552 let _result = self.send_raw(result);
8553 if _result.is_err() {
8554 self.control_handle.shutdown();
8555 }
8556 self.drop_without_shutdown();
8557 _result
8558 }
8559
8560 pub fn send_no_shutdown_on_err(
8562 self,
8563 mut result: Result<&[PlayerApplicationSettingAttributeId], TargetAvcError>,
8564 ) -> Result<(), fidl::Error> {
8565 let _result = self.send_raw(result);
8566 self.drop_without_shutdown();
8567 _result
8568 }
8569
8570 fn send_raw(
8571 &self,
8572 mut result: Result<&[PlayerApplicationSettingAttributeId], TargetAvcError>,
8573 ) -> Result<(), fidl::Error> {
8574 self.control_handle.inner.send::<fidl::encoding::ResultType<
8575 TargetHandlerListPlayerApplicationSettingAttributesResponse,
8576 TargetAvcError,
8577 >>(
8578 result.map(|attributes| (attributes,)),
8579 self.tx_id,
8580 0xdfa38da6a60b2,
8581 fidl::encoding::DynamicFlags::empty(),
8582 )
8583 }
8584}
8585
8586#[must_use = "FIDL methods require a response to be sent"]
8587#[derive(Debug)]
8588pub struct TargetHandlerGetPlayerApplicationSettingsResponder {
8589 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
8590 tx_id: u32,
8591}
8592
8593impl std::ops::Drop for TargetHandlerGetPlayerApplicationSettingsResponder {
8597 fn drop(&mut self) {
8598 self.control_handle.shutdown();
8599 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8601 }
8602}
8603
8604impl fidl::endpoints::Responder for TargetHandlerGetPlayerApplicationSettingsResponder {
8605 type ControlHandle = TargetHandlerControlHandle;
8606
8607 fn control_handle(&self) -> &TargetHandlerControlHandle {
8608 &self.control_handle
8609 }
8610
8611 fn drop_without_shutdown(mut self) {
8612 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8614 std::mem::forget(self);
8616 }
8617}
8618
8619impl TargetHandlerGetPlayerApplicationSettingsResponder {
8620 pub fn send(
8624 self,
8625 mut result: Result<&PlayerApplicationSettings, TargetAvcError>,
8626 ) -> Result<(), fidl::Error> {
8627 let _result = self.send_raw(result);
8628 if _result.is_err() {
8629 self.control_handle.shutdown();
8630 }
8631 self.drop_without_shutdown();
8632 _result
8633 }
8634
8635 pub fn send_no_shutdown_on_err(
8637 self,
8638 mut result: Result<&PlayerApplicationSettings, TargetAvcError>,
8639 ) -> Result<(), fidl::Error> {
8640 let _result = self.send_raw(result);
8641 self.drop_without_shutdown();
8642 _result
8643 }
8644
8645 fn send_raw(
8646 &self,
8647 mut result: Result<&PlayerApplicationSettings, TargetAvcError>,
8648 ) -> Result<(), fidl::Error> {
8649 self.control_handle.inner.send::<fidl::encoding::ResultType<
8650 TargetHandlerGetPlayerApplicationSettingsResponse,
8651 TargetAvcError,
8652 >>(
8653 result.map(|current_settings| (current_settings,)),
8654 self.tx_id,
8655 0x4273f96bdb752751,
8656 fidl::encoding::DynamicFlags::empty(),
8657 )
8658 }
8659}
8660
8661#[must_use = "FIDL methods require a response to be sent"]
8662#[derive(Debug)]
8663pub struct TargetHandlerSetPlayerApplicationSettingsResponder {
8664 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
8665 tx_id: u32,
8666}
8667
8668impl std::ops::Drop for TargetHandlerSetPlayerApplicationSettingsResponder {
8672 fn drop(&mut self) {
8673 self.control_handle.shutdown();
8674 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8676 }
8677}
8678
8679impl fidl::endpoints::Responder for TargetHandlerSetPlayerApplicationSettingsResponder {
8680 type ControlHandle = TargetHandlerControlHandle;
8681
8682 fn control_handle(&self) -> &TargetHandlerControlHandle {
8683 &self.control_handle
8684 }
8685
8686 fn drop_without_shutdown(mut self) {
8687 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8689 std::mem::forget(self);
8691 }
8692}
8693
8694impl TargetHandlerSetPlayerApplicationSettingsResponder {
8695 pub fn send(
8699 self,
8700 mut result: Result<&PlayerApplicationSettings, TargetAvcError>,
8701 ) -> Result<(), fidl::Error> {
8702 let _result = self.send_raw(result);
8703 if _result.is_err() {
8704 self.control_handle.shutdown();
8705 }
8706 self.drop_without_shutdown();
8707 _result
8708 }
8709
8710 pub fn send_no_shutdown_on_err(
8712 self,
8713 mut result: Result<&PlayerApplicationSettings, TargetAvcError>,
8714 ) -> Result<(), fidl::Error> {
8715 let _result = self.send_raw(result);
8716 self.drop_without_shutdown();
8717 _result
8718 }
8719
8720 fn send_raw(
8721 &self,
8722 mut result: Result<&PlayerApplicationSettings, TargetAvcError>,
8723 ) -> Result<(), fidl::Error> {
8724 self.control_handle.inner.send::<fidl::encoding::ResultType<
8725 TargetHandlerSetPlayerApplicationSettingsResponse,
8726 TargetAvcError,
8727 >>(
8728 result.map(|set_settings| (set_settings,)),
8729 self.tx_id,
8730 0x636dd18255e01998,
8731 fidl::encoding::DynamicFlags::empty(),
8732 )
8733 }
8734}
8735
8736#[must_use = "FIDL methods require a response to be sent"]
8737#[derive(Debug)]
8738pub struct TargetHandlerGetNotificationResponder {
8739 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
8740 tx_id: u32,
8741}
8742
8743impl std::ops::Drop for TargetHandlerGetNotificationResponder {
8747 fn drop(&mut self) {
8748 self.control_handle.shutdown();
8749 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8751 }
8752}
8753
8754impl fidl::endpoints::Responder for TargetHandlerGetNotificationResponder {
8755 type ControlHandle = TargetHandlerControlHandle;
8756
8757 fn control_handle(&self) -> &TargetHandlerControlHandle {
8758 &self.control_handle
8759 }
8760
8761 fn drop_without_shutdown(mut self) {
8762 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8764 std::mem::forget(self);
8766 }
8767}
8768
8769impl TargetHandlerGetNotificationResponder {
8770 pub fn send(
8774 self,
8775 mut result: Result<&Notification, TargetAvcError>,
8776 ) -> Result<(), fidl::Error> {
8777 let _result = self.send_raw(result);
8778 if _result.is_err() {
8779 self.control_handle.shutdown();
8780 }
8781 self.drop_without_shutdown();
8782 _result
8783 }
8784
8785 pub fn send_no_shutdown_on_err(
8787 self,
8788 mut result: Result<&Notification, TargetAvcError>,
8789 ) -> Result<(), fidl::Error> {
8790 let _result = self.send_raw(result);
8791 self.drop_without_shutdown();
8792 _result
8793 }
8794
8795 fn send_raw(
8796 &self,
8797 mut result: Result<&Notification, TargetAvcError>,
8798 ) -> Result<(), fidl::Error> {
8799 self.control_handle.inner.send::<fidl::encoding::ResultType<
8800 TargetHandlerGetNotificationResponse,
8801 TargetAvcError,
8802 >>(
8803 result.map(|current_value| (current_value,)),
8804 self.tx_id,
8805 0x60c7792539a032f1,
8806 fidl::encoding::DynamicFlags::empty(),
8807 )
8808 }
8809}
8810
8811#[must_use = "FIDL methods require a response to be sent"]
8812#[derive(Debug)]
8813pub struct TargetHandlerWatchNotificationResponder {
8814 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
8815 tx_id: u32,
8816}
8817
8818impl std::ops::Drop for TargetHandlerWatchNotificationResponder {
8822 fn drop(&mut self) {
8823 self.control_handle.shutdown();
8824 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8826 }
8827}
8828
8829impl fidl::endpoints::Responder for TargetHandlerWatchNotificationResponder {
8830 type ControlHandle = TargetHandlerControlHandle;
8831
8832 fn control_handle(&self) -> &TargetHandlerControlHandle {
8833 &self.control_handle
8834 }
8835
8836 fn drop_without_shutdown(mut self) {
8837 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8839 std::mem::forget(self);
8841 }
8842}
8843
8844impl TargetHandlerWatchNotificationResponder {
8845 pub fn send(
8849 self,
8850 mut result: Result<&Notification, TargetAvcError>,
8851 ) -> Result<(), fidl::Error> {
8852 let _result = self.send_raw(result);
8853 if _result.is_err() {
8854 self.control_handle.shutdown();
8855 }
8856 self.drop_without_shutdown();
8857 _result
8858 }
8859
8860 pub fn send_no_shutdown_on_err(
8862 self,
8863 mut result: Result<&Notification, TargetAvcError>,
8864 ) -> Result<(), fidl::Error> {
8865 let _result = self.send_raw(result);
8866 self.drop_without_shutdown();
8867 _result
8868 }
8869
8870 fn send_raw(
8871 &self,
8872 mut result: Result<&Notification, TargetAvcError>,
8873 ) -> Result<(), fidl::Error> {
8874 self.control_handle.inner.send::<fidl::encoding::ResultType<
8875 TargetHandlerWatchNotificationResponse,
8876 TargetAvcError,
8877 >>(
8878 result.map(|new_value| (new_value,)),
8879 self.tx_id,
8880 0x2a513434cf256e5f,
8881 fidl::encoding::DynamicFlags::empty(),
8882 )
8883 }
8884}
8885
8886#[must_use = "FIDL methods require a response to be sent"]
8887#[derive(Debug)]
8888pub struct TargetHandlerSetAddressedPlayerResponder {
8889 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
8890 tx_id: u32,
8891}
8892
8893impl std::ops::Drop for TargetHandlerSetAddressedPlayerResponder {
8897 fn drop(&mut self) {
8898 self.control_handle.shutdown();
8899 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8901 }
8902}
8903
8904impl fidl::endpoints::Responder for TargetHandlerSetAddressedPlayerResponder {
8905 type ControlHandle = TargetHandlerControlHandle;
8906
8907 fn control_handle(&self) -> &TargetHandlerControlHandle {
8908 &self.control_handle
8909 }
8910
8911 fn drop_without_shutdown(mut self) {
8912 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8914 std::mem::forget(self);
8916 }
8917}
8918
8919impl TargetHandlerSetAddressedPlayerResponder {
8920 pub fn send(self, mut result: Result<(), TargetAvcError>) -> Result<(), fidl::Error> {
8924 let _result = self.send_raw(result);
8925 if _result.is_err() {
8926 self.control_handle.shutdown();
8927 }
8928 self.drop_without_shutdown();
8929 _result
8930 }
8931
8932 pub fn send_no_shutdown_on_err(
8934 self,
8935 mut result: Result<(), TargetAvcError>,
8936 ) -> Result<(), fidl::Error> {
8937 let _result = self.send_raw(result);
8938 self.drop_without_shutdown();
8939 _result
8940 }
8941
8942 fn send_raw(&self, mut result: Result<(), TargetAvcError>) -> Result<(), fidl::Error> {
8943 self.control_handle.inner.send::<fidl::encoding::ResultType<
8944 fidl::encoding::EmptyStruct,
8945 TargetAvcError,
8946 >>(
8947 result,
8948 self.tx_id,
8949 0x6724ae8288c34d2f,
8950 fidl::encoding::DynamicFlags::empty(),
8951 )
8952 }
8953}
8954
8955#[must_use = "FIDL methods require a response to be sent"]
8956#[derive(Debug)]
8957pub struct TargetHandlerGetMediaPlayerItemsResponder {
8958 control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
8959 tx_id: u32,
8960}
8961
8962impl std::ops::Drop for TargetHandlerGetMediaPlayerItemsResponder {
8966 fn drop(&mut self) {
8967 self.control_handle.shutdown();
8968 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8970 }
8971}
8972
8973impl fidl::endpoints::Responder for TargetHandlerGetMediaPlayerItemsResponder {
8974 type ControlHandle = TargetHandlerControlHandle;
8975
8976 fn control_handle(&self) -> &TargetHandlerControlHandle {
8977 &self.control_handle
8978 }
8979
8980 fn drop_without_shutdown(mut self) {
8981 unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8983 std::mem::forget(self);
8985 }
8986}
8987
8988impl TargetHandlerGetMediaPlayerItemsResponder {
8989 pub fn send(
8993 self,
8994 mut result: Result<&[MediaPlayerItem], TargetAvcError>,
8995 ) -> Result<(), fidl::Error> {
8996 let _result = self.send_raw(result);
8997 if _result.is_err() {
8998 self.control_handle.shutdown();
8999 }
9000 self.drop_without_shutdown();
9001 _result
9002 }
9003
9004 pub fn send_no_shutdown_on_err(
9006 self,
9007 mut result: Result<&[MediaPlayerItem], TargetAvcError>,
9008 ) -> Result<(), fidl::Error> {
9009 let _result = self.send_raw(result);
9010 self.drop_without_shutdown();
9011 _result
9012 }
9013
9014 fn send_raw(
9015 &self,
9016 mut result: Result<&[MediaPlayerItem], TargetAvcError>,
9017 ) -> Result<(), fidl::Error> {
9018 self.control_handle.inner.send::<fidl::encoding::ResultType<
9019 TargetHandlerGetMediaPlayerItemsResponse,
9020 TargetAvcError,
9021 >>(
9022 result.map(|items| (items,)),
9023 self.tx_id,
9024 0x736668f5aa3a8246,
9025 fidl::encoding::DynamicFlags::empty(),
9026 )
9027 }
9028}
9029
9030mod internal {
9031 use super::*;
9032 unsafe impl fidl::encoding::TypeMarker for MajorPlayerType {
9033 type Owned = Self;
9034
9035 #[inline(always)]
9036 fn inline_align(_context: fidl::encoding::Context) -> usize {
9037 1
9038 }
9039
9040 #[inline(always)]
9041 fn inline_size(_context: fidl::encoding::Context) -> usize {
9042 1
9043 }
9044 }
9045
9046 impl fidl::encoding::ValueTypeMarker for MajorPlayerType {
9047 type Borrowed<'a> = Self;
9048 #[inline(always)]
9049 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9050 *value
9051 }
9052 }
9053
9054 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
9055 for MajorPlayerType
9056 {
9057 #[inline]
9058 unsafe fn encode(
9059 self,
9060 encoder: &mut fidl::encoding::Encoder<'_, D>,
9061 offset: usize,
9062 _depth: fidl::encoding::Depth,
9063 ) -> fidl::Result<()> {
9064 encoder.debug_check_bounds::<Self>(offset);
9065 if self.bits() & Self::all().bits() != self.bits() {
9066 return Err(fidl::Error::InvalidBitsValue);
9067 }
9068 encoder.write_num(self.bits(), offset);
9069 Ok(())
9070 }
9071 }
9072
9073 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MajorPlayerType {
9074 #[inline(always)]
9075 fn new_empty() -> Self {
9076 Self::empty()
9077 }
9078
9079 #[inline]
9080 unsafe fn decode(
9081 &mut self,
9082 decoder: &mut fidl::encoding::Decoder<'_, D>,
9083 offset: usize,
9084 _depth: fidl::encoding::Depth,
9085 ) -> fidl::Result<()> {
9086 decoder.debug_check_bounds::<Self>(offset);
9087 let prim = decoder.read_num::<u8>(offset);
9088 *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
9089 Ok(())
9090 }
9091 }
9092 unsafe impl fidl::encoding::TypeMarker for Notifications {
9093 type Owned = Self;
9094
9095 #[inline(always)]
9096 fn inline_align(_context: fidl::encoding::Context) -> usize {
9097 4
9098 }
9099
9100 #[inline(always)]
9101 fn inline_size(_context: fidl::encoding::Context) -> usize {
9102 4
9103 }
9104 }
9105
9106 impl fidl::encoding::ValueTypeMarker for Notifications {
9107 type Borrowed<'a> = Self;
9108 #[inline(always)]
9109 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9110 *value
9111 }
9112 }
9113
9114 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Notifications {
9115 #[inline]
9116 unsafe fn encode(
9117 self,
9118 encoder: &mut fidl::encoding::Encoder<'_, D>,
9119 offset: usize,
9120 _depth: fidl::encoding::Depth,
9121 ) -> fidl::Result<()> {
9122 encoder.debug_check_bounds::<Self>(offset);
9123 if self.bits() & Self::all().bits() != self.bits() {
9124 return Err(fidl::Error::InvalidBitsValue);
9125 }
9126 encoder.write_num(self.bits(), offset);
9127 Ok(())
9128 }
9129 }
9130
9131 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Notifications {
9132 #[inline(always)]
9133 fn new_empty() -> Self {
9134 Self::empty()
9135 }
9136
9137 #[inline]
9138 unsafe fn decode(
9139 &mut self,
9140 decoder: &mut fidl::encoding::Decoder<'_, D>,
9141 offset: usize,
9142 _depth: fidl::encoding::Depth,
9143 ) -> fidl::Result<()> {
9144 decoder.debug_check_bounds::<Self>(offset);
9145 let prim = decoder.read_num::<u32>(offset);
9146 *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
9147 Ok(())
9148 }
9149 }
9150 unsafe impl fidl::encoding::TypeMarker for PlayerFeatureBits {
9151 type Owned = Self;
9152
9153 #[inline(always)]
9154 fn inline_align(_context: fidl::encoding::Context) -> usize {
9155 8
9156 }
9157
9158 #[inline(always)]
9159 fn inline_size(_context: fidl::encoding::Context) -> usize {
9160 8
9161 }
9162 }
9163
9164 impl fidl::encoding::ValueTypeMarker for PlayerFeatureBits {
9165 type Borrowed<'a> = Self;
9166 #[inline(always)]
9167 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9168 *value
9169 }
9170 }
9171
9172 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
9173 for PlayerFeatureBits
9174 {
9175 #[inline]
9176 unsafe fn encode(
9177 self,
9178 encoder: &mut fidl::encoding::Encoder<'_, D>,
9179 offset: usize,
9180 _depth: fidl::encoding::Depth,
9181 ) -> fidl::Result<()> {
9182 encoder.debug_check_bounds::<Self>(offset);
9183 if self.bits() & Self::all().bits() != self.bits() {
9184 return Err(fidl::Error::InvalidBitsValue);
9185 }
9186 encoder.write_num(self.bits(), offset);
9187 Ok(())
9188 }
9189 }
9190
9191 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PlayerFeatureBits {
9192 #[inline(always)]
9193 fn new_empty() -> Self {
9194 Self::empty()
9195 }
9196
9197 #[inline]
9198 unsafe fn decode(
9199 &mut self,
9200 decoder: &mut fidl::encoding::Decoder<'_, D>,
9201 offset: usize,
9202 _depth: fidl::encoding::Depth,
9203 ) -> fidl::Result<()> {
9204 decoder.debug_check_bounds::<Self>(offset);
9205 let prim = decoder.read_num::<u64>(offset);
9206 *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
9207 Ok(())
9208 }
9209 }
9210 unsafe impl fidl::encoding::TypeMarker for PlayerFeatureBitsExt {
9211 type Owned = Self;
9212
9213 #[inline(always)]
9214 fn inline_align(_context: fidl::encoding::Context) -> usize {
9215 8
9216 }
9217
9218 #[inline(always)]
9219 fn inline_size(_context: fidl::encoding::Context) -> usize {
9220 8
9221 }
9222 }
9223
9224 impl fidl::encoding::ValueTypeMarker for PlayerFeatureBitsExt {
9225 type Borrowed<'a> = Self;
9226 #[inline(always)]
9227 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9228 *value
9229 }
9230 }
9231
9232 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
9233 for PlayerFeatureBitsExt
9234 {
9235 #[inline]
9236 unsafe fn encode(
9237 self,
9238 encoder: &mut fidl::encoding::Encoder<'_, D>,
9239 offset: usize,
9240 _depth: fidl::encoding::Depth,
9241 ) -> fidl::Result<()> {
9242 encoder.debug_check_bounds::<Self>(offset);
9243 if self.bits() & Self::all().bits() != self.bits() {
9244 return Err(fidl::Error::InvalidBitsValue);
9245 }
9246 encoder.write_num(self.bits(), offset);
9247 Ok(())
9248 }
9249 }
9250
9251 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PlayerFeatureBitsExt {
9252 #[inline(always)]
9253 fn new_empty() -> Self {
9254 Self::empty()
9255 }
9256
9257 #[inline]
9258 unsafe fn decode(
9259 &mut self,
9260 decoder: &mut fidl::encoding::Decoder<'_, D>,
9261 offset: usize,
9262 _depth: fidl::encoding::Depth,
9263 ) -> fidl::Result<()> {
9264 decoder.debug_check_bounds::<Self>(offset);
9265 let prim = decoder.read_num::<u64>(offset);
9266 *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
9267 Ok(())
9268 }
9269 }
9270 unsafe impl fidl::encoding::TypeMarker for PlayerSubType {
9271 type Owned = Self;
9272
9273 #[inline(always)]
9274 fn inline_align(_context: fidl::encoding::Context) -> usize {
9275 4
9276 }
9277
9278 #[inline(always)]
9279 fn inline_size(_context: fidl::encoding::Context) -> usize {
9280 4
9281 }
9282 }
9283
9284 impl fidl::encoding::ValueTypeMarker for PlayerSubType {
9285 type Borrowed<'a> = Self;
9286 #[inline(always)]
9287 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9288 *value
9289 }
9290 }
9291
9292 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for PlayerSubType {
9293 #[inline]
9294 unsafe fn encode(
9295 self,
9296 encoder: &mut fidl::encoding::Encoder<'_, D>,
9297 offset: usize,
9298 _depth: fidl::encoding::Depth,
9299 ) -> fidl::Result<()> {
9300 encoder.debug_check_bounds::<Self>(offset);
9301 if self.bits() & Self::all().bits() != self.bits() {
9302 return Err(fidl::Error::InvalidBitsValue);
9303 }
9304 encoder.write_num(self.bits(), offset);
9305 Ok(())
9306 }
9307 }
9308
9309 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PlayerSubType {
9310 #[inline(always)]
9311 fn new_empty() -> Self {
9312 Self::empty()
9313 }
9314
9315 #[inline]
9316 unsafe fn decode(
9317 &mut self,
9318 decoder: &mut fidl::encoding::Decoder<'_, D>,
9319 offset: usize,
9320 _depth: fidl::encoding::Depth,
9321 ) -> fidl::Result<()> {
9322 decoder.debug_check_bounds::<Self>(offset);
9323 let prim = decoder.read_num::<u32>(offset);
9324 *self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
9325 Ok(())
9326 }
9327 }
9328 unsafe impl fidl::encoding::TypeMarker for AvcPanelCommand {
9329 type Owned = Self;
9330
9331 #[inline(always)]
9332 fn inline_align(_context: fidl::encoding::Context) -> usize {
9333 std::mem::align_of::<u8>()
9334 }
9335
9336 #[inline(always)]
9337 fn inline_size(_context: fidl::encoding::Context) -> usize {
9338 std::mem::size_of::<u8>()
9339 }
9340
9341 #[inline(always)]
9342 fn encode_is_copy() -> bool {
9343 true
9344 }
9345
9346 #[inline(always)]
9347 fn decode_is_copy() -> bool {
9348 false
9349 }
9350 }
9351
9352 impl fidl::encoding::ValueTypeMarker for AvcPanelCommand {
9353 type Borrowed<'a> = Self;
9354 #[inline(always)]
9355 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9356 *value
9357 }
9358 }
9359
9360 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
9361 for AvcPanelCommand
9362 {
9363 #[inline]
9364 unsafe fn encode(
9365 self,
9366 encoder: &mut fidl::encoding::Encoder<'_, D>,
9367 offset: usize,
9368 _depth: fidl::encoding::Depth,
9369 ) -> fidl::Result<()> {
9370 encoder.debug_check_bounds::<Self>(offset);
9371 encoder.write_num(self.into_primitive(), offset);
9372 Ok(())
9373 }
9374 }
9375
9376 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AvcPanelCommand {
9377 #[inline(always)]
9378 fn new_empty() -> Self {
9379 Self::Select
9380 }
9381
9382 #[inline]
9383 unsafe fn decode(
9384 &mut self,
9385 decoder: &mut fidl::encoding::Decoder<'_, D>,
9386 offset: usize,
9387 _depth: fidl::encoding::Depth,
9388 ) -> fidl::Result<()> {
9389 decoder.debug_check_bounds::<Self>(offset);
9390 let prim = decoder.read_num::<u8>(offset);
9391
9392 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
9393 Ok(())
9394 }
9395 }
9396 unsafe impl fidl::encoding::TypeMarker for BatteryStatus {
9397 type Owned = Self;
9398
9399 #[inline(always)]
9400 fn inline_align(_context: fidl::encoding::Context) -> usize {
9401 std::mem::align_of::<u8>()
9402 }
9403
9404 #[inline(always)]
9405 fn inline_size(_context: fidl::encoding::Context) -> usize {
9406 std::mem::size_of::<u8>()
9407 }
9408
9409 #[inline(always)]
9410 fn encode_is_copy() -> bool {
9411 true
9412 }
9413
9414 #[inline(always)]
9415 fn decode_is_copy() -> bool {
9416 false
9417 }
9418 }
9419
9420 impl fidl::encoding::ValueTypeMarker for BatteryStatus {
9421 type Borrowed<'a> = Self;
9422 #[inline(always)]
9423 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9424 *value
9425 }
9426 }
9427
9428 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for BatteryStatus {
9429 #[inline]
9430 unsafe fn encode(
9431 self,
9432 encoder: &mut fidl::encoding::Encoder<'_, D>,
9433 offset: usize,
9434 _depth: fidl::encoding::Depth,
9435 ) -> fidl::Result<()> {
9436 encoder.debug_check_bounds::<Self>(offset);
9437 encoder.write_num(self.into_primitive(), offset);
9438 Ok(())
9439 }
9440 }
9441
9442 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BatteryStatus {
9443 #[inline(always)]
9444 fn new_empty() -> Self {
9445 Self::Normal
9446 }
9447
9448 #[inline]
9449 unsafe fn decode(
9450 &mut self,
9451 decoder: &mut fidl::encoding::Decoder<'_, D>,
9452 offset: usize,
9453 _depth: fidl::encoding::Depth,
9454 ) -> fidl::Result<()> {
9455 decoder.debug_check_bounds::<Self>(offset);
9456 let prim = decoder.read_num::<u8>(offset);
9457
9458 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
9459 Ok(())
9460 }
9461 }
9462 unsafe impl fidl::encoding::TypeMarker for BrowseControllerError {
9463 type Owned = Self;
9464
9465 #[inline(always)]
9466 fn inline_align(_context: fidl::encoding::Context) -> usize {
9467 std::mem::align_of::<u32>()
9468 }
9469
9470 #[inline(always)]
9471 fn inline_size(_context: fidl::encoding::Context) -> usize {
9472 std::mem::size_of::<u32>()
9473 }
9474
9475 #[inline(always)]
9476 fn encode_is_copy() -> bool {
9477 true
9478 }
9479
9480 #[inline(always)]
9481 fn decode_is_copy() -> bool {
9482 false
9483 }
9484 }
9485
9486 impl fidl::encoding::ValueTypeMarker for BrowseControllerError {
9487 type Borrowed<'a> = Self;
9488 #[inline(always)]
9489 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9490 *value
9491 }
9492 }
9493
9494 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
9495 for BrowseControllerError
9496 {
9497 #[inline]
9498 unsafe fn encode(
9499 self,
9500 encoder: &mut fidl::encoding::Encoder<'_, D>,
9501 offset: usize,
9502 _depth: fidl::encoding::Depth,
9503 ) -> fidl::Result<()> {
9504 encoder.debug_check_bounds::<Self>(offset);
9505 encoder.write_num(self.into_primitive(), offset);
9506 Ok(())
9507 }
9508 }
9509
9510 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BrowseControllerError {
9511 #[inline(always)]
9512 fn new_empty() -> Self {
9513 Self::UnknownFailure
9514 }
9515
9516 #[inline]
9517 unsafe fn decode(
9518 &mut self,
9519 decoder: &mut fidl::encoding::Decoder<'_, D>,
9520 offset: usize,
9521 _depth: fidl::encoding::Depth,
9522 ) -> fidl::Result<()> {
9523 decoder.debug_check_bounds::<Self>(offset);
9524 let prim = decoder.read_num::<u32>(offset);
9525
9526 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
9527 Ok(())
9528 }
9529 }
9530 unsafe impl fidl::encoding::TypeMarker for ControllerError {
9531 type Owned = Self;
9532
9533 #[inline(always)]
9534 fn inline_align(_context: fidl::encoding::Context) -> usize {
9535 std::mem::align_of::<u32>()
9536 }
9537
9538 #[inline(always)]
9539 fn inline_size(_context: fidl::encoding::Context) -> usize {
9540 std::mem::size_of::<u32>()
9541 }
9542
9543 #[inline(always)]
9544 fn encode_is_copy() -> bool {
9545 true
9546 }
9547
9548 #[inline(always)]
9549 fn decode_is_copy() -> bool {
9550 false
9551 }
9552 }
9553
9554 impl fidl::encoding::ValueTypeMarker for ControllerError {
9555 type Borrowed<'a> = Self;
9556 #[inline(always)]
9557 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9558 *value
9559 }
9560 }
9561
9562 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
9563 for ControllerError
9564 {
9565 #[inline]
9566 unsafe fn encode(
9567 self,
9568 encoder: &mut fidl::encoding::Encoder<'_, D>,
9569 offset: usize,
9570 _depth: fidl::encoding::Depth,
9571 ) -> fidl::Result<()> {
9572 encoder.debug_check_bounds::<Self>(offset);
9573 encoder.write_num(self.into_primitive(), offset);
9574 Ok(())
9575 }
9576 }
9577
9578 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ControllerError {
9579 #[inline(always)]
9580 fn new_empty() -> Self {
9581 Self::UnknownFailure
9582 }
9583
9584 #[inline]
9585 unsafe fn decode(
9586 &mut self,
9587 decoder: &mut fidl::encoding::Decoder<'_, D>,
9588 offset: usize,
9589 _depth: fidl::encoding::Depth,
9590 ) -> fidl::Result<()> {
9591 decoder.debug_check_bounds::<Self>(offset);
9592 let prim = decoder.read_num::<u32>(offset);
9593
9594 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
9595 Ok(())
9596 }
9597 }
9598 unsafe impl fidl::encoding::TypeMarker for Equalizer {
9599 type Owned = Self;
9600
9601 #[inline(always)]
9602 fn inline_align(_context: fidl::encoding::Context) -> usize {
9603 std::mem::align_of::<u8>()
9604 }
9605
9606 #[inline(always)]
9607 fn inline_size(_context: fidl::encoding::Context) -> usize {
9608 std::mem::size_of::<u8>()
9609 }
9610
9611 #[inline(always)]
9612 fn encode_is_copy() -> bool {
9613 true
9614 }
9615
9616 #[inline(always)]
9617 fn decode_is_copy() -> bool {
9618 false
9619 }
9620 }
9621
9622 impl fidl::encoding::ValueTypeMarker for Equalizer {
9623 type Borrowed<'a> = Self;
9624 #[inline(always)]
9625 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9626 *value
9627 }
9628 }
9629
9630 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Equalizer {
9631 #[inline]
9632 unsafe fn encode(
9633 self,
9634 encoder: &mut fidl::encoding::Encoder<'_, D>,
9635 offset: usize,
9636 _depth: fidl::encoding::Depth,
9637 ) -> fidl::Result<()> {
9638 encoder.debug_check_bounds::<Self>(offset);
9639 encoder.write_num(self.into_primitive(), offset);
9640 Ok(())
9641 }
9642 }
9643
9644 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Equalizer {
9645 #[inline(always)]
9646 fn new_empty() -> Self {
9647 Self::Off
9648 }
9649
9650 #[inline]
9651 unsafe fn decode(
9652 &mut self,
9653 decoder: &mut fidl::encoding::Decoder<'_, D>,
9654 offset: usize,
9655 _depth: fidl::encoding::Depth,
9656 ) -> fidl::Result<()> {
9657 decoder.debug_check_bounds::<Self>(offset);
9658 let prim = decoder.read_num::<u8>(offset);
9659
9660 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
9661 Ok(())
9662 }
9663 }
9664 unsafe impl fidl::encoding::TypeMarker for FolderType {
9665 type Owned = Self;
9666
9667 #[inline(always)]
9668 fn inline_align(_context: fidl::encoding::Context) -> usize {
9669 std::mem::align_of::<u8>()
9670 }
9671
9672 #[inline(always)]
9673 fn inline_size(_context: fidl::encoding::Context) -> usize {
9674 std::mem::size_of::<u8>()
9675 }
9676
9677 #[inline(always)]
9678 fn encode_is_copy() -> bool {
9679 true
9680 }
9681
9682 #[inline(always)]
9683 fn decode_is_copy() -> bool {
9684 false
9685 }
9686 }
9687
9688 impl fidl::encoding::ValueTypeMarker for FolderType {
9689 type Borrowed<'a> = Self;
9690 #[inline(always)]
9691 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9692 *value
9693 }
9694 }
9695
9696 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FolderType {
9697 #[inline]
9698 unsafe fn encode(
9699 self,
9700 encoder: &mut fidl::encoding::Encoder<'_, D>,
9701 offset: usize,
9702 _depth: fidl::encoding::Depth,
9703 ) -> fidl::Result<()> {
9704 encoder.debug_check_bounds::<Self>(offset);
9705 encoder.write_num(self.into_primitive(), offset);
9706 Ok(())
9707 }
9708 }
9709
9710 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FolderType {
9711 #[inline(always)]
9712 fn new_empty() -> Self {
9713 Self::Mixed
9714 }
9715
9716 #[inline]
9717 unsafe fn decode(
9718 &mut self,
9719 decoder: &mut fidl::encoding::Decoder<'_, D>,
9720 offset: usize,
9721 _depth: fidl::encoding::Depth,
9722 ) -> fidl::Result<()> {
9723 decoder.debug_check_bounds::<Self>(offset);
9724 let prim = decoder.read_num::<u8>(offset);
9725
9726 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
9727 Ok(())
9728 }
9729 }
9730 unsafe impl fidl::encoding::TypeMarker for MediaAttributeId {
9731 type Owned = Self;
9732
9733 #[inline(always)]
9734 fn inline_align(_context: fidl::encoding::Context) -> usize {
9735 std::mem::align_of::<u32>()
9736 }
9737
9738 #[inline(always)]
9739 fn inline_size(_context: fidl::encoding::Context) -> usize {
9740 std::mem::size_of::<u32>()
9741 }
9742
9743 #[inline(always)]
9744 fn encode_is_copy() -> bool {
9745 true
9746 }
9747
9748 #[inline(always)]
9749 fn decode_is_copy() -> bool {
9750 false
9751 }
9752 }
9753
9754 impl fidl::encoding::ValueTypeMarker for MediaAttributeId {
9755 type Borrowed<'a> = Self;
9756 #[inline(always)]
9757 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9758 *value
9759 }
9760 }
9761
9762 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
9763 for MediaAttributeId
9764 {
9765 #[inline]
9766 unsafe fn encode(
9767 self,
9768 encoder: &mut fidl::encoding::Encoder<'_, D>,
9769 offset: usize,
9770 _depth: fidl::encoding::Depth,
9771 ) -> fidl::Result<()> {
9772 encoder.debug_check_bounds::<Self>(offset);
9773 encoder.write_num(self.into_primitive(), offset);
9774 Ok(())
9775 }
9776 }
9777
9778 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MediaAttributeId {
9779 #[inline(always)]
9780 fn new_empty() -> Self {
9781 Self::Title
9782 }
9783
9784 #[inline]
9785 unsafe fn decode(
9786 &mut self,
9787 decoder: &mut fidl::encoding::Decoder<'_, D>,
9788 offset: usize,
9789 _depth: fidl::encoding::Depth,
9790 ) -> fidl::Result<()> {
9791 decoder.debug_check_bounds::<Self>(offset);
9792 let prim = decoder.read_num::<u32>(offset);
9793
9794 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
9795 Ok(())
9796 }
9797 }
9798 unsafe impl fidl::encoding::TypeMarker for MediaType {
9799 type Owned = Self;
9800
9801 #[inline(always)]
9802 fn inline_align(_context: fidl::encoding::Context) -> usize {
9803 std::mem::align_of::<u8>()
9804 }
9805
9806 #[inline(always)]
9807 fn inline_size(_context: fidl::encoding::Context) -> usize {
9808 std::mem::size_of::<u8>()
9809 }
9810
9811 #[inline(always)]
9812 fn encode_is_copy() -> bool {
9813 true
9814 }
9815
9816 #[inline(always)]
9817 fn decode_is_copy() -> bool {
9818 false
9819 }
9820 }
9821
9822 impl fidl::encoding::ValueTypeMarker for MediaType {
9823 type Borrowed<'a> = Self;
9824 #[inline(always)]
9825 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9826 *value
9827 }
9828 }
9829
9830 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for MediaType {
9831 #[inline]
9832 unsafe fn encode(
9833 self,
9834 encoder: &mut fidl::encoding::Encoder<'_, D>,
9835 offset: usize,
9836 _depth: fidl::encoding::Depth,
9837 ) -> fidl::Result<()> {
9838 encoder.debug_check_bounds::<Self>(offset);
9839 encoder.write_num(self.into_primitive(), offset);
9840 Ok(())
9841 }
9842 }
9843
9844 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MediaType {
9845 #[inline(always)]
9846 fn new_empty() -> Self {
9847 Self::Audio
9848 }
9849
9850 #[inline]
9851 unsafe fn decode(
9852 &mut self,
9853 decoder: &mut fidl::encoding::Decoder<'_, D>,
9854 offset: usize,
9855 _depth: fidl::encoding::Depth,
9856 ) -> fidl::Result<()> {
9857 decoder.debug_check_bounds::<Self>(offset);
9858 let prim = decoder.read_num::<u8>(offset);
9859
9860 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
9861 Ok(())
9862 }
9863 }
9864 unsafe impl fidl::encoding::TypeMarker for NotificationEvent {
9865 type Owned = Self;
9866
9867 #[inline(always)]
9868 fn inline_align(_context: fidl::encoding::Context) -> usize {
9869 std::mem::align_of::<u8>()
9870 }
9871
9872 #[inline(always)]
9873 fn inline_size(_context: fidl::encoding::Context) -> usize {
9874 std::mem::size_of::<u8>()
9875 }
9876
9877 #[inline(always)]
9878 fn encode_is_copy() -> bool {
9879 true
9880 }
9881
9882 #[inline(always)]
9883 fn decode_is_copy() -> bool {
9884 false
9885 }
9886 }
9887
9888 impl fidl::encoding::ValueTypeMarker for NotificationEvent {
9889 type Borrowed<'a> = Self;
9890 #[inline(always)]
9891 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9892 *value
9893 }
9894 }
9895
9896 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
9897 for NotificationEvent
9898 {
9899 #[inline]
9900 unsafe fn encode(
9901 self,
9902 encoder: &mut fidl::encoding::Encoder<'_, D>,
9903 offset: usize,
9904 _depth: fidl::encoding::Depth,
9905 ) -> fidl::Result<()> {
9906 encoder.debug_check_bounds::<Self>(offset);
9907 encoder.write_num(self.into_primitive(), offset);
9908 Ok(())
9909 }
9910 }
9911
9912 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NotificationEvent {
9913 #[inline(always)]
9914 fn new_empty() -> Self {
9915 Self::PlaybackStatusChanged
9916 }
9917
9918 #[inline]
9919 unsafe fn decode(
9920 &mut self,
9921 decoder: &mut fidl::encoding::Decoder<'_, D>,
9922 offset: usize,
9923 _depth: fidl::encoding::Depth,
9924 ) -> fidl::Result<()> {
9925 decoder.debug_check_bounds::<Self>(offset);
9926 let prim = decoder.read_num::<u8>(offset);
9927
9928 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
9929 Ok(())
9930 }
9931 }
9932 unsafe impl fidl::encoding::TypeMarker for PlaybackStatus {
9933 type Owned = Self;
9934
9935 #[inline(always)]
9936 fn inline_align(_context: fidl::encoding::Context) -> usize {
9937 std::mem::align_of::<u8>()
9938 }
9939
9940 #[inline(always)]
9941 fn inline_size(_context: fidl::encoding::Context) -> usize {
9942 std::mem::size_of::<u8>()
9943 }
9944
9945 #[inline(always)]
9946 fn encode_is_copy() -> bool {
9947 true
9948 }
9949
9950 #[inline(always)]
9951 fn decode_is_copy() -> bool {
9952 false
9953 }
9954 }
9955
9956 impl fidl::encoding::ValueTypeMarker for PlaybackStatus {
9957 type Borrowed<'a> = Self;
9958 #[inline(always)]
9959 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9960 *value
9961 }
9962 }
9963
9964 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for PlaybackStatus {
9965 #[inline]
9966 unsafe fn encode(
9967 self,
9968 encoder: &mut fidl::encoding::Encoder<'_, D>,
9969 offset: usize,
9970 _depth: fidl::encoding::Depth,
9971 ) -> fidl::Result<()> {
9972 encoder.debug_check_bounds::<Self>(offset);
9973 encoder.write_num(self.into_primitive(), offset);
9974 Ok(())
9975 }
9976 }
9977
9978 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PlaybackStatus {
9979 #[inline(always)]
9980 fn new_empty() -> Self {
9981 Self::Stopped
9982 }
9983
9984 #[inline]
9985 unsafe fn decode(
9986 &mut self,
9987 decoder: &mut fidl::encoding::Decoder<'_, D>,
9988 offset: usize,
9989 _depth: fidl::encoding::Depth,
9990 ) -> fidl::Result<()> {
9991 decoder.debug_check_bounds::<Self>(offset);
9992 let prim = decoder.read_num::<u8>(offset);
9993
9994 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
9995 Ok(())
9996 }
9997 }
9998 unsafe impl fidl::encoding::TypeMarker for PlayerApplicationSettingAttributeId {
9999 type Owned = Self;
10000
10001 #[inline(always)]
10002 fn inline_align(_context: fidl::encoding::Context) -> usize {
10003 std::mem::align_of::<u8>()
10004 }
10005
10006 #[inline(always)]
10007 fn inline_size(_context: fidl::encoding::Context) -> usize {
10008 std::mem::size_of::<u8>()
10009 }
10010
10011 #[inline(always)]
10012 fn encode_is_copy() -> bool {
10013 true
10014 }
10015
10016 #[inline(always)]
10017 fn decode_is_copy() -> bool {
10018 false
10019 }
10020 }
10021
10022 impl fidl::encoding::ValueTypeMarker for PlayerApplicationSettingAttributeId {
10023 type Borrowed<'a> = Self;
10024 #[inline(always)]
10025 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10026 *value
10027 }
10028 }
10029
10030 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
10031 for PlayerApplicationSettingAttributeId
10032 {
10033 #[inline]
10034 unsafe fn encode(
10035 self,
10036 encoder: &mut fidl::encoding::Encoder<'_, D>,
10037 offset: usize,
10038 _depth: fidl::encoding::Depth,
10039 ) -> fidl::Result<()> {
10040 encoder.debug_check_bounds::<Self>(offset);
10041 encoder.write_num(self.into_primitive(), offset);
10042 Ok(())
10043 }
10044 }
10045
10046 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10047 for PlayerApplicationSettingAttributeId
10048 {
10049 #[inline(always)]
10050 fn new_empty() -> Self {
10051 Self::Equalizer
10052 }
10053
10054 #[inline]
10055 unsafe fn decode(
10056 &mut self,
10057 decoder: &mut fidl::encoding::Decoder<'_, D>,
10058 offset: usize,
10059 _depth: fidl::encoding::Depth,
10060 ) -> fidl::Result<()> {
10061 decoder.debug_check_bounds::<Self>(offset);
10062 let prim = decoder.read_num::<u8>(offset);
10063
10064 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
10065 Ok(())
10066 }
10067 }
10068 unsafe impl fidl::encoding::TypeMarker for RepeatStatusMode {
10069 type Owned = Self;
10070
10071 #[inline(always)]
10072 fn inline_align(_context: fidl::encoding::Context) -> usize {
10073 std::mem::align_of::<u8>()
10074 }
10075
10076 #[inline(always)]
10077 fn inline_size(_context: fidl::encoding::Context) -> usize {
10078 std::mem::size_of::<u8>()
10079 }
10080
10081 #[inline(always)]
10082 fn encode_is_copy() -> bool {
10083 true
10084 }
10085
10086 #[inline(always)]
10087 fn decode_is_copy() -> bool {
10088 false
10089 }
10090 }
10091
10092 impl fidl::encoding::ValueTypeMarker for RepeatStatusMode {
10093 type Borrowed<'a> = Self;
10094 #[inline(always)]
10095 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10096 *value
10097 }
10098 }
10099
10100 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
10101 for RepeatStatusMode
10102 {
10103 #[inline]
10104 unsafe fn encode(
10105 self,
10106 encoder: &mut fidl::encoding::Encoder<'_, D>,
10107 offset: usize,
10108 _depth: fidl::encoding::Depth,
10109 ) -> fidl::Result<()> {
10110 encoder.debug_check_bounds::<Self>(offset);
10111 encoder.write_num(self.into_primitive(), offset);
10112 Ok(())
10113 }
10114 }
10115
10116 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RepeatStatusMode {
10117 #[inline(always)]
10118 fn new_empty() -> Self {
10119 Self::Off
10120 }
10121
10122 #[inline]
10123 unsafe fn decode(
10124 &mut self,
10125 decoder: &mut fidl::encoding::Decoder<'_, D>,
10126 offset: usize,
10127 _depth: fidl::encoding::Depth,
10128 ) -> fidl::Result<()> {
10129 decoder.debug_check_bounds::<Self>(offset);
10130 let prim = decoder.read_num::<u8>(offset);
10131
10132 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
10133 Ok(())
10134 }
10135 }
10136 unsafe impl fidl::encoding::TypeMarker for ScanMode {
10137 type Owned = Self;
10138
10139 #[inline(always)]
10140 fn inline_align(_context: fidl::encoding::Context) -> usize {
10141 std::mem::align_of::<u8>()
10142 }
10143
10144 #[inline(always)]
10145 fn inline_size(_context: fidl::encoding::Context) -> usize {
10146 std::mem::size_of::<u8>()
10147 }
10148
10149 #[inline(always)]
10150 fn encode_is_copy() -> bool {
10151 true
10152 }
10153
10154 #[inline(always)]
10155 fn decode_is_copy() -> bool {
10156 false
10157 }
10158 }
10159
10160 impl fidl::encoding::ValueTypeMarker for ScanMode {
10161 type Borrowed<'a> = Self;
10162 #[inline(always)]
10163 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10164 *value
10165 }
10166 }
10167
10168 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ScanMode {
10169 #[inline]
10170 unsafe fn encode(
10171 self,
10172 encoder: &mut fidl::encoding::Encoder<'_, D>,
10173 offset: usize,
10174 _depth: fidl::encoding::Depth,
10175 ) -> fidl::Result<()> {
10176 encoder.debug_check_bounds::<Self>(offset);
10177 encoder.write_num(self.into_primitive(), offset);
10178 Ok(())
10179 }
10180 }
10181
10182 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ScanMode {
10183 #[inline(always)]
10184 fn new_empty() -> Self {
10185 Self::Off
10186 }
10187
10188 #[inline]
10189 unsafe fn decode(
10190 &mut self,
10191 decoder: &mut fidl::encoding::Decoder<'_, D>,
10192 offset: usize,
10193 _depth: fidl::encoding::Depth,
10194 ) -> fidl::Result<()> {
10195 decoder.debug_check_bounds::<Self>(offset);
10196 let prim = decoder.read_num::<u8>(offset);
10197
10198 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
10199 Ok(())
10200 }
10201 }
10202 unsafe impl fidl::encoding::TypeMarker for ShuffleMode {
10203 type Owned = Self;
10204
10205 #[inline(always)]
10206 fn inline_align(_context: fidl::encoding::Context) -> usize {
10207 std::mem::align_of::<u8>()
10208 }
10209
10210 #[inline(always)]
10211 fn inline_size(_context: fidl::encoding::Context) -> usize {
10212 std::mem::size_of::<u8>()
10213 }
10214
10215 #[inline(always)]
10216 fn encode_is_copy() -> bool {
10217 true
10218 }
10219
10220 #[inline(always)]
10221 fn decode_is_copy() -> bool {
10222 false
10223 }
10224 }
10225
10226 impl fidl::encoding::ValueTypeMarker for ShuffleMode {
10227 type Borrowed<'a> = Self;
10228 #[inline(always)]
10229 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10230 *value
10231 }
10232 }
10233
10234 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ShuffleMode {
10235 #[inline]
10236 unsafe fn encode(
10237 self,
10238 encoder: &mut fidl::encoding::Encoder<'_, D>,
10239 offset: usize,
10240 _depth: fidl::encoding::Depth,
10241 ) -> fidl::Result<()> {
10242 encoder.debug_check_bounds::<Self>(offset);
10243 encoder.write_num(self.into_primitive(), offset);
10244 Ok(())
10245 }
10246 }
10247
10248 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ShuffleMode {
10249 #[inline(always)]
10250 fn new_empty() -> Self {
10251 Self::Off
10252 }
10253
10254 #[inline]
10255 unsafe fn decode(
10256 &mut self,
10257 decoder: &mut fidl::encoding::Decoder<'_, D>,
10258 offset: usize,
10259 _depth: fidl::encoding::Depth,
10260 ) -> fidl::Result<()> {
10261 decoder.debug_check_bounds::<Self>(offset);
10262 let prim = decoder.read_num::<u8>(offset);
10263
10264 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
10265 Ok(())
10266 }
10267 }
10268 unsafe impl fidl::encoding::TypeMarker for SystemStatus {
10269 type Owned = Self;
10270
10271 #[inline(always)]
10272 fn inline_align(_context: fidl::encoding::Context) -> usize {
10273 std::mem::align_of::<u8>()
10274 }
10275
10276 #[inline(always)]
10277 fn inline_size(_context: fidl::encoding::Context) -> usize {
10278 std::mem::size_of::<u8>()
10279 }
10280
10281 #[inline(always)]
10282 fn encode_is_copy() -> bool {
10283 true
10284 }
10285
10286 #[inline(always)]
10287 fn decode_is_copy() -> bool {
10288 false
10289 }
10290 }
10291
10292 impl fidl::encoding::ValueTypeMarker for SystemStatus {
10293 type Borrowed<'a> = Self;
10294 #[inline(always)]
10295 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10296 *value
10297 }
10298 }
10299
10300 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SystemStatus {
10301 #[inline]
10302 unsafe fn encode(
10303 self,
10304 encoder: &mut fidl::encoding::Encoder<'_, D>,
10305 offset: usize,
10306 _depth: fidl::encoding::Depth,
10307 ) -> fidl::Result<()> {
10308 encoder.debug_check_bounds::<Self>(offset);
10309 encoder.write_num(self.into_primitive(), offset);
10310 Ok(())
10311 }
10312 }
10313
10314 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SystemStatus {
10315 #[inline(always)]
10316 fn new_empty() -> Self {
10317 Self::PowerOn
10318 }
10319
10320 #[inline]
10321 unsafe fn decode(
10322 &mut self,
10323 decoder: &mut fidl::encoding::Decoder<'_, D>,
10324 offset: usize,
10325 _depth: fidl::encoding::Depth,
10326 ) -> fidl::Result<()> {
10327 decoder.debug_check_bounds::<Self>(offset);
10328 let prim = decoder.read_num::<u8>(offset);
10329
10330 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
10331 Ok(())
10332 }
10333 }
10334 unsafe impl fidl::encoding::TypeMarker for TargetAvcError {
10335 type Owned = Self;
10336
10337 #[inline(always)]
10338 fn inline_align(_context: fidl::encoding::Context) -> usize {
10339 std::mem::align_of::<u32>()
10340 }
10341
10342 #[inline(always)]
10343 fn inline_size(_context: fidl::encoding::Context) -> usize {
10344 std::mem::size_of::<u32>()
10345 }
10346
10347 #[inline(always)]
10348 fn encode_is_copy() -> bool {
10349 true
10350 }
10351
10352 #[inline(always)]
10353 fn decode_is_copy() -> bool {
10354 false
10355 }
10356 }
10357
10358 impl fidl::encoding::ValueTypeMarker for TargetAvcError {
10359 type Borrowed<'a> = Self;
10360 #[inline(always)]
10361 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10362 *value
10363 }
10364 }
10365
10366 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for TargetAvcError {
10367 #[inline]
10368 unsafe fn encode(
10369 self,
10370 encoder: &mut fidl::encoding::Encoder<'_, D>,
10371 offset: usize,
10372 _depth: fidl::encoding::Depth,
10373 ) -> fidl::Result<()> {
10374 encoder.debug_check_bounds::<Self>(offset);
10375 encoder.write_num(self.into_primitive(), offset);
10376 Ok(())
10377 }
10378 }
10379
10380 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TargetAvcError {
10381 #[inline(always)]
10382 fn new_empty() -> Self {
10383 Self::RejectedInvalidCommand
10384 }
10385
10386 #[inline]
10387 unsafe fn decode(
10388 &mut self,
10389 decoder: &mut fidl::encoding::Decoder<'_, D>,
10390 offset: usize,
10391 _depth: fidl::encoding::Depth,
10392 ) -> fidl::Result<()> {
10393 decoder.debug_check_bounds::<Self>(offset);
10394 let prim = decoder.read_num::<u32>(offset);
10395
10396 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
10397 Ok(())
10398 }
10399 }
10400 unsafe impl fidl::encoding::TypeMarker for TargetPassthroughError {
10401 type Owned = Self;
10402
10403 #[inline(always)]
10404 fn inline_align(_context: fidl::encoding::Context) -> usize {
10405 std::mem::align_of::<u32>()
10406 }
10407
10408 #[inline(always)]
10409 fn inline_size(_context: fidl::encoding::Context) -> usize {
10410 std::mem::size_of::<u32>()
10411 }
10412
10413 #[inline(always)]
10414 fn encode_is_copy() -> bool {
10415 true
10416 }
10417
10418 #[inline(always)]
10419 fn decode_is_copy() -> bool {
10420 false
10421 }
10422 }
10423
10424 impl fidl::encoding::ValueTypeMarker for TargetPassthroughError {
10425 type Borrowed<'a> = Self;
10426 #[inline(always)]
10427 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10428 *value
10429 }
10430 }
10431
10432 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
10433 for TargetPassthroughError
10434 {
10435 #[inline]
10436 unsafe fn encode(
10437 self,
10438 encoder: &mut fidl::encoding::Encoder<'_, D>,
10439 offset: usize,
10440 _depth: fidl::encoding::Depth,
10441 ) -> fidl::Result<()> {
10442 encoder.debug_check_bounds::<Self>(offset);
10443 encoder.write_num(self.into_primitive(), offset);
10444 Ok(())
10445 }
10446 }
10447
10448 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10449 for TargetPassthroughError
10450 {
10451 #[inline(always)]
10452 fn new_empty() -> Self {
10453 Self::CommandNotImplemented
10454 }
10455
10456 #[inline]
10457 unsafe fn decode(
10458 &mut self,
10459 decoder: &mut fidl::encoding::Decoder<'_, D>,
10460 offset: usize,
10461 _depth: fidl::encoding::Depth,
10462 ) -> fidl::Result<()> {
10463 decoder.debug_check_bounds::<Self>(offset);
10464 let prim = decoder.read_num::<u32>(offset);
10465
10466 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
10467 Ok(())
10468 }
10469 }
10470
10471 impl fidl::encoding::ValueTypeMarker for AbsoluteVolumeHandlerGetCurrentVolumeResponse {
10472 type Borrowed<'a> = &'a Self;
10473 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10474 value
10475 }
10476 }
10477
10478 unsafe impl fidl::encoding::TypeMarker for AbsoluteVolumeHandlerGetCurrentVolumeResponse {
10479 type Owned = Self;
10480
10481 #[inline(always)]
10482 fn inline_align(_context: fidl::encoding::Context) -> usize {
10483 1
10484 }
10485
10486 #[inline(always)]
10487 fn inline_size(_context: fidl::encoding::Context) -> usize {
10488 1
10489 }
10490 #[inline(always)]
10491 fn encode_is_copy() -> bool {
10492 true
10493 }
10494
10495 #[inline(always)]
10496 fn decode_is_copy() -> bool {
10497 true
10498 }
10499 }
10500
10501 unsafe impl<D: fidl::encoding::ResourceDialect>
10502 fidl::encoding::Encode<AbsoluteVolumeHandlerGetCurrentVolumeResponse, D>
10503 for &AbsoluteVolumeHandlerGetCurrentVolumeResponse
10504 {
10505 #[inline]
10506 unsafe fn encode(
10507 self,
10508 encoder: &mut fidl::encoding::Encoder<'_, D>,
10509 offset: usize,
10510 _depth: fidl::encoding::Depth,
10511 ) -> fidl::Result<()> {
10512 encoder.debug_check_bounds::<AbsoluteVolumeHandlerGetCurrentVolumeResponse>(offset);
10513 unsafe {
10514 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10516 (buf_ptr as *mut AbsoluteVolumeHandlerGetCurrentVolumeResponse).write_unaligned(
10517 (self as *const AbsoluteVolumeHandlerGetCurrentVolumeResponse).read(),
10518 );
10519 }
10522 Ok(())
10523 }
10524 }
10525 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
10526 fidl::encoding::Encode<AbsoluteVolumeHandlerGetCurrentVolumeResponse, D> for (T0,)
10527 {
10528 #[inline]
10529 unsafe fn encode(
10530 self,
10531 encoder: &mut fidl::encoding::Encoder<'_, D>,
10532 offset: usize,
10533 depth: fidl::encoding::Depth,
10534 ) -> fidl::Result<()> {
10535 encoder.debug_check_bounds::<AbsoluteVolumeHandlerGetCurrentVolumeResponse>(offset);
10536 self.0.encode(encoder, offset + 0, depth)?;
10540 Ok(())
10541 }
10542 }
10543
10544 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10545 for AbsoluteVolumeHandlerGetCurrentVolumeResponse
10546 {
10547 #[inline(always)]
10548 fn new_empty() -> Self {
10549 Self { volume: fidl::new_empty!(u8, D) }
10550 }
10551
10552 #[inline]
10553 unsafe fn decode(
10554 &mut self,
10555 decoder: &mut fidl::encoding::Decoder<'_, D>,
10556 offset: usize,
10557 _depth: fidl::encoding::Depth,
10558 ) -> fidl::Result<()> {
10559 decoder.debug_check_bounds::<Self>(offset);
10560 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10561 unsafe {
10564 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
10565 }
10566 Ok(())
10567 }
10568 }
10569
10570 impl fidl::encoding::ValueTypeMarker for AbsoluteVolumeHandlerOnVolumeChangedResponse {
10571 type Borrowed<'a> = &'a Self;
10572 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10573 value
10574 }
10575 }
10576
10577 unsafe impl fidl::encoding::TypeMarker for AbsoluteVolumeHandlerOnVolumeChangedResponse {
10578 type Owned = Self;
10579
10580 #[inline(always)]
10581 fn inline_align(_context: fidl::encoding::Context) -> usize {
10582 1
10583 }
10584
10585 #[inline(always)]
10586 fn inline_size(_context: fidl::encoding::Context) -> usize {
10587 1
10588 }
10589 #[inline(always)]
10590 fn encode_is_copy() -> bool {
10591 true
10592 }
10593
10594 #[inline(always)]
10595 fn decode_is_copy() -> bool {
10596 true
10597 }
10598 }
10599
10600 unsafe impl<D: fidl::encoding::ResourceDialect>
10601 fidl::encoding::Encode<AbsoluteVolumeHandlerOnVolumeChangedResponse, D>
10602 for &AbsoluteVolumeHandlerOnVolumeChangedResponse
10603 {
10604 #[inline]
10605 unsafe fn encode(
10606 self,
10607 encoder: &mut fidl::encoding::Encoder<'_, D>,
10608 offset: usize,
10609 _depth: fidl::encoding::Depth,
10610 ) -> fidl::Result<()> {
10611 encoder.debug_check_bounds::<AbsoluteVolumeHandlerOnVolumeChangedResponse>(offset);
10612 unsafe {
10613 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10615 (buf_ptr as *mut AbsoluteVolumeHandlerOnVolumeChangedResponse).write_unaligned(
10616 (self as *const AbsoluteVolumeHandlerOnVolumeChangedResponse).read(),
10617 );
10618 }
10621 Ok(())
10622 }
10623 }
10624 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
10625 fidl::encoding::Encode<AbsoluteVolumeHandlerOnVolumeChangedResponse, D> for (T0,)
10626 {
10627 #[inline]
10628 unsafe fn encode(
10629 self,
10630 encoder: &mut fidl::encoding::Encoder<'_, D>,
10631 offset: usize,
10632 depth: fidl::encoding::Depth,
10633 ) -> fidl::Result<()> {
10634 encoder.debug_check_bounds::<AbsoluteVolumeHandlerOnVolumeChangedResponse>(offset);
10635 self.0.encode(encoder, offset + 0, depth)?;
10639 Ok(())
10640 }
10641 }
10642
10643 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10644 for AbsoluteVolumeHandlerOnVolumeChangedResponse
10645 {
10646 #[inline(always)]
10647 fn new_empty() -> Self {
10648 Self { new_volume: fidl::new_empty!(u8, D) }
10649 }
10650
10651 #[inline]
10652 unsafe fn decode(
10653 &mut self,
10654 decoder: &mut fidl::encoding::Decoder<'_, D>,
10655 offset: usize,
10656 _depth: fidl::encoding::Depth,
10657 ) -> fidl::Result<()> {
10658 decoder.debug_check_bounds::<Self>(offset);
10659 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10660 unsafe {
10663 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
10664 }
10665 Ok(())
10666 }
10667 }
10668
10669 impl fidl::encoding::ValueTypeMarker for AbsoluteVolumeHandlerSetVolumeRequest {
10670 type Borrowed<'a> = &'a Self;
10671 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10672 value
10673 }
10674 }
10675
10676 unsafe impl fidl::encoding::TypeMarker for AbsoluteVolumeHandlerSetVolumeRequest {
10677 type Owned = Self;
10678
10679 #[inline(always)]
10680 fn inline_align(_context: fidl::encoding::Context) -> usize {
10681 1
10682 }
10683
10684 #[inline(always)]
10685 fn inline_size(_context: fidl::encoding::Context) -> usize {
10686 1
10687 }
10688 #[inline(always)]
10689 fn encode_is_copy() -> bool {
10690 true
10691 }
10692
10693 #[inline(always)]
10694 fn decode_is_copy() -> bool {
10695 true
10696 }
10697 }
10698
10699 unsafe impl<D: fidl::encoding::ResourceDialect>
10700 fidl::encoding::Encode<AbsoluteVolumeHandlerSetVolumeRequest, D>
10701 for &AbsoluteVolumeHandlerSetVolumeRequest
10702 {
10703 #[inline]
10704 unsafe fn encode(
10705 self,
10706 encoder: &mut fidl::encoding::Encoder<'_, D>,
10707 offset: usize,
10708 _depth: fidl::encoding::Depth,
10709 ) -> fidl::Result<()> {
10710 encoder.debug_check_bounds::<AbsoluteVolumeHandlerSetVolumeRequest>(offset);
10711 unsafe {
10712 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10714 (buf_ptr as *mut AbsoluteVolumeHandlerSetVolumeRequest)
10715 .write_unaligned((self as *const AbsoluteVolumeHandlerSetVolumeRequest).read());
10716 }
10719 Ok(())
10720 }
10721 }
10722 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
10723 fidl::encoding::Encode<AbsoluteVolumeHandlerSetVolumeRequest, D> for (T0,)
10724 {
10725 #[inline]
10726 unsafe fn encode(
10727 self,
10728 encoder: &mut fidl::encoding::Encoder<'_, D>,
10729 offset: usize,
10730 depth: fidl::encoding::Depth,
10731 ) -> fidl::Result<()> {
10732 encoder.debug_check_bounds::<AbsoluteVolumeHandlerSetVolumeRequest>(offset);
10733 self.0.encode(encoder, offset + 0, depth)?;
10737 Ok(())
10738 }
10739 }
10740
10741 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10742 for AbsoluteVolumeHandlerSetVolumeRequest
10743 {
10744 #[inline(always)]
10745 fn new_empty() -> Self {
10746 Self { requested_volume: fidl::new_empty!(u8, D) }
10747 }
10748
10749 #[inline]
10750 unsafe fn decode(
10751 &mut self,
10752 decoder: &mut fidl::encoding::Decoder<'_, D>,
10753 offset: usize,
10754 _depth: fidl::encoding::Depth,
10755 ) -> fidl::Result<()> {
10756 decoder.debug_check_bounds::<Self>(offset);
10757 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10758 unsafe {
10761 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
10762 }
10763 Ok(())
10764 }
10765 }
10766
10767 impl fidl::encoding::ValueTypeMarker for AbsoluteVolumeHandlerSetVolumeResponse {
10768 type Borrowed<'a> = &'a Self;
10769 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10770 value
10771 }
10772 }
10773
10774 unsafe impl fidl::encoding::TypeMarker for AbsoluteVolumeHandlerSetVolumeResponse {
10775 type Owned = Self;
10776
10777 #[inline(always)]
10778 fn inline_align(_context: fidl::encoding::Context) -> usize {
10779 1
10780 }
10781
10782 #[inline(always)]
10783 fn inline_size(_context: fidl::encoding::Context) -> usize {
10784 1
10785 }
10786 #[inline(always)]
10787 fn encode_is_copy() -> bool {
10788 true
10789 }
10790
10791 #[inline(always)]
10792 fn decode_is_copy() -> bool {
10793 true
10794 }
10795 }
10796
10797 unsafe impl<D: fidl::encoding::ResourceDialect>
10798 fidl::encoding::Encode<AbsoluteVolumeHandlerSetVolumeResponse, D>
10799 for &AbsoluteVolumeHandlerSetVolumeResponse
10800 {
10801 #[inline]
10802 unsafe fn encode(
10803 self,
10804 encoder: &mut fidl::encoding::Encoder<'_, D>,
10805 offset: usize,
10806 _depth: fidl::encoding::Depth,
10807 ) -> fidl::Result<()> {
10808 encoder.debug_check_bounds::<AbsoluteVolumeHandlerSetVolumeResponse>(offset);
10809 unsafe {
10810 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10812 (buf_ptr as *mut AbsoluteVolumeHandlerSetVolumeResponse).write_unaligned(
10813 (self as *const AbsoluteVolumeHandlerSetVolumeResponse).read(),
10814 );
10815 }
10818 Ok(())
10819 }
10820 }
10821 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
10822 fidl::encoding::Encode<AbsoluteVolumeHandlerSetVolumeResponse, D> for (T0,)
10823 {
10824 #[inline]
10825 unsafe fn encode(
10826 self,
10827 encoder: &mut fidl::encoding::Encoder<'_, D>,
10828 offset: usize,
10829 depth: fidl::encoding::Depth,
10830 ) -> fidl::Result<()> {
10831 encoder.debug_check_bounds::<AbsoluteVolumeHandlerSetVolumeResponse>(offset);
10832 self.0.encode(encoder, offset + 0, depth)?;
10836 Ok(())
10837 }
10838 }
10839
10840 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
10841 for AbsoluteVolumeHandlerSetVolumeResponse
10842 {
10843 #[inline(always)]
10844 fn new_empty() -> Self {
10845 Self { set_volume: fidl::new_empty!(u8, D) }
10846 }
10847
10848 #[inline]
10849 unsafe fn decode(
10850 &mut self,
10851 decoder: &mut fidl::encoding::Decoder<'_, D>,
10852 offset: usize,
10853 _depth: fidl::encoding::Depth,
10854 ) -> fidl::Result<()> {
10855 decoder.debug_check_bounds::<Self>(offset);
10856 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10857 unsafe {
10860 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
10861 }
10862 Ok(())
10863 }
10864 }
10865
10866 impl fidl::encoding::ValueTypeMarker for AddressedPlayerId {
10867 type Borrowed<'a> = &'a Self;
10868 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10869 value
10870 }
10871 }
10872
10873 unsafe impl fidl::encoding::TypeMarker for AddressedPlayerId {
10874 type Owned = Self;
10875
10876 #[inline(always)]
10877 fn inline_align(_context: fidl::encoding::Context) -> usize {
10878 2
10879 }
10880
10881 #[inline(always)]
10882 fn inline_size(_context: fidl::encoding::Context) -> usize {
10883 2
10884 }
10885 #[inline(always)]
10886 fn encode_is_copy() -> bool {
10887 true
10888 }
10889
10890 #[inline(always)]
10891 fn decode_is_copy() -> bool {
10892 true
10893 }
10894 }
10895
10896 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddressedPlayerId, D>
10897 for &AddressedPlayerId
10898 {
10899 #[inline]
10900 unsafe fn encode(
10901 self,
10902 encoder: &mut fidl::encoding::Encoder<'_, D>,
10903 offset: usize,
10904 _depth: fidl::encoding::Depth,
10905 ) -> fidl::Result<()> {
10906 encoder.debug_check_bounds::<AddressedPlayerId>(offset);
10907 unsafe {
10908 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
10910 (buf_ptr as *mut AddressedPlayerId)
10911 .write_unaligned((self as *const AddressedPlayerId).read());
10912 }
10915 Ok(())
10916 }
10917 }
10918 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
10919 fidl::encoding::Encode<AddressedPlayerId, D> for (T0,)
10920 {
10921 #[inline]
10922 unsafe fn encode(
10923 self,
10924 encoder: &mut fidl::encoding::Encoder<'_, D>,
10925 offset: usize,
10926 depth: fidl::encoding::Depth,
10927 ) -> fidl::Result<()> {
10928 encoder.debug_check_bounds::<AddressedPlayerId>(offset);
10929 self.0.encode(encoder, offset + 0, depth)?;
10933 Ok(())
10934 }
10935 }
10936
10937 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddressedPlayerId {
10938 #[inline(always)]
10939 fn new_empty() -> Self {
10940 Self { id: fidl::new_empty!(u16, D) }
10941 }
10942
10943 #[inline]
10944 unsafe fn decode(
10945 &mut self,
10946 decoder: &mut fidl::encoding::Decoder<'_, D>,
10947 offset: usize,
10948 _depth: fidl::encoding::Depth,
10949 ) -> fidl::Result<()> {
10950 decoder.debug_check_bounds::<Self>(offset);
10951 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
10952 unsafe {
10955 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
10956 }
10957 Ok(())
10958 }
10959 }
10960
10961 impl fidl::encoding::ValueTypeMarker for BrowseControllerChangePathRequest {
10962 type Borrowed<'a> = &'a Self;
10963 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10964 value
10965 }
10966 }
10967
10968 unsafe impl fidl::encoding::TypeMarker for BrowseControllerChangePathRequest {
10969 type Owned = Self;
10970
10971 #[inline(always)]
10972 fn inline_align(_context: fidl::encoding::Context) -> usize {
10973 8
10974 }
10975
10976 #[inline(always)]
10977 fn inline_size(_context: fidl::encoding::Context) -> usize {
10978 16
10979 }
10980 }
10981
10982 unsafe impl<D: fidl::encoding::ResourceDialect>
10983 fidl::encoding::Encode<BrowseControllerChangePathRequest, D>
10984 for &BrowseControllerChangePathRequest
10985 {
10986 #[inline]
10987 unsafe fn encode(
10988 self,
10989 encoder: &mut fidl::encoding::Encoder<'_, D>,
10990 offset: usize,
10991 _depth: fidl::encoding::Depth,
10992 ) -> fidl::Result<()> {
10993 encoder.debug_check_bounds::<BrowseControllerChangePathRequest>(offset);
10994 fidl::encoding::Encode::<BrowseControllerChangePathRequest, D>::encode(
10996 (<Path as fidl::encoding::ValueTypeMarker>::borrow(&self.path),),
10997 encoder,
10998 offset,
10999 _depth,
11000 )
11001 }
11002 }
11003 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Path, D>>
11004 fidl::encoding::Encode<BrowseControllerChangePathRequest, D> for (T0,)
11005 {
11006 #[inline]
11007 unsafe fn encode(
11008 self,
11009 encoder: &mut fidl::encoding::Encoder<'_, D>,
11010 offset: usize,
11011 depth: fidl::encoding::Depth,
11012 ) -> fidl::Result<()> {
11013 encoder.debug_check_bounds::<BrowseControllerChangePathRequest>(offset);
11014 self.0.encode(encoder, offset + 0, depth)?;
11018 Ok(())
11019 }
11020 }
11021
11022 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11023 for BrowseControllerChangePathRequest
11024 {
11025 #[inline(always)]
11026 fn new_empty() -> Self {
11027 Self { path: fidl::new_empty!(Path, D) }
11028 }
11029
11030 #[inline]
11031 unsafe fn decode(
11032 &mut self,
11033 decoder: &mut fidl::encoding::Decoder<'_, D>,
11034 offset: usize,
11035 _depth: fidl::encoding::Depth,
11036 ) -> fidl::Result<()> {
11037 decoder.debug_check_bounds::<Self>(offset);
11038 fidl::decode!(Path, D, &mut self.path, decoder, offset + 0, _depth)?;
11040 Ok(())
11041 }
11042 }
11043
11044 impl fidl::encoding::ValueTypeMarker for BrowseControllerGetFileSystemItemsRequest {
11045 type Borrowed<'a> = &'a Self;
11046 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11047 value
11048 }
11049 }
11050
11051 unsafe impl fidl::encoding::TypeMarker for BrowseControllerGetFileSystemItemsRequest {
11052 type Owned = Self;
11053
11054 #[inline(always)]
11055 fn inline_align(_context: fidl::encoding::Context) -> usize {
11056 8
11057 }
11058
11059 #[inline(always)]
11060 fn inline_size(_context: fidl::encoding::Context) -> usize {
11061 24
11062 }
11063 }
11064
11065 unsafe impl<D: fidl::encoding::ResourceDialect>
11066 fidl::encoding::Encode<BrowseControllerGetFileSystemItemsRequest, D>
11067 for &BrowseControllerGetFileSystemItemsRequest
11068 {
11069 #[inline]
11070 unsafe fn encode(
11071 self,
11072 encoder: &mut fidl::encoding::Encoder<'_, D>,
11073 offset: usize,
11074 _depth: fidl::encoding::Depth,
11075 ) -> fidl::Result<()> {
11076 encoder.debug_check_bounds::<BrowseControllerGetFileSystemItemsRequest>(offset);
11077 fidl::encoding::Encode::<BrowseControllerGetFileSystemItemsRequest, D>::encode(
11079 (
11080 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.start_index),
11081 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_index),
11082 <AttributeRequestOption as fidl::encoding::ValueTypeMarker>::borrow(
11083 &self.attribute_option,
11084 ),
11085 ),
11086 encoder,
11087 offset,
11088 _depth,
11089 )
11090 }
11091 }
11092 unsafe impl<
11093 D: fidl::encoding::ResourceDialect,
11094 T0: fidl::encoding::Encode<u32, D>,
11095 T1: fidl::encoding::Encode<u32, D>,
11096 T2: fidl::encoding::Encode<AttributeRequestOption, D>,
11097 > fidl::encoding::Encode<BrowseControllerGetFileSystemItemsRequest, D> for (T0, T1, T2)
11098 {
11099 #[inline]
11100 unsafe fn encode(
11101 self,
11102 encoder: &mut fidl::encoding::Encoder<'_, D>,
11103 offset: usize,
11104 depth: fidl::encoding::Depth,
11105 ) -> fidl::Result<()> {
11106 encoder.debug_check_bounds::<BrowseControllerGetFileSystemItemsRequest>(offset);
11107 self.0.encode(encoder, offset + 0, depth)?;
11111 self.1.encode(encoder, offset + 4, depth)?;
11112 self.2.encode(encoder, offset + 8, depth)?;
11113 Ok(())
11114 }
11115 }
11116
11117 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11118 for BrowseControllerGetFileSystemItemsRequest
11119 {
11120 #[inline(always)]
11121 fn new_empty() -> Self {
11122 Self {
11123 start_index: fidl::new_empty!(u32, D),
11124 end_index: fidl::new_empty!(u32, D),
11125 attribute_option: fidl::new_empty!(AttributeRequestOption, D),
11126 }
11127 }
11128
11129 #[inline]
11130 unsafe fn decode(
11131 &mut self,
11132 decoder: &mut fidl::encoding::Decoder<'_, D>,
11133 offset: usize,
11134 _depth: fidl::encoding::Depth,
11135 ) -> fidl::Result<()> {
11136 decoder.debug_check_bounds::<Self>(offset);
11137 fidl::decode!(u32, D, &mut self.start_index, decoder, offset + 0, _depth)?;
11139 fidl::decode!(u32, D, &mut self.end_index, decoder, offset + 4, _depth)?;
11140 fidl::decode!(
11141 AttributeRequestOption,
11142 D,
11143 &mut self.attribute_option,
11144 decoder,
11145 offset + 8,
11146 _depth
11147 )?;
11148 Ok(())
11149 }
11150 }
11151
11152 impl fidl::encoding::ValueTypeMarker for BrowseControllerGetMediaPlayerItemsRequest {
11153 type Borrowed<'a> = &'a Self;
11154 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11155 value
11156 }
11157 }
11158
11159 unsafe impl fidl::encoding::TypeMarker for BrowseControllerGetMediaPlayerItemsRequest {
11160 type Owned = Self;
11161
11162 #[inline(always)]
11163 fn inline_align(_context: fidl::encoding::Context) -> usize {
11164 4
11165 }
11166
11167 #[inline(always)]
11168 fn inline_size(_context: fidl::encoding::Context) -> usize {
11169 8
11170 }
11171 #[inline(always)]
11172 fn encode_is_copy() -> bool {
11173 true
11174 }
11175
11176 #[inline(always)]
11177 fn decode_is_copy() -> bool {
11178 true
11179 }
11180 }
11181
11182 unsafe impl<D: fidl::encoding::ResourceDialect>
11183 fidl::encoding::Encode<BrowseControllerGetMediaPlayerItemsRequest, D>
11184 for &BrowseControllerGetMediaPlayerItemsRequest
11185 {
11186 #[inline]
11187 unsafe fn encode(
11188 self,
11189 encoder: &mut fidl::encoding::Encoder<'_, D>,
11190 offset: usize,
11191 _depth: fidl::encoding::Depth,
11192 ) -> fidl::Result<()> {
11193 encoder.debug_check_bounds::<BrowseControllerGetMediaPlayerItemsRequest>(offset);
11194 unsafe {
11195 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11197 (buf_ptr as *mut BrowseControllerGetMediaPlayerItemsRequest).write_unaligned(
11198 (self as *const BrowseControllerGetMediaPlayerItemsRequest).read(),
11199 );
11200 }
11203 Ok(())
11204 }
11205 }
11206 unsafe impl<
11207 D: fidl::encoding::ResourceDialect,
11208 T0: fidl::encoding::Encode<u32, D>,
11209 T1: fidl::encoding::Encode<u32, D>,
11210 > fidl::encoding::Encode<BrowseControllerGetMediaPlayerItemsRequest, D> for (T0, T1)
11211 {
11212 #[inline]
11213 unsafe fn encode(
11214 self,
11215 encoder: &mut fidl::encoding::Encoder<'_, D>,
11216 offset: usize,
11217 depth: fidl::encoding::Depth,
11218 ) -> fidl::Result<()> {
11219 encoder.debug_check_bounds::<BrowseControllerGetMediaPlayerItemsRequest>(offset);
11220 self.0.encode(encoder, offset + 0, depth)?;
11224 self.1.encode(encoder, offset + 4, depth)?;
11225 Ok(())
11226 }
11227 }
11228
11229 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11230 for BrowseControllerGetMediaPlayerItemsRequest
11231 {
11232 #[inline(always)]
11233 fn new_empty() -> Self {
11234 Self { start_index: fidl::new_empty!(u32, D), end_index: fidl::new_empty!(u32, D) }
11235 }
11236
11237 #[inline]
11238 unsafe fn decode(
11239 &mut self,
11240 decoder: &mut fidl::encoding::Decoder<'_, D>,
11241 offset: usize,
11242 _depth: fidl::encoding::Depth,
11243 ) -> fidl::Result<()> {
11244 decoder.debug_check_bounds::<Self>(offset);
11245 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11246 unsafe {
11249 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
11250 }
11251 Ok(())
11252 }
11253 }
11254
11255 impl fidl::encoding::ValueTypeMarker for BrowseControllerGetNowPlayingItemsRequest {
11256 type Borrowed<'a> = &'a Self;
11257 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11258 value
11259 }
11260 }
11261
11262 unsafe impl fidl::encoding::TypeMarker for BrowseControllerGetNowPlayingItemsRequest {
11263 type Owned = Self;
11264
11265 #[inline(always)]
11266 fn inline_align(_context: fidl::encoding::Context) -> usize {
11267 8
11268 }
11269
11270 #[inline(always)]
11271 fn inline_size(_context: fidl::encoding::Context) -> usize {
11272 24
11273 }
11274 }
11275
11276 unsafe impl<D: fidl::encoding::ResourceDialect>
11277 fidl::encoding::Encode<BrowseControllerGetNowPlayingItemsRequest, D>
11278 for &BrowseControllerGetNowPlayingItemsRequest
11279 {
11280 #[inline]
11281 unsafe fn encode(
11282 self,
11283 encoder: &mut fidl::encoding::Encoder<'_, D>,
11284 offset: usize,
11285 _depth: fidl::encoding::Depth,
11286 ) -> fidl::Result<()> {
11287 encoder.debug_check_bounds::<BrowseControllerGetNowPlayingItemsRequest>(offset);
11288 fidl::encoding::Encode::<BrowseControllerGetNowPlayingItemsRequest, D>::encode(
11290 (
11291 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.start_index),
11292 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_index),
11293 <AttributeRequestOption as fidl::encoding::ValueTypeMarker>::borrow(
11294 &self.attribute_option,
11295 ),
11296 ),
11297 encoder,
11298 offset,
11299 _depth,
11300 )
11301 }
11302 }
11303 unsafe impl<
11304 D: fidl::encoding::ResourceDialect,
11305 T0: fidl::encoding::Encode<u32, D>,
11306 T1: fidl::encoding::Encode<u32, D>,
11307 T2: fidl::encoding::Encode<AttributeRequestOption, D>,
11308 > fidl::encoding::Encode<BrowseControllerGetNowPlayingItemsRequest, D> for (T0, T1, T2)
11309 {
11310 #[inline]
11311 unsafe fn encode(
11312 self,
11313 encoder: &mut fidl::encoding::Encoder<'_, D>,
11314 offset: usize,
11315 depth: fidl::encoding::Depth,
11316 ) -> fidl::Result<()> {
11317 encoder.debug_check_bounds::<BrowseControllerGetNowPlayingItemsRequest>(offset);
11318 self.0.encode(encoder, offset + 0, depth)?;
11322 self.1.encode(encoder, offset + 4, depth)?;
11323 self.2.encode(encoder, offset + 8, depth)?;
11324 Ok(())
11325 }
11326 }
11327
11328 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11329 for BrowseControllerGetNowPlayingItemsRequest
11330 {
11331 #[inline(always)]
11332 fn new_empty() -> Self {
11333 Self {
11334 start_index: fidl::new_empty!(u32, D),
11335 end_index: fidl::new_empty!(u32, D),
11336 attribute_option: fidl::new_empty!(AttributeRequestOption, D),
11337 }
11338 }
11339
11340 #[inline]
11341 unsafe fn decode(
11342 &mut self,
11343 decoder: &mut fidl::encoding::Decoder<'_, D>,
11344 offset: usize,
11345 _depth: fidl::encoding::Depth,
11346 ) -> fidl::Result<()> {
11347 decoder.debug_check_bounds::<Self>(offset);
11348 fidl::decode!(u32, D, &mut self.start_index, decoder, offset + 0, _depth)?;
11350 fidl::decode!(u32, D, &mut self.end_index, decoder, offset + 4, _depth)?;
11351 fidl::decode!(
11352 AttributeRequestOption,
11353 D,
11354 &mut self.attribute_option,
11355 decoder,
11356 offset + 8,
11357 _depth
11358 )?;
11359 Ok(())
11360 }
11361 }
11362
11363 impl fidl::encoding::ValueTypeMarker for BrowseControllerPlayFileSystemItemRequest {
11364 type Borrowed<'a> = &'a Self;
11365 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11366 value
11367 }
11368 }
11369
11370 unsafe impl fidl::encoding::TypeMarker for BrowseControllerPlayFileSystemItemRequest {
11371 type Owned = Self;
11372
11373 #[inline(always)]
11374 fn inline_align(_context: fidl::encoding::Context) -> usize {
11375 8
11376 }
11377
11378 #[inline(always)]
11379 fn inline_size(_context: fidl::encoding::Context) -> usize {
11380 8
11381 }
11382 #[inline(always)]
11383 fn encode_is_copy() -> bool {
11384 true
11385 }
11386
11387 #[inline(always)]
11388 fn decode_is_copy() -> bool {
11389 true
11390 }
11391 }
11392
11393 unsafe impl<D: fidl::encoding::ResourceDialect>
11394 fidl::encoding::Encode<BrowseControllerPlayFileSystemItemRequest, D>
11395 for &BrowseControllerPlayFileSystemItemRequest
11396 {
11397 #[inline]
11398 unsafe fn encode(
11399 self,
11400 encoder: &mut fidl::encoding::Encoder<'_, D>,
11401 offset: usize,
11402 _depth: fidl::encoding::Depth,
11403 ) -> fidl::Result<()> {
11404 encoder.debug_check_bounds::<BrowseControllerPlayFileSystemItemRequest>(offset);
11405 unsafe {
11406 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11408 (buf_ptr as *mut BrowseControllerPlayFileSystemItemRequest).write_unaligned(
11409 (self as *const BrowseControllerPlayFileSystemItemRequest).read(),
11410 );
11411 }
11414 Ok(())
11415 }
11416 }
11417 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
11418 fidl::encoding::Encode<BrowseControllerPlayFileSystemItemRequest, D> for (T0,)
11419 {
11420 #[inline]
11421 unsafe fn encode(
11422 self,
11423 encoder: &mut fidl::encoding::Encoder<'_, D>,
11424 offset: usize,
11425 depth: fidl::encoding::Depth,
11426 ) -> fidl::Result<()> {
11427 encoder.debug_check_bounds::<BrowseControllerPlayFileSystemItemRequest>(offset);
11428 self.0.encode(encoder, offset + 0, depth)?;
11432 Ok(())
11433 }
11434 }
11435
11436 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11437 for BrowseControllerPlayFileSystemItemRequest
11438 {
11439 #[inline(always)]
11440 fn new_empty() -> Self {
11441 Self { uid: fidl::new_empty!(u64, D) }
11442 }
11443
11444 #[inline]
11445 unsafe fn decode(
11446 &mut self,
11447 decoder: &mut fidl::encoding::Decoder<'_, D>,
11448 offset: usize,
11449 _depth: fidl::encoding::Depth,
11450 ) -> fidl::Result<()> {
11451 decoder.debug_check_bounds::<Self>(offset);
11452 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11453 unsafe {
11456 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
11457 }
11458 Ok(())
11459 }
11460 }
11461
11462 impl fidl::encoding::ValueTypeMarker for BrowseControllerPlayNowPlayingItemRequest {
11463 type Borrowed<'a> = &'a Self;
11464 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11465 value
11466 }
11467 }
11468
11469 unsafe impl fidl::encoding::TypeMarker for BrowseControllerPlayNowPlayingItemRequest {
11470 type Owned = Self;
11471
11472 #[inline(always)]
11473 fn inline_align(_context: fidl::encoding::Context) -> usize {
11474 8
11475 }
11476
11477 #[inline(always)]
11478 fn inline_size(_context: fidl::encoding::Context) -> usize {
11479 8
11480 }
11481 #[inline(always)]
11482 fn encode_is_copy() -> bool {
11483 true
11484 }
11485
11486 #[inline(always)]
11487 fn decode_is_copy() -> bool {
11488 true
11489 }
11490 }
11491
11492 unsafe impl<D: fidl::encoding::ResourceDialect>
11493 fidl::encoding::Encode<BrowseControllerPlayNowPlayingItemRequest, D>
11494 for &BrowseControllerPlayNowPlayingItemRequest
11495 {
11496 #[inline]
11497 unsafe fn encode(
11498 self,
11499 encoder: &mut fidl::encoding::Encoder<'_, D>,
11500 offset: usize,
11501 _depth: fidl::encoding::Depth,
11502 ) -> fidl::Result<()> {
11503 encoder.debug_check_bounds::<BrowseControllerPlayNowPlayingItemRequest>(offset);
11504 unsafe {
11505 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11507 (buf_ptr as *mut BrowseControllerPlayNowPlayingItemRequest).write_unaligned(
11508 (self as *const BrowseControllerPlayNowPlayingItemRequest).read(),
11509 );
11510 }
11513 Ok(())
11514 }
11515 }
11516 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
11517 fidl::encoding::Encode<BrowseControllerPlayNowPlayingItemRequest, D> for (T0,)
11518 {
11519 #[inline]
11520 unsafe fn encode(
11521 self,
11522 encoder: &mut fidl::encoding::Encoder<'_, D>,
11523 offset: usize,
11524 depth: fidl::encoding::Depth,
11525 ) -> fidl::Result<()> {
11526 encoder.debug_check_bounds::<BrowseControllerPlayNowPlayingItemRequest>(offset);
11527 self.0.encode(encoder, offset + 0, depth)?;
11531 Ok(())
11532 }
11533 }
11534
11535 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11536 for BrowseControllerPlayNowPlayingItemRequest
11537 {
11538 #[inline(always)]
11539 fn new_empty() -> Self {
11540 Self { uid: fidl::new_empty!(u64, D) }
11541 }
11542
11543 #[inline]
11544 unsafe fn decode(
11545 &mut self,
11546 decoder: &mut fidl::encoding::Decoder<'_, D>,
11547 offset: usize,
11548 _depth: fidl::encoding::Depth,
11549 ) -> fidl::Result<()> {
11550 decoder.debug_check_bounds::<Self>(offset);
11551 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11552 unsafe {
11555 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
11556 }
11557 Ok(())
11558 }
11559 }
11560
11561 impl fidl::encoding::ValueTypeMarker for BrowseControllerSetBrowsedPlayerRequest {
11562 type Borrowed<'a> = &'a Self;
11563 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11564 value
11565 }
11566 }
11567
11568 unsafe impl fidl::encoding::TypeMarker for BrowseControllerSetBrowsedPlayerRequest {
11569 type Owned = Self;
11570
11571 #[inline(always)]
11572 fn inline_align(_context: fidl::encoding::Context) -> usize {
11573 2
11574 }
11575
11576 #[inline(always)]
11577 fn inline_size(_context: fidl::encoding::Context) -> usize {
11578 2
11579 }
11580 #[inline(always)]
11581 fn encode_is_copy() -> bool {
11582 true
11583 }
11584
11585 #[inline(always)]
11586 fn decode_is_copy() -> bool {
11587 true
11588 }
11589 }
11590
11591 unsafe impl<D: fidl::encoding::ResourceDialect>
11592 fidl::encoding::Encode<BrowseControllerSetBrowsedPlayerRequest, D>
11593 for &BrowseControllerSetBrowsedPlayerRequest
11594 {
11595 #[inline]
11596 unsafe fn encode(
11597 self,
11598 encoder: &mut fidl::encoding::Encoder<'_, D>,
11599 offset: usize,
11600 _depth: fidl::encoding::Depth,
11601 ) -> fidl::Result<()> {
11602 encoder.debug_check_bounds::<BrowseControllerSetBrowsedPlayerRequest>(offset);
11603 unsafe {
11604 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11606 (buf_ptr as *mut BrowseControllerSetBrowsedPlayerRequest).write_unaligned(
11607 (self as *const BrowseControllerSetBrowsedPlayerRequest).read(),
11608 );
11609 }
11612 Ok(())
11613 }
11614 }
11615 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
11616 fidl::encoding::Encode<BrowseControllerSetBrowsedPlayerRequest, D> for (T0,)
11617 {
11618 #[inline]
11619 unsafe fn encode(
11620 self,
11621 encoder: &mut fidl::encoding::Encoder<'_, D>,
11622 offset: usize,
11623 depth: fidl::encoding::Depth,
11624 ) -> fidl::Result<()> {
11625 encoder.debug_check_bounds::<BrowseControllerSetBrowsedPlayerRequest>(offset);
11626 self.0.encode(encoder, offset + 0, depth)?;
11630 Ok(())
11631 }
11632 }
11633
11634 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11635 for BrowseControllerSetBrowsedPlayerRequest
11636 {
11637 #[inline(always)]
11638 fn new_empty() -> Self {
11639 Self { player_id: fidl::new_empty!(u16, D) }
11640 }
11641
11642 #[inline]
11643 unsafe fn decode(
11644 &mut self,
11645 decoder: &mut fidl::encoding::Decoder<'_, D>,
11646 offset: usize,
11647 _depth: fidl::encoding::Depth,
11648 ) -> fidl::Result<()> {
11649 decoder.debug_check_bounds::<Self>(offset);
11650 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11651 unsafe {
11654 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
11655 }
11656 Ok(())
11657 }
11658 }
11659
11660 impl fidl::encoding::ValueTypeMarker for BrowseControllerChangePathResponse {
11661 type Borrowed<'a> = &'a Self;
11662 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11663 value
11664 }
11665 }
11666
11667 unsafe impl fidl::encoding::TypeMarker for BrowseControllerChangePathResponse {
11668 type Owned = Self;
11669
11670 #[inline(always)]
11671 fn inline_align(_context: fidl::encoding::Context) -> usize {
11672 4
11673 }
11674
11675 #[inline(always)]
11676 fn inline_size(_context: fidl::encoding::Context) -> usize {
11677 4
11678 }
11679 #[inline(always)]
11680 fn encode_is_copy() -> bool {
11681 true
11682 }
11683
11684 #[inline(always)]
11685 fn decode_is_copy() -> bool {
11686 true
11687 }
11688 }
11689
11690 unsafe impl<D: fidl::encoding::ResourceDialect>
11691 fidl::encoding::Encode<BrowseControllerChangePathResponse, D>
11692 for &BrowseControllerChangePathResponse
11693 {
11694 #[inline]
11695 unsafe fn encode(
11696 self,
11697 encoder: &mut fidl::encoding::Encoder<'_, D>,
11698 offset: usize,
11699 _depth: fidl::encoding::Depth,
11700 ) -> fidl::Result<()> {
11701 encoder.debug_check_bounds::<BrowseControllerChangePathResponse>(offset);
11702 unsafe {
11703 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11705 (buf_ptr as *mut BrowseControllerChangePathResponse)
11706 .write_unaligned((self as *const BrowseControllerChangePathResponse).read());
11707 }
11710 Ok(())
11711 }
11712 }
11713 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11714 fidl::encoding::Encode<BrowseControllerChangePathResponse, D> for (T0,)
11715 {
11716 #[inline]
11717 unsafe fn encode(
11718 self,
11719 encoder: &mut fidl::encoding::Encoder<'_, D>,
11720 offset: usize,
11721 depth: fidl::encoding::Depth,
11722 ) -> fidl::Result<()> {
11723 encoder.debug_check_bounds::<BrowseControllerChangePathResponse>(offset);
11724 self.0.encode(encoder, offset + 0, depth)?;
11728 Ok(())
11729 }
11730 }
11731
11732 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11733 for BrowseControllerChangePathResponse
11734 {
11735 #[inline(always)]
11736 fn new_empty() -> Self {
11737 Self { num_items: fidl::new_empty!(u32, D) }
11738 }
11739
11740 #[inline]
11741 unsafe fn decode(
11742 &mut self,
11743 decoder: &mut fidl::encoding::Decoder<'_, D>,
11744 offset: usize,
11745 _depth: fidl::encoding::Depth,
11746 ) -> fidl::Result<()> {
11747 decoder.debug_check_bounds::<Self>(offset);
11748 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11749 unsafe {
11752 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11753 }
11754 Ok(())
11755 }
11756 }
11757
11758 impl fidl::encoding::ValueTypeMarker for BrowseControllerGetFileSystemItemsResponse {
11759 type Borrowed<'a> = &'a Self;
11760 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11761 value
11762 }
11763 }
11764
11765 unsafe impl fidl::encoding::TypeMarker for BrowseControllerGetFileSystemItemsResponse {
11766 type Owned = Self;
11767
11768 #[inline(always)]
11769 fn inline_align(_context: fidl::encoding::Context) -> usize {
11770 8
11771 }
11772
11773 #[inline(always)]
11774 fn inline_size(_context: fidl::encoding::Context) -> usize {
11775 16
11776 }
11777 }
11778
11779 unsafe impl<D: fidl::encoding::ResourceDialect>
11780 fidl::encoding::Encode<BrowseControllerGetFileSystemItemsResponse, D>
11781 for &BrowseControllerGetFileSystemItemsResponse
11782 {
11783 #[inline]
11784 unsafe fn encode(
11785 self,
11786 encoder: &mut fidl::encoding::Encoder<'_, D>,
11787 offset: usize,
11788 _depth: fidl::encoding::Depth,
11789 ) -> fidl::Result<()> {
11790 encoder.debug_check_bounds::<BrowseControllerGetFileSystemItemsResponse>(offset);
11791 fidl::encoding::Encode::<BrowseControllerGetFileSystemItemsResponse, D>::encode(
11793 (
11794 <fidl::encoding::Vector<FileSystemItem, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
11795 ),
11796 encoder, offset, _depth
11797 )
11798 }
11799 }
11800 unsafe impl<
11801 D: fidl::encoding::ResourceDialect,
11802 T0: fidl::encoding::Encode<fidl::encoding::Vector<FileSystemItem, 16>, D>,
11803 > fidl::encoding::Encode<BrowseControllerGetFileSystemItemsResponse, D> for (T0,)
11804 {
11805 #[inline]
11806 unsafe fn encode(
11807 self,
11808 encoder: &mut fidl::encoding::Encoder<'_, D>,
11809 offset: usize,
11810 depth: fidl::encoding::Depth,
11811 ) -> fidl::Result<()> {
11812 encoder.debug_check_bounds::<BrowseControllerGetFileSystemItemsResponse>(offset);
11813 self.0.encode(encoder, offset + 0, depth)?;
11817 Ok(())
11818 }
11819 }
11820
11821 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11822 for BrowseControllerGetFileSystemItemsResponse
11823 {
11824 #[inline(always)]
11825 fn new_empty() -> Self {
11826 Self { items: fidl::new_empty!(fidl::encoding::Vector<FileSystemItem, 16>, D) }
11827 }
11828
11829 #[inline]
11830 unsafe fn decode(
11831 &mut self,
11832 decoder: &mut fidl::encoding::Decoder<'_, D>,
11833 offset: usize,
11834 _depth: fidl::encoding::Depth,
11835 ) -> fidl::Result<()> {
11836 decoder.debug_check_bounds::<Self>(offset);
11837 fidl::decode!(fidl::encoding::Vector<FileSystemItem, 16>, D, &mut self.items, decoder, offset + 0, _depth)?;
11839 Ok(())
11840 }
11841 }
11842
11843 impl fidl::encoding::ValueTypeMarker for BrowseControllerGetMediaPlayerItemsResponse {
11844 type Borrowed<'a> = &'a Self;
11845 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11846 value
11847 }
11848 }
11849
11850 unsafe impl fidl::encoding::TypeMarker for BrowseControllerGetMediaPlayerItemsResponse {
11851 type Owned = Self;
11852
11853 #[inline(always)]
11854 fn inline_align(_context: fidl::encoding::Context) -> usize {
11855 8
11856 }
11857
11858 #[inline(always)]
11859 fn inline_size(_context: fidl::encoding::Context) -> usize {
11860 16
11861 }
11862 }
11863
11864 unsafe impl<D: fidl::encoding::ResourceDialect>
11865 fidl::encoding::Encode<BrowseControllerGetMediaPlayerItemsResponse, D>
11866 for &BrowseControllerGetMediaPlayerItemsResponse
11867 {
11868 #[inline]
11869 unsafe fn encode(
11870 self,
11871 encoder: &mut fidl::encoding::Encoder<'_, D>,
11872 offset: usize,
11873 _depth: fidl::encoding::Depth,
11874 ) -> fidl::Result<()> {
11875 encoder.debug_check_bounds::<BrowseControllerGetMediaPlayerItemsResponse>(offset);
11876 fidl::encoding::Encode::<BrowseControllerGetMediaPlayerItemsResponse, D>::encode(
11878 (
11879 <fidl::encoding::Vector<MediaPlayerItem, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
11880 ),
11881 encoder, offset, _depth
11882 )
11883 }
11884 }
11885 unsafe impl<
11886 D: fidl::encoding::ResourceDialect,
11887 T0: fidl::encoding::Encode<fidl::encoding::Vector<MediaPlayerItem, 16>, D>,
11888 > fidl::encoding::Encode<BrowseControllerGetMediaPlayerItemsResponse, D> for (T0,)
11889 {
11890 #[inline]
11891 unsafe fn encode(
11892 self,
11893 encoder: &mut fidl::encoding::Encoder<'_, D>,
11894 offset: usize,
11895 depth: fidl::encoding::Depth,
11896 ) -> fidl::Result<()> {
11897 encoder.debug_check_bounds::<BrowseControllerGetMediaPlayerItemsResponse>(offset);
11898 self.0.encode(encoder, offset + 0, depth)?;
11902 Ok(())
11903 }
11904 }
11905
11906 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11907 for BrowseControllerGetMediaPlayerItemsResponse
11908 {
11909 #[inline(always)]
11910 fn new_empty() -> Self {
11911 Self { items: fidl::new_empty!(fidl::encoding::Vector<MediaPlayerItem, 16>, D) }
11912 }
11913
11914 #[inline]
11915 unsafe fn decode(
11916 &mut self,
11917 decoder: &mut fidl::encoding::Decoder<'_, D>,
11918 offset: usize,
11919 _depth: fidl::encoding::Depth,
11920 ) -> fidl::Result<()> {
11921 decoder.debug_check_bounds::<Self>(offset);
11922 fidl::decode!(fidl::encoding::Vector<MediaPlayerItem, 16>, D, &mut self.items, decoder, offset + 0, _depth)?;
11924 Ok(())
11925 }
11926 }
11927
11928 impl fidl::encoding::ValueTypeMarker for BrowseControllerGetNowPlayingItemsResponse {
11929 type Borrowed<'a> = &'a Self;
11930 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11931 value
11932 }
11933 }
11934
11935 unsafe impl fidl::encoding::TypeMarker for BrowseControllerGetNowPlayingItemsResponse {
11936 type Owned = Self;
11937
11938 #[inline(always)]
11939 fn inline_align(_context: fidl::encoding::Context) -> usize {
11940 8
11941 }
11942
11943 #[inline(always)]
11944 fn inline_size(_context: fidl::encoding::Context) -> usize {
11945 16
11946 }
11947 }
11948
11949 unsafe impl<D: fidl::encoding::ResourceDialect>
11950 fidl::encoding::Encode<BrowseControllerGetNowPlayingItemsResponse, D>
11951 for &BrowseControllerGetNowPlayingItemsResponse
11952 {
11953 #[inline]
11954 unsafe fn encode(
11955 self,
11956 encoder: &mut fidl::encoding::Encoder<'_, D>,
11957 offset: usize,
11958 _depth: fidl::encoding::Depth,
11959 ) -> fidl::Result<()> {
11960 encoder.debug_check_bounds::<BrowseControllerGetNowPlayingItemsResponse>(offset);
11961 fidl::encoding::Encode::<BrowseControllerGetNowPlayingItemsResponse, D>::encode(
11963 (
11964 <fidl::encoding::Vector<MediaElementItem, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
11965 ),
11966 encoder, offset, _depth
11967 )
11968 }
11969 }
11970 unsafe impl<
11971 D: fidl::encoding::ResourceDialect,
11972 T0: fidl::encoding::Encode<fidl::encoding::Vector<MediaElementItem, 16>, D>,
11973 > fidl::encoding::Encode<BrowseControllerGetNowPlayingItemsResponse, D> for (T0,)
11974 {
11975 #[inline]
11976 unsafe fn encode(
11977 self,
11978 encoder: &mut fidl::encoding::Encoder<'_, D>,
11979 offset: usize,
11980 depth: fidl::encoding::Depth,
11981 ) -> fidl::Result<()> {
11982 encoder.debug_check_bounds::<BrowseControllerGetNowPlayingItemsResponse>(offset);
11983 self.0.encode(encoder, offset + 0, depth)?;
11987 Ok(())
11988 }
11989 }
11990
11991 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11992 for BrowseControllerGetNowPlayingItemsResponse
11993 {
11994 #[inline(always)]
11995 fn new_empty() -> Self {
11996 Self { items: fidl::new_empty!(fidl::encoding::Vector<MediaElementItem, 16>, D) }
11997 }
11998
11999 #[inline]
12000 unsafe fn decode(
12001 &mut self,
12002 decoder: &mut fidl::encoding::Decoder<'_, D>,
12003 offset: usize,
12004 _depth: fidl::encoding::Depth,
12005 ) -> fidl::Result<()> {
12006 decoder.debug_check_bounds::<Self>(offset);
12007 fidl::decode!(fidl::encoding::Vector<MediaElementItem, 16>, D, &mut self.items, decoder, offset + 0, _depth)?;
12009 Ok(())
12010 }
12011 }
12012
12013 impl fidl::encoding::ValueTypeMarker for ControllerGetPlayerApplicationSettingsRequest {
12014 type Borrowed<'a> = &'a Self;
12015 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12016 value
12017 }
12018 }
12019
12020 unsafe impl fidl::encoding::TypeMarker for ControllerGetPlayerApplicationSettingsRequest {
12021 type Owned = Self;
12022
12023 #[inline(always)]
12024 fn inline_align(_context: fidl::encoding::Context) -> usize {
12025 8
12026 }
12027
12028 #[inline(always)]
12029 fn inline_size(_context: fidl::encoding::Context) -> usize {
12030 16
12031 }
12032 }
12033
12034 unsafe impl<D: fidl::encoding::ResourceDialect>
12035 fidl::encoding::Encode<ControllerGetPlayerApplicationSettingsRequest, D>
12036 for &ControllerGetPlayerApplicationSettingsRequest
12037 {
12038 #[inline]
12039 unsafe fn encode(
12040 self,
12041 encoder: &mut fidl::encoding::Encoder<'_, D>,
12042 offset: usize,
12043 _depth: fidl::encoding::Depth,
12044 ) -> fidl::Result<()> {
12045 encoder.debug_check_bounds::<ControllerGetPlayerApplicationSettingsRequest>(offset);
12046 fidl::encoding::Encode::<ControllerGetPlayerApplicationSettingsRequest, D>::encode(
12048 (
12049 <fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131> as fidl::encoding::ValueTypeMarker>::borrow(&self.attribute_ids),
12050 ),
12051 encoder, offset, _depth
12052 )
12053 }
12054 }
12055 unsafe impl<
12056 D: fidl::encoding::ResourceDialect,
12057 T0: fidl::encoding::Encode<
12058 fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>,
12059 D,
12060 >,
12061 > fidl::encoding::Encode<ControllerGetPlayerApplicationSettingsRequest, D> for (T0,)
12062 {
12063 #[inline]
12064 unsafe fn encode(
12065 self,
12066 encoder: &mut fidl::encoding::Encoder<'_, D>,
12067 offset: usize,
12068 depth: fidl::encoding::Depth,
12069 ) -> fidl::Result<()> {
12070 encoder.debug_check_bounds::<ControllerGetPlayerApplicationSettingsRequest>(offset);
12071 self.0.encode(encoder, offset + 0, depth)?;
12075 Ok(())
12076 }
12077 }
12078
12079 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12080 for ControllerGetPlayerApplicationSettingsRequest
12081 {
12082 #[inline(always)]
12083 fn new_empty() -> Self {
12084 Self {
12085 attribute_ids: fidl::new_empty!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D),
12086 }
12087 }
12088
12089 #[inline]
12090 unsafe fn decode(
12091 &mut self,
12092 decoder: &mut fidl::encoding::Decoder<'_, D>,
12093 offset: usize,
12094 _depth: fidl::encoding::Depth,
12095 ) -> fidl::Result<()> {
12096 decoder.debug_check_bounds::<Self>(offset);
12097 fidl::decode!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D, &mut self.attribute_ids, decoder, offset + 0, _depth)?;
12099 Ok(())
12100 }
12101 }
12102
12103 impl fidl::encoding::ValueTypeMarker for ControllerInformBatteryStatusRequest {
12104 type Borrowed<'a> = &'a Self;
12105 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12106 value
12107 }
12108 }
12109
12110 unsafe impl fidl::encoding::TypeMarker for ControllerInformBatteryStatusRequest {
12111 type Owned = Self;
12112
12113 #[inline(always)]
12114 fn inline_align(_context: fidl::encoding::Context) -> usize {
12115 1
12116 }
12117
12118 #[inline(always)]
12119 fn inline_size(_context: fidl::encoding::Context) -> usize {
12120 1
12121 }
12122 }
12123
12124 unsafe impl<D: fidl::encoding::ResourceDialect>
12125 fidl::encoding::Encode<ControllerInformBatteryStatusRequest, D>
12126 for &ControllerInformBatteryStatusRequest
12127 {
12128 #[inline]
12129 unsafe fn encode(
12130 self,
12131 encoder: &mut fidl::encoding::Encoder<'_, D>,
12132 offset: usize,
12133 _depth: fidl::encoding::Depth,
12134 ) -> fidl::Result<()> {
12135 encoder.debug_check_bounds::<ControllerInformBatteryStatusRequest>(offset);
12136 fidl::encoding::Encode::<ControllerInformBatteryStatusRequest, D>::encode(
12138 (<BatteryStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.battery_status),),
12139 encoder,
12140 offset,
12141 _depth,
12142 )
12143 }
12144 }
12145 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<BatteryStatus, D>>
12146 fidl::encoding::Encode<ControllerInformBatteryStatusRequest, D> for (T0,)
12147 {
12148 #[inline]
12149 unsafe fn encode(
12150 self,
12151 encoder: &mut fidl::encoding::Encoder<'_, D>,
12152 offset: usize,
12153 depth: fidl::encoding::Depth,
12154 ) -> fidl::Result<()> {
12155 encoder.debug_check_bounds::<ControllerInformBatteryStatusRequest>(offset);
12156 self.0.encode(encoder, offset + 0, depth)?;
12160 Ok(())
12161 }
12162 }
12163
12164 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12165 for ControllerInformBatteryStatusRequest
12166 {
12167 #[inline(always)]
12168 fn new_empty() -> Self {
12169 Self { battery_status: fidl::new_empty!(BatteryStatus, D) }
12170 }
12171
12172 #[inline]
12173 unsafe fn decode(
12174 &mut self,
12175 decoder: &mut fidl::encoding::Decoder<'_, D>,
12176 offset: usize,
12177 _depth: fidl::encoding::Depth,
12178 ) -> fidl::Result<()> {
12179 decoder.debug_check_bounds::<Self>(offset);
12180 fidl::decode!(BatteryStatus, D, &mut self.battery_status, decoder, offset + 0, _depth)?;
12182 Ok(())
12183 }
12184 }
12185
12186 impl fidl::encoding::ValueTypeMarker for ControllerOnNotificationRequest {
12187 type Borrowed<'a> = &'a Self;
12188 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12189 value
12190 }
12191 }
12192
12193 unsafe impl fidl::encoding::TypeMarker for ControllerOnNotificationRequest {
12194 type Owned = Self;
12195
12196 #[inline(always)]
12197 fn inline_align(_context: fidl::encoding::Context) -> usize {
12198 8
12199 }
12200
12201 #[inline(always)]
12202 fn inline_size(_context: fidl::encoding::Context) -> usize {
12203 24
12204 }
12205 }
12206
12207 unsafe impl<D: fidl::encoding::ResourceDialect>
12208 fidl::encoding::Encode<ControllerOnNotificationRequest, D>
12209 for &ControllerOnNotificationRequest
12210 {
12211 #[inline]
12212 unsafe fn encode(
12213 self,
12214 encoder: &mut fidl::encoding::Encoder<'_, D>,
12215 offset: usize,
12216 _depth: fidl::encoding::Depth,
12217 ) -> fidl::Result<()> {
12218 encoder.debug_check_bounds::<ControllerOnNotificationRequest>(offset);
12219 fidl::encoding::Encode::<ControllerOnNotificationRequest, D>::encode(
12221 (
12222 <i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp),
12223 <Notification as fidl::encoding::ValueTypeMarker>::borrow(&self.notification),
12224 ),
12225 encoder,
12226 offset,
12227 _depth,
12228 )
12229 }
12230 }
12231 unsafe impl<
12232 D: fidl::encoding::ResourceDialect,
12233 T0: fidl::encoding::Encode<i64, D>,
12234 T1: fidl::encoding::Encode<Notification, D>,
12235 > fidl::encoding::Encode<ControllerOnNotificationRequest, D> for (T0, T1)
12236 {
12237 #[inline]
12238 unsafe fn encode(
12239 self,
12240 encoder: &mut fidl::encoding::Encoder<'_, D>,
12241 offset: usize,
12242 depth: fidl::encoding::Depth,
12243 ) -> fidl::Result<()> {
12244 encoder.debug_check_bounds::<ControllerOnNotificationRequest>(offset);
12245 self.0.encode(encoder, offset + 0, depth)?;
12249 self.1.encode(encoder, offset + 8, depth)?;
12250 Ok(())
12251 }
12252 }
12253
12254 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12255 for ControllerOnNotificationRequest
12256 {
12257 #[inline(always)]
12258 fn new_empty() -> Self {
12259 Self {
12260 timestamp: fidl::new_empty!(i64, D),
12261 notification: fidl::new_empty!(Notification, D),
12262 }
12263 }
12264
12265 #[inline]
12266 unsafe fn decode(
12267 &mut self,
12268 decoder: &mut fidl::encoding::Decoder<'_, D>,
12269 offset: usize,
12270 _depth: fidl::encoding::Depth,
12271 ) -> fidl::Result<()> {
12272 decoder.debug_check_bounds::<Self>(offset);
12273 fidl::decode!(i64, D, &mut self.timestamp, decoder, offset + 0, _depth)?;
12275 fidl::decode!(Notification, D, &mut self.notification, decoder, offset + 8, _depth)?;
12276 Ok(())
12277 }
12278 }
12279
12280 impl fidl::encoding::ValueTypeMarker for ControllerSendCommandRequest {
12281 type Borrowed<'a> = &'a Self;
12282 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12283 value
12284 }
12285 }
12286
12287 unsafe impl fidl::encoding::TypeMarker for ControllerSendCommandRequest {
12288 type Owned = Self;
12289
12290 #[inline(always)]
12291 fn inline_align(_context: fidl::encoding::Context) -> usize {
12292 1
12293 }
12294
12295 #[inline(always)]
12296 fn inline_size(_context: fidl::encoding::Context) -> usize {
12297 1
12298 }
12299 }
12300
12301 unsafe impl<D: fidl::encoding::ResourceDialect>
12302 fidl::encoding::Encode<ControllerSendCommandRequest, D> for &ControllerSendCommandRequest
12303 {
12304 #[inline]
12305 unsafe fn encode(
12306 self,
12307 encoder: &mut fidl::encoding::Encoder<'_, D>,
12308 offset: usize,
12309 _depth: fidl::encoding::Depth,
12310 ) -> fidl::Result<()> {
12311 encoder.debug_check_bounds::<ControllerSendCommandRequest>(offset);
12312 fidl::encoding::Encode::<ControllerSendCommandRequest, D>::encode(
12314 (<AvcPanelCommand as fidl::encoding::ValueTypeMarker>::borrow(&self.command),),
12315 encoder,
12316 offset,
12317 _depth,
12318 )
12319 }
12320 }
12321 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AvcPanelCommand, D>>
12322 fidl::encoding::Encode<ControllerSendCommandRequest, D> for (T0,)
12323 {
12324 #[inline]
12325 unsafe fn encode(
12326 self,
12327 encoder: &mut fidl::encoding::Encoder<'_, D>,
12328 offset: usize,
12329 depth: fidl::encoding::Depth,
12330 ) -> fidl::Result<()> {
12331 encoder.debug_check_bounds::<ControllerSendCommandRequest>(offset);
12332 self.0.encode(encoder, offset + 0, depth)?;
12336 Ok(())
12337 }
12338 }
12339
12340 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12341 for ControllerSendCommandRequest
12342 {
12343 #[inline(always)]
12344 fn new_empty() -> Self {
12345 Self { command: fidl::new_empty!(AvcPanelCommand, D) }
12346 }
12347
12348 #[inline]
12349 unsafe fn decode(
12350 &mut self,
12351 decoder: &mut fidl::encoding::Decoder<'_, D>,
12352 offset: usize,
12353 _depth: fidl::encoding::Depth,
12354 ) -> fidl::Result<()> {
12355 decoder.debug_check_bounds::<Self>(offset);
12356 fidl::decode!(AvcPanelCommand, D, &mut self.command, decoder, offset + 0, _depth)?;
12358 Ok(())
12359 }
12360 }
12361
12362 impl fidl::encoding::ValueTypeMarker for ControllerSetAbsoluteVolumeRequest {
12363 type Borrowed<'a> = &'a Self;
12364 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12365 value
12366 }
12367 }
12368
12369 unsafe impl fidl::encoding::TypeMarker for ControllerSetAbsoluteVolumeRequest {
12370 type Owned = Self;
12371
12372 #[inline(always)]
12373 fn inline_align(_context: fidl::encoding::Context) -> usize {
12374 1
12375 }
12376
12377 #[inline(always)]
12378 fn inline_size(_context: fidl::encoding::Context) -> usize {
12379 1
12380 }
12381 #[inline(always)]
12382 fn encode_is_copy() -> bool {
12383 true
12384 }
12385
12386 #[inline(always)]
12387 fn decode_is_copy() -> bool {
12388 true
12389 }
12390 }
12391
12392 unsafe impl<D: fidl::encoding::ResourceDialect>
12393 fidl::encoding::Encode<ControllerSetAbsoluteVolumeRequest, D>
12394 for &ControllerSetAbsoluteVolumeRequest
12395 {
12396 #[inline]
12397 unsafe fn encode(
12398 self,
12399 encoder: &mut fidl::encoding::Encoder<'_, D>,
12400 offset: usize,
12401 _depth: fidl::encoding::Depth,
12402 ) -> fidl::Result<()> {
12403 encoder.debug_check_bounds::<ControllerSetAbsoluteVolumeRequest>(offset);
12404 unsafe {
12405 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12407 (buf_ptr as *mut ControllerSetAbsoluteVolumeRequest)
12408 .write_unaligned((self as *const ControllerSetAbsoluteVolumeRequest).read());
12409 }
12412 Ok(())
12413 }
12414 }
12415 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
12416 fidl::encoding::Encode<ControllerSetAbsoluteVolumeRequest, D> for (T0,)
12417 {
12418 #[inline]
12419 unsafe fn encode(
12420 self,
12421 encoder: &mut fidl::encoding::Encoder<'_, D>,
12422 offset: usize,
12423 depth: fidl::encoding::Depth,
12424 ) -> fidl::Result<()> {
12425 encoder.debug_check_bounds::<ControllerSetAbsoluteVolumeRequest>(offset);
12426 self.0.encode(encoder, offset + 0, depth)?;
12430 Ok(())
12431 }
12432 }
12433
12434 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12435 for ControllerSetAbsoluteVolumeRequest
12436 {
12437 #[inline(always)]
12438 fn new_empty() -> Self {
12439 Self { requested_volume: fidl::new_empty!(u8, D) }
12440 }
12441
12442 #[inline]
12443 unsafe fn decode(
12444 &mut self,
12445 decoder: &mut fidl::encoding::Decoder<'_, D>,
12446 offset: usize,
12447 _depth: fidl::encoding::Depth,
12448 ) -> fidl::Result<()> {
12449 decoder.debug_check_bounds::<Self>(offset);
12450 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12451 unsafe {
12454 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
12455 }
12456 Ok(())
12457 }
12458 }
12459
12460 impl fidl::encoding::ValueTypeMarker for ControllerSetAddressedPlayerRequest {
12461 type Borrowed<'a> = &'a Self;
12462 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12463 value
12464 }
12465 }
12466
12467 unsafe impl fidl::encoding::TypeMarker for ControllerSetAddressedPlayerRequest {
12468 type Owned = Self;
12469
12470 #[inline(always)]
12471 fn inline_align(_context: fidl::encoding::Context) -> usize {
12472 2
12473 }
12474
12475 #[inline(always)]
12476 fn inline_size(_context: fidl::encoding::Context) -> usize {
12477 2
12478 }
12479 #[inline(always)]
12480 fn encode_is_copy() -> bool {
12481 true
12482 }
12483
12484 #[inline(always)]
12485 fn decode_is_copy() -> bool {
12486 true
12487 }
12488 }
12489
12490 unsafe impl<D: fidl::encoding::ResourceDialect>
12491 fidl::encoding::Encode<ControllerSetAddressedPlayerRequest, D>
12492 for &ControllerSetAddressedPlayerRequest
12493 {
12494 #[inline]
12495 unsafe fn encode(
12496 self,
12497 encoder: &mut fidl::encoding::Encoder<'_, D>,
12498 offset: usize,
12499 _depth: fidl::encoding::Depth,
12500 ) -> fidl::Result<()> {
12501 encoder.debug_check_bounds::<ControllerSetAddressedPlayerRequest>(offset);
12502 unsafe {
12503 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
12505 (buf_ptr as *mut ControllerSetAddressedPlayerRequest)
12506 .write_unaligned((self as *const ControllerSetAddressedPlayerRequest).read());
12507 }
12510 Ok(())
12511 }
12512 }
12513 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
12514 fidl::encoding::Encode<ControllerSetAddressedPlayerRequest, D> for (T0,)
12515 {
12516 #[inline]
12517 unsafe fn encode(
12518 self,
12519 encoder: &mut fidl::encoding::Encoder<'_, D>,
12520 offset: usize,
12521 depth: fidl::encoding::Depth,
12522 ) -> fidl::Result<()> {
12523 encoder.debug_check_bounds::<ControllerSetAddressedPlayerRequest>(offset);
12524 self.0.encode(encoder, offset + 0, depth)?;
12528 Ok(())
12529 }
12530 }
12531
12532 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12533 for ControllerSetAddressedPlayerRequest
12534 {
12535 #[inline(always)]
12536 fn new_empty() -> Self {
12537 Self { player_id: fidl::new_empty!(u16, D) }
12538 }
12539
12540 #[inline]
12541 unsafe fn decode(
12542 &mut self,
12543 decoder: &mut fidl::encoding::Decoder<'_, D>,
12544 offset: usize,
12545 _depth: fidl::encoding::Depth,
12546 ) -> fidl::Result<()> {
12547 decoder.debug_check_bounds::<Self>(offset);
12548 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
12549 unsafe {
12552 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
12553 }
12554 Ok(())
12555 }
12556 }
12557
12558 impl fidl::encoding::ValueTypeMarker for ControllerSetNotificationFilterRequest {
12559 type Borrowed<'a> = &'a Self;
12560 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12561 value
12562 }
12563 }
12564
12565 unsafe impl fidl::encoding::TypeMarker for ControllerSetNotificationFilterRequest {
12566 type Owned = Self;
12567
12568 #[inline(always)]
12569 fn inline_align(_context: fidl::encoding::Context) -> usize {
12570 4
12571 }
12572
12573 #[inline(always)]
12574 fn inline_size(_context: fidl::encoding::Context) -> usize {
12575 8
12576 }
12577 }
12578
12579 unsafe impl<D: fidl::encoding::ResourceDialect>
12580 fidl::encoding::Encode<ControllerSetNotificationFilterRequest, D>
12581 for &ControllerSetNotificationFilterRequest
12582 {
12583 #[inline]
12584 unsafe fn encode(
12585 self,
12586 encoder: &mut fidl::encoding::Encoder<'_, D>,
12587 offset: usize,
12588 _depth: fidl::encoding::Depth,
12589 ) -> fidl::Result<()> {
12590 encoder.debug_check_bounds::<ControllerSetNotificationFilterRequest>(offset);
12591 fidl::encoding::Encode::<ControllerSetNotificationFilterRequest, D>::encode(
12593 (
12594 <Notifications as fidl::encoding::ValueTypeMarker>::borrow(&self.notifications),
12595 <u32 as fidl::encoding::ValueTypeMarker>::borrow(
12596 &self.position_change_interval,
12597 ),
12598 ),
12599 encoder,
12600 offset,
12601 _depth,
12602 )
12603 }
12604 }
12605 unsafe impl<
12606 D: fidl::encoding::ResourceDialect,
12607 T0: fidl::encoding::Encode<Notifications, D>,
12608 T1: fidl::encoding::Encode<u32, D>,
12609 > fidl::encoding::Encode<ControllerSetNotificationFilterRequest, D> for (T0, T1)
12610 {
12611 #[inline]
12612 unsafe fn encode(
12613 self,
12614 encoder: &mut fidl::encoding::Encoder<'_, D>,
12615 offset: usize,
12616 depth: fidl::encoding::Depth,
12617 ) -> fidl::Result<()> {
12618 encoder.debug_check_bounds::<ControllerSetNotificationFilterRequest>(offset);
12619 self.0.encode(encoder, offset + 0, depth)?;
12623 self.1.encode(encoder, offset + 4, depth)?;
12624 Ok(())
12625 }
12626 }
12627
12628 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12629 for ControllerSetNotificationFilterRequest
12630 {
12631 #[inline(always)]
12632 fn new_empty() -> Self {
12633 Self {
12634 notifications: fidl::new_empty!(Notifications, D),
12635 position_change_interval: fidl::new_empty!(u32, D),
12636 }
12637 }
12638
12639 #[inline]
12640 unsafe fn decode(
12641 &mut self,
12642 decoder: &mut fidl::encoding::Decoder<'_, D>,
12643 offset: usize,
12644 _depth: fidl::encoding::Depth,
12645 ) -> fidl::Result<()> {
12646 decoder.debug_check_bounds::<Self>(offset);
12647 fidl::decode!(Notifications, D, &mut self.notifications, decoder, offset + 0, _depth)?;
12649 fidl::decode!(u32, D, &mut self.position_change_interval, decoder, offset + 4, _depth)?;
12650 Ok(())
12651 }
12652 }
12653
12654 impl fidl::encoding::ValueTypeMarker for ControllerSetPlayerApplicationSettingsRequest {
12655 type Borrowed<'a> = &'a Self;
12656 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12657 value
12658 }
12659 }
12660
12661 unsafe impl fidl::encoding::TypeMarker for ControllerSetPlayerApplicationSettingsRequest {
12662 type Owned = Self;
12663
12664 #[inline(always)]
12665 fn inline_align(_context: fidl::encoding::Context) -> usize {
12666 8
12667 }
12668
12669 #[inline(always)]
12670 fn inline_size(_context: fidl::encoding::Context) -> usize {
12671 16
12672 }
12673 }
12674
12675 unsafe impl<D: fidl::encoding::ResourceDialect>
12676 fidl::encoding::Encode<ControllerSetPlayerApplicationSettingsRequest, D>
12677 for &ControllerSetPlayerApplicationSettingsRequest
12678 {
12679 #[inline]
12680 unsafe fn encode(
12681 self,
12682 encoder: &mut fidl::encoding::Encoder<'_, D>,
12683 offset: usize,
12684 _depth: fidl::encoding::Depth,
12685 ) -> fidl::Result<()> {
12686 encoder.debug_check_bounds::<ControllerSetPlayerApplicationSettingsRequest>(offset);
12687 fidl::encoding::Encode::<ControllerSetPlayerApplicationSettingsRequest, D>::encode(
12689 (<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
12690 &self.requested_settings,
12691 ),),
12692 encoder,
12693 offset,
12694 _depth,
12695 )
12696 }
12697 }
12698 unsafe impl<
12699 D: fidl::encoding::ResourceDialect,
12700 T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
12701 > fidl::encoding::Encode<ControllerSetPlayerApplicationSettingsRequest, D> for (T0,)
12702 {
12703 #[inline]
12704 unsafe fn encode(
12705 self,
12706 encoder: &mut fidl::encoding::Encoder<'_, D>,
12707 offset: usize,
12708 depth: fidl::encoding::Depth,
12709 ) -> fidl::Result<()> {
12710 encoder.debug_check_bounds::<ControllerSetPlayerApplicationSettingsRequest>(offset);
12711 self.0.encode(encoder, offset + 0, depth)?;
12715 Ok(())
12716 }
12717 }
12718
12719 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12720 for ControllerSetPlayerApplicationSettingsRequest
12721 {
12722 #[inline(always)]
12723 fn new_empty() -> Self {
12724 Self { requested_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
12725 }
12726
12727 #[inline]
12728 unsafe fn decode(
12729 &mut self,
12730 decoder: &mut fidl::encoding::Decoder<'_, D>,
12731 offset: usize,
12732 _depth: fidl::encoding::Depth,
12733 ) -> fidl::Result<()> {
12734 decoder.debug_check_bounds::<Self>(offset);
12735 fidl::decode!(
12737 PlayerApplicationSettings,
12738 D,
12739 &mut self.requested_settings,
12740 decoder,
12741 offset + 0,
12742 _depth
12743 )?;
12744 Ok(())
12745 }
12746 }
12747
12748 impl fidl::encoding::ValueTypeMarker for ControllerGetMediaAttributesResponse {
12749 type Borrowed<'a> = &'a Self;
12750 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12751 value
12752 }
12753 }
12754
12755 unsafe impl fidl::encoding::TypeMarker for ControllerGetMediaAttributesResponse {
12756 type Owned = Self;
12757
12758 #[inline(always)]
12759 fn inline_align(_context: fidl::encoding::Context) -> usize {
12760 8
12761 }
12762
12763 #[inline(always)]
12764 fn inline_size(_context: fidl::encoding::Context) -> usize {
12765 16
12766 }
12767 }
12768
12769 unsafe impl<D: fidl::encoding::ResourceDialect>
12770 fidl::encoding::Encode<ControllerGetMediaAttributesResponse, D>
12771 for &ControllerGetMediaAttributesResponse
12772 {
12773 #[inline]
12774 unsafe fn encode(
12775 self,
12776 encoder: &mut fidl::encoding::Encoder<'_, D>,
12777 offset: usize,
12778 _depth: fidl::encoding::Depth,
12779 ) -> fidl::Result<()> {
12780 encoder.debug_check_bounds::<ControllerGetMediaAttributesResponse>(offset);
12781 fidl::encoding::Encode::<ControllerGetMediaAttributesResponse, D>::encode(
12783 (<MediaAttributes as fidl::encoding::ValueTypeMarker>::borrow(&self.attributes),),
12784 encoder,
12785 offset,
12786 _depth,
12787 )
12788 }
12789 }
12790 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<MediaAttributes, D>>
12791 fidl::encoding::Encode<ControllerGetMediaAttributesResponse, D> for (T0,)
12792 {
12793 #[inline]
12794 unsafe fn encode(
12795 self,
12796 encoder: &mut fidl::encoding::Encoder<'_, D>,
12797 offset: usize,
12798 depth: fidl::encoding::Depth,
12799 ) -> fidl::Result<()> {
12800 encoder.debug_check_bounds::<ControllerGetMediaAttributesResponse>(offset);
12801 self.0.encode(encoder, offset + 0, depth)?;
12805 Ok(())
12806 }
12807 }
12808
12809 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12810 for ControllerGetMediaAttributesResponse
12811 {
12812 #[inline(always)]
12813 fn new_empty() -> Self {
12814 Self { attributes: fidl::new_empty!(MediaAttributes, D) }
12815 }
12816
12817 #[inline]
12818 unsafe fn decode(
12819 &mut self,
12820 decoder: &mut fidl::encoding::Decoder<'_, D>,
12821 offset: usize,
12822 _depth: fidl::encoding::Depth,
12823 ) -> fidl::Result<()> {
12824 decoder.debug_check_bounds::<Self>(offset);
12825 fidl::decode!(MediaAttributes, D, &mut self.attributes, decoder, offset + 0, _depth)?;
12827 Ok(())
12828 }
12829 }
12830
12831 impl fidl::encoding::ValueTypeMarker for ControllerGetPlayStatusResponse {
12832 type Borrowed<'a> = &'a Self;
12833 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12834 value
12835 }
12836 }
12837
12838 unsafe impl fidl::encoding::TypeMarker for ControllerGetPlayStatusResponse {
12839 type Owned = Self;
12840
12841 #[inline(always)]
12842 fn inline_align(_context: fidl::encoding::Context) -> usize {
12843 8
12844 }
12845
12846 #[inline(always)]
12847 fn inline_size(_context: fidl::encoding::Context) -> usize {
12848 16
12849 }
12850 }
12851
12852 unsafe impl<D: fidl::encoding::ResourceDialect>
12853 fidl::encoding::Encode<ControllerGetPlayStatusResponse, D>
12854 for &ControllerGetPlayStatusResponse
12855 {
12856 #[inline]
12857 unsafe fn encode(
12858 self,
12859 encoder: &mut fidl::encoding::Encoder<'_, D>,
12860 offset: usize,
12861 _depth: fidl::encoding::Depth,
12862 ) -> fidl::Result<()> {
12863 encoder.debug_check_bounds::<ControllerGetPlayStatusResponse>(offset);
12864 fidl::encoding::Encode::<ControllerGetPlayStatusResponse, D>::encode(
12866 (<PlayStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.play_status),),
12867 encoder,
12868 offset,
12869 _depth,
12870 )
12871 }
12872 }
12873 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PlayStatus, D>>
12874 fidl::encoding::Encode<ControllerGetPlayStatusResponse, D> for (T0,)
12875 {
12876 #[inline]
12877 unsafe fn encode(
12878 self,
12879 encoder: &mut fidl::encoding::Encoder<'_, D>,
12880 offset: usize,
12881 depth: fidl::encoding::Depth,
12882 ) -> fidl::Result<()> {
12883 encoder.debug_check_bounds::<ControllerGetPlayStatusResponse>(offset);
12884 self.0.encode(encoder, offset + 0, depth)?;
12888 Ok(())
12889 }
12890 }
12891
12892 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12893 for ControllerGetPlayStatusResponse
12894 {
12895 #[inline(always)]
12896 fn new_empty() -> Self {
12897 Self { play_status: fidl::new_empty!(PlayStatus, D) }
12898 }
12899
12900 #[inline]
12901 unsafe fn decode(
12902 &mut self,
12903 decoder: &mut fidl::encoding::Decoder<'_, D>,
12904 offset: usize,
12905 _depth: fidl::encoding::Depth,
12906 ) -> fidl::Result<()> {
12907 decoder.debug_check_bounds::<Self>(offset);
12908 fidl::decode!(PlayStatus, D, &mut self.play_status, decoder, offset + 0, _depth)?;
12910 Ok(())
12911 }
12912 }
12913
12914 impl fidl::encoding::ValueTypeMarker for ControllerGetPlayerApplicationSettingsResponse {
12915 type Borrowed<'a> = &'a Self;
12916 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12917 value
12918 }
12919 }
12920
12921 unsafe impl fidl::encoding::TypeMarker for ControllerGetPlayerApplicationSettingsResponse {
12922 type Owned = Self;
12923
12924 #[inline(always)]
12925 fn inline_align(_context: fidl::encoding::Context) -> usize {
12926 8
12927 }
12928
12929 #[inline(always)]
12930 fn inline_size(_context: fidl::encoding::Context) -> usize {
12931 16
12932 }
12933 }
12934
12935 unsafe impl<D: fidl::encoding::ResourceDialect>
12936 fidl::encoding::Encode<ControllerGetPlayerApplicationSettingsResponse, D>
12937 for &ControllerGetPlayerApplicationSettingsResponse
12938 {
12939 #[inline]
12940 unsafe fn encode(
12941 self,
12942 encoder: &mut fidl::encoding::Encoder<'_, D>,
12943 offset: usize,
12944 _depth: fidl::encoding::Depth,
12945 ) -> fidl::Result<()> {
12946 encoder.debug_check_bounds::<ControllerGetPlayerApplicationSettingsResponse>(offset);
12947 fidl::encoding::Encode::<ControllerGetPlayerApplicationSettingsResponse, D>::encode(
12949 (<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
12950 &self.current_settings,
12951 ),),
12952 encoder,
12953 offset,
12954 _depth,
12955 )
12956 }
12957 }
12958 unsafe impl<
12959 D: fidl::encoding::ResourceDialect,
12960 T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
12961 > fidl::encoding::Encode<ControllerGetPlayerApplicationSettingsResponse, D> for (T0,)
12962 {
12963 #[inline]
12964 unsafe fn encode(
12965 self,
12966 encoder: &mut fidl::encoding::Encoder<'_, D>,
12967 offset: usize,
12968 depth: fidl::encoding::Depth,
12969 ) -> fidl::Result<()> {
12970 encoder.debug_check_bounds::<ControllerGetPlayerApplicationSettingsResponse>(offset);
12971 self.0.encode(encoder, offset + 0, depth)?;
12975 Ok(())
12976 }
12977 }
12978
12979 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12980 for ControllerGetPlayerApplicationSettingsResponse
12981 {
12982 #[inline(always)]
12983 fn new_empty() -> Self {
12984 Self { current_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
12985 }
12986
12987 #[inline]
12988 unsafe fn decode(
12989 &mut self,
12990 decoder: &mut fidl::encoding::Decoder<'_, D>,
12991 offset: usize,
12992 _depth: fidl::encoding::Depth,
12993 ) -> fidl::Result<()> {
12994 decoder.debug_check_bounds::<Self>(offset);
12995 fidl::decode!(
12997 PlayerApplicationSettings,
12998 D,
12999 &mut self.current_settings,
13000 decoder,
13001 offset + 0,
13002 _depth
13003 )?;
13004 Ok(())
13005 }
13006 }
13007
13008 impl fidl::encoding::ValueTypeMarker for ControllerSetAbsoluteVolumeResponse {
13009 type Borrowed<'a> = &'a Self;
13010 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13011 value
13012 }
13013 }
13014
13015 unsafe impl fidl::encoding::TypeMarker for ControllerSetAbsoluteVolumeResponse {
13016 type Owned = Self;
13017
13018 #[inline(always)]
13019 fn inline_align(_context: fidl::encoding::Context) -> usize {
13020 1
13021 }
13022
13023 #[inline(always)]
13024 fn inline_size(_context: fidl::encoding::Context) -> usize {
13025 1
13026 }
13027 #[inline(always)]
13028 fn encode_is_copy() -> bool {
13029 true
13030 }
13031
13032 #[inline(always)]
13033 fn decode_is_copy() -> bool {
13034 true
13035 }
13036 }
13037
13038 unsafe impl<D: fidl::encoding::ResourceDialect>
13039 fidl::encoding::Encode<ControllerSetAbsoluteVolumeResponse, D>
13040 for &ControllerSetAbsoluteVolumeResponse
13041 {
13042 #[inline]
13043 unsafe fn encode(
13044 self,
13045 encoder: &mut fidl::encoding::Encoder<'_, D>,
13046 offset: usize,
13047 _depth: fidl::encoding::Depth,
13048 ) -> fidl::Result<()> {
13049 encoder.debug_check_bounds::<ControllerSetAbsoluteVolumeResponse>(offset);
13050 unsafe {
13051 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
13053 (buf_ptr as *mut ControllerSetAbsoluteVolumeResponse)
13054 .write_unaligned((self as *const ControllerSetAbsoluteVolumeResponse).read());
13055 }
13058 Ok(())
13059 }
13060 }
13061 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
13062 fidl::encoding::Encode<ControllerSetAbsoluteVolumeResponse, D> for (T0,)
13063 {
13064 #[inline]
13065 unsafe fn encode(
13066 self,
13067 encoder: &mut fidl::encoding::Encoder<'_, D>,
13068 offset: usize,
13069 depth: fidl::encoding::Depth,
13070 ) -> fidl::Result<()> {
13071 encoder.debug_check_bounds::<ControllerSetAbsoluteVolumeResponse>(offset);
13072 self.0.encode(encoder, offset + 0, depth)?;
13076 Ok(())
13077 }
13078 }
13079
13080 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13081 for ControllerSetAbsoluteVolumeResponse
13082 {
13083 #[inline(always)]
13084 fn new_empty() -> Self {
13085 Self { set_volume: fidl::new_empty!(u8, D) }
13086 }
13087
13088 #[inline]
13089 unsafe fn decode(
13090 &mut self,
13091 decoder: &mut fidl::encoding::Decoder<'_, D>,
13092 offset: usize,
13093 _depth: fidl::encoding::Depth,
13094 ) -> fidl::Result<()> {
13095 decoder.debug_check_bounds::<Self>(offset);
13096 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
13097 unsafe {
13100 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
13101 }
13102 Ok(())
13103 }
13104 }
13105
13106 impl fidl::encoding::ValueTypeMarker for ControllerSetPlayerApplicationSettingsResponse {
13107 type Borrowed<'a> = &'a Self;
13108 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13109 value
13110 }
13111 }
13112
13113 unsafe impl fidl::encoding::TypeMarker for ControllerSetPlayerApplicationSettingsResponse {
13114 type Owned = Self;
13115
13116 #[inline(always)]
13117 fn inline_align(_context: fidl::encoding::Context) -> usize {
13118 8
13119 }
13120
13121 #[inline(always)]
13122 fn inline_size(_context: fidl::encoding::Context) -> usize {
13123 16
13124 }
13125 }
13126
13127 unsafe impl<D: fidl::encoding::ResourceDialect>
13128 fidl::encoding::Encode<ControllerSetPlayerApplicationSettingsResponse, D>
13129 for &ControllerSetPlayerApplicationSettingsResponse
13130 {
13131 #[inline]
13132 unsafe fn encode(
13133 self,
13134 encoder: &mut fidl::encoding::Encoder<'_, D>,
13135 offset: usize,
13136 _depth: fidl::encoding::Depth,
13137 ) -> fidl::Result<()> {
13138 encoder.debug_check_bounds::<ControllerSetPlayerApplicationSettingsResponse>(offset);
13139 fidl::encoding::Encode::<ControllerSetPlayerApplicationSettingsResponse, D>::encode(
13141 (<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
13142 &self.set_settings,
13143 ),),
13144 encoder,
13145 offset,
13146 _depth,
13147 )
13148 }
13149 }
13150 unsafe impl<
13151 D: fidl::encoding::ResourceDialect,
13152 T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
13153 > fidl::encoding::Encode<ControllerSetPlayerApplicationSettingsResponse, D> for (T0,)
13154 {
13155 #[inline]
13156 unsafe fn encode(
13157 self,
13158 encoder: &mut fidl::encoding::Encoder<'_, D>,
13159 offset: usize,
13160 depth: fidl::encoding::Depth,
13161 ) -> fidl::Result<()> {
13162 encoder.debug_check_bounds::<ControllerSetPlayerApplicationSettingsResponse>(offset);
13163 self.0.encode(encoder, offset + 0, depth)?;
13167 Ok(())
13168 }
13169 }
13170
13171 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13172 for ControllerSetPlayerApplicationSettingsResponse
13173 {
13174 #[inline(always)]
13175 fn new_empty() -> Self {
13176 Self { set_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
13177 }
13178
13179 #[inline]
13180 unsafe fn decode(
13181 &mut self,
13182 decoder: &mut fidl::encoding::Decoder<'_, D>,
13183 offset: usize,
13184 _depth: fidl::encoding::Depth,
13185 ) -> fidl::Result<()> {
13186 decoder.debug_check_bounds::<Self>(offset);
13187 fidl::decode!(
13189 PlayerApplicationSettings,
13190 D,
13191 &mut self.set_settings,
13192 decoder,
13193 offset + 0,
13194 _depth
13195 )?;
13196 Ok(())
13197 }
13198 }
13199
13200 impl fidl::encoding::ValueTypeMarker for CustomAttributeValue {
13201 type Borrowed<'a> = &'a Self;
13202 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13203 value
13204 }
13205 }
13206
13207 unsafe impl fidl::encoding::TypeMarker for CustomAttributeValue {
13208 type Owned = Self;
13209
13210 #[inline(always)]
13211 fn inline_align(_context: fidl::encoding::Context) -> usize {
13212 8
13213 }
13214
13215 #[inline(always)]
13216 fn inline_size(_context: fidl::encoding::Context) -> usize {
13217 24
13218 }
13219 }
13220
13221 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CustomAttributeValue, D>
13222 for &CustomAttributeValue
13223 {
13224 #[inline]
13225 unsafe fn encode(
13226 self,
13227 encoder: &mut fidl::encoding::Encoder<'_, D>,
13228 offset: usize,
13229 _depth: fidl::encoding::Depth,
13230 ) -> fidl::Result<()> {
13231 encoder.debug_check_bounds::<CustomAttributeValue>(offset);
13232 fidl::encoding::Encode::<CustomAttributeValue, D>::encode(
13234 (
13235 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
13236 &self.description,
13237 ),
13238 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
13239 ),
13240 encoder,
13241 offset,
13242 _depth,
13243 )
13244 }
13245 }
13246 unsafe impl<
13247 D: fidl::encoding::ResourceDialect,
13248 T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
13249 T1: fidl::encoding::Encode<u8, D>,
13250 > fidl::encoding::Encode<CustomAttributeValue, D> for (T0, T1)
13251 {
13252 #[inline]
13253 unsafe fn encode(
13254 self,
13255 encoder: &mut fidl::encoding::Encoder<'_, D>,
13256 offset: usize,
13257 depth: fidl::encoding::Depth,
13258 ) -> fidl::Result<()> {
13259 encoder.debug_check_bounds::<CustomAttributeValue>(offset);
13260 unsafe {
13263 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
13264 (ptr as *mut u64).write_unaligned(0);
13265 }
13266 self.0.encode(encoder, offset + 0, depth)?;
13268 self.1.encode(encoder, offset + 16, depth)?;
13269 Ok(())
13270 }
13271 }
13272
13273 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CustomAttributeValue {
13274 #[inline(always)]
13275 fn new_empty() -> Self {
13276 Self {
13277 description: fidl::new_empty!(fidl::encoding::BoundedString<255>, D),
13278 value: fidl::new_empty!(u8, D),
13279 }
13280 }
13281
13282 #[inline]
13283 unsafe fn decode(
13284 &mut self,
13285 decoder: &mut fidl::encoding::Decoder<'_, D>,
13286 offset: usize,
13287 _depth: fidl::encoding::Depth,
13288 ) -> fidl::Result<()> {
13289 decoder.debug_check_bounds::<Self>(offset);
13290 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
13292 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13293 let mask = 0xffffffffffffff00u64;
13294 let maskedval = padval & mask;
13295 if maskedval != 0 {
13296 return Err(fidl::Error::NonZeroPadding {
13297 padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
13298 });
13299 }
13300 fidl::decode!(
13301 fidl::encoding::BoundedString<255>,
13302 D,
13303 &mut self.description,
13304 decoder,
13305 offset + 0,
13306 _depth
13307 )?;
13308 fidl::decode!(u8, D, &mut self.value, decoder, offset + 16, _depth)?;
13309 Ok(())
13310 }
13311 }
13312
13313 impl fidl::encoding::ValueTypeMarker for Parent {
13314 type Borrowed<'a> = &'a Self;
13315 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13316 value
13317 }
13318 }
13319
13320 unsafe impl fidl::encoding::TypeMarker for Parent {
13321 type Owned = Self;
13322
13323 #[inline(always)]
13324 fn inline_align(_context: fidl::encoding::Context) -> usize {
13325 1
13326 }
13327
13328 #[inline(always)]
13329 fn inline_size(_context: fidl::encoding::Context) -> usize {
13330 1
13331 }
13332 }
13333
13334 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Parent, D> for &Parent {
13335 #[inline]
13336 unsafe fn encode(
13337 self,
13338 encoder: &mut fidl::encoding::Encoder<'_, D>,
13339 offset: usize,
13340 _depth: fidl::encoding::Depth,
13341 ) -> fidl::Result<()> {
13342 encoder.debug_check_bounds::<Parent>(offset);
13343 encoder.write_num(0u8, offset);
13344 Ok(())
13345 }
13346 }
13347
13348 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Parent {
13349 #[inline(always)]
13350 fn new_empty() -> Self {
13351 Self
13352 }
13353
13354 #[inline]
13355 unsafe fn decode(
13356 &mut self,
13357 decoder: &mut fidl::encoding::Decoder<'_, D>,
13358 offset: usize,
13359 _depth: fidl::encoding::Depth,
13360 ) -> fidl::Result<()> {
13361 decoder.debug_check_bounds::<Self>(offset);
13362 match decoder.read_num::<u8>(offset) {
13363 0 => Ok(()),
13364 _ => Err(fidl::Error::Invalid),
13365 }
13366 }
13367 }
13368
13369 impl fidl::encoding::ResourceTypeMarker for PeerManagerGetBrowseControllerForTargetRequest {
13370 type Borrowed<'a> = &'a mut Self;
13371 fn take_or_borrow<'a>(
13372 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13373 ) -> Self::Borrowed<'a> {
13374 value
13375 }
13376 }
13377
13378 unsafe impl fidl::encoding::TypeMarker for PeerManagerGetBrowseControllerForTargetRequest {
13379 type Owned = Self;
13380
13381 #[inline(always)]
13382 fn inline_align(_context: fidl::encoding::Context) -> usize {
13383 8
13384 }
13385
13386 #[inline(always)]
13387 fn inline_size(_context: fidl::encoding::Context) -> usize {
13388 16
13389 }
13390 }
13391
13392 unsafe impl
13393 fidl::encoding::Encode<
13394 PeerManagerGetBrowseControllerForTargetRequest,
13395 fidl::encoding::DefaultFuchsiaResourceDialect,
13396 > for &mut PeerManagerGetBrowseControllerForTargetRequest
13397 {
13398 #[inline]
13399 unsafe fn encode(
13400 self,
13401 encoder: &mut fidl::encoding::Encoder<
13402 '_,
13403 fidl::encoding::DefaultFuchsiaResourceDialect,
13404 >,
13405 offset: usize,
13406 _depth: fidl::encoding::Depth,
13407 ) -> fidl::Result<()> {
13408 encoder.debug_check_bounds::<PeerManagerGetBrowseControllerForTargetRequest>(offset);
13409 fidl::encoding::Encode::<PeerManagerGetBrowseControllerForTargetRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
13411 (
13412 <fidl_fuchsia_bluetooth::PeerId as fidl::encoding::ValueTypeMarker>::borrow(&self.peer_id),
13413 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BrowseControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.client),
13414 ),
13415 encoder, offset, _depth
13416 )
13417 }
13418 }
13419 unsafe impl<
13420 T0: fidl::encoding::Encode<
13421 fidl_fuchsia_bluetooth::PeerId,
13422 fidl::encoding::DefaultFuchsiaResourceDialect,
13423 >,
13424 T1: fidl::encoding::Encode<
13425 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BrowseControllerMarker>>,
13426 fidl::encoding::DefaultFuchsiaResourceDialect,
13427 >,
13428 >
13429 fidl::encoding::Encode<
13430 PeerManagerGetBrowseControllerForTargetRequest,
13431 fidl::encoding::DefaultFuchsiaResourceDialect,
13432 > for (T0, T1)
13433 {
13434 #[inline]
13435 unsafe fn encode(
13436 self,
13437 encoder: &mut fidl::encoding::Encoder<
13438 '_,
13439 fidl::encoding::DefaultFuchsiaResourceDialect,
13440 >,
13441 offset: usize,
13442 depth: fidl::encoding::Depth,
13443 ) -> fidl::Result<()> {
13444 encoder.debug_check_bounds::<PeerManagerGetBrowseControllerForTargetRequest>(offset);
13445 unsafe {
13448 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
13449 (ptr as *mut u64).write_unaligned(0);
13450 }
13451 self.0.encode(encoder, offset + 0, depth)?;
13453 self.1.encode(encoder, offset + 8, depth)?;
13454 Ok(())
13455 }
13456 }
13457
13458 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13459 for PeerManagerGetBrowseControllerForTargetRequest
13460 {
13461 #[inline(always)]
13462 fn new_empty() -> Self {
13463 Self {
13464 peer_id: fidl::new_empty!(
13465 fidl_fuchsia_bluetooth::PeerId,
13466 fidl::encoding::DefaultFuchsiaResourceDialect
13467 ),
13468 client: fidl::new_empty!(
13469 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BrowseControllerMarker>>,
13470 fidl::encoding::DefaultFuchsiaResourceDialect
13471 ),
13472 }
13473 }
13474
13475 #[inline]
13476 unsafe fn decode(
13477 &mut self,
13478 decoder: &mut fidl::encoding::Decoder<
13479 '_,
13480 fidl::encoding::DefaultFuchsiaResourceDialect,
13481 >,
13482 offset: usize,
13483 _depth: fidl::encoding::Depth,
13484 ) -> fidl::Result<()> {
13485 decoder.debug_check_bounds::<Self>(offset);
13486 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
13488 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13489 let mask = 0xffffffff00000000u64;
13490 let maskedval = padval & mask;
13491 if maskedval != 0 {
13492 return Err(fidl::Error::NonZeroPadding {
13493 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
13494 });
13495 }
13496 fidl::decode!(
13497 fidl_fuchsia_bluetooth::PeerId,
13498 fidl::encoding::DefaultFuchsiaResourceDialect,
13499 &mut self.peer_id,
13500 decoder,
13501 offset + 0,
13502 _depth
13503 )?;
13504 fidl::decode!(
13505 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BrowseControllerMarker>>,
13506 fidl::encoding::DefaultFuchsiaResourceDialect,
13507 &mut self.client,
13508 decoder,
13509 offset + 8,
13510 _depth
13511 )?;
13512 Ok(())
13513 }
13514 }
13515
13516 impl fidl::encoding::ResourceTypeMarker for PeerManagerGetControllerForTargetRequest {
13517 type Borrowed<'a> = &'a mut Self;
13518 fn take_or_borrow<'a>(
13519 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13520 ) -> Self::Borrowed<'a> {
13521 value
13522 }
13523 }
13524
13525 unsafe impl fidl::encoding::TypeMarker for PeerManagerGetControllerForTargetRequest {
13526 type Owned = Self;
13527
13528 #[inline(always)]
13529 fn inline_align(_context: fidl::encoding::Context) -> usize {
13530 8
13531 }
13532
13533 #[inline(always)]
13534 fn inline_size(_context: fidl::encoding::Context) -> usize {
13535 16
13536 }
13537 }
13538
13539 unsafe impl
13540 fidl::encoding::Encode<
13541 PeerManagerGetControllerForTargetRequest,
13542 fidl::encoding::DefaultFuchsiaResourceDialect,
13543 > for &mut PeerManagerGetControllerForTargetRequest
13544 {
13545 #[inline]
13546 unsafe fn encode(
13547 self,
13548 encoder: &mut fidl::encoding::Encoder<
13549 '_,
13550 fidl::encoding::DefaultFuchsiaResourceDialect,
13551 >,
13552 offset: usize,
13553 _depth: fidl::encoding::Depth,
13554 ) -> fidl::Result<()> {
13555 encoder.debug_check_bounds::<PeerManagerGetControllerForTargetRequest>(offset);
13556 fidl::encoding::Encode::<PeerManagerGetControllerForTargetRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
13558 (
13559 <fidl_fuchsia_bluetooth::PeerId as fidl::encoding::ValueTypeMarker>::borrow(&self.peer_id),
13560 <fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.client),
13561 ),
13562 encoder, offset, _depth
13563 )
13564 }
13565 }
13566 unsafe impl<
13567 T0: fidl::encoding::Encode<
13568 fidl_fuchsia_bluetooth::PeerId,
13569 fidl::encoding::DefaultFuchsiaResourceDialect,
13570 >,
13571 T1: fidl::encoding::Encode<
13572 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
13573 fidl::encoding::DefaultFuchsiaResourceDialect,
13574 >,
13575 >
13576 fidl::encoding::Encode<
13577 PeerManagerGetControllerForTargetRequest,
13578 fidl::encoding::DefaultFuchsiaResourceDialect,
13579 > for (T0, T1)
13580 {
13581 #[inline]
13582 unsafe fn encode(
13583 self,
13584 encoder: &mut fidl::encoding::Encoder<
13585 '_,
13586 fidl::encoding::DefaultFuchsiaResourceDialect,
13587 >,
13588 offset: usize,
13589 depth: fidl::encoding::Depth,
13590 ) -> fidl::Result<()> {
13591 encoder.debug_check_bounds::<PeerManagerGetControllerForTargetRequest>(offset);
13592 unsafe {
13595 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
13596 (ptr as *mut u64).write_unaligned(0);
13597 }
13598 self.0.encode(encoder, offset + 0, depth)?;
13600 self.1.encode(encoder, offset + 8, depth)?;
13601 Ok(())
13602 }
13603 }
13604
13605 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13606 for PeerManagerGetControllerForTargetRequest
13607 {
13608 #[inline(always)]
13609 fn new_empty() -> Self {
13610 Self {
13611 peer_id: fidl::new_empty!(
13612 fidl_fuchsia_bluetooth::PeerId,
13613 fidl::encoding::DefaultFuchsiaResourceDialect
13614 ),
13615 client: fidl::new_empty!(
13616 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
13617 fidl::encoding::DefaultFuchsiaResourceDialect
13618 ),
13619 }
13620 }
13621
13622 #[inline]
13623 unsafe fn decode(
13624 &mut self,
13625 decoder: &mut fidl::encoding::Decoder<
13626 '_,
13627 fidl::encoding::DefaultFuchsiaResourceDialect,
13628 >,
13629 offset: usize,
13630 _depth: fidl::encoding::Depth,
13631 ) -> fidl::Result<()> {
13632 decoder.debug_check_bounds::<Self>(offset);
13633 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
13635 let padval = unsafe { (ptr as *const u64).read_unaligned() };
13636 let mask = 0xffffffff00000000u64;
13637 let maskedval = padval & mask;
13638 if maskedval != 0 {
13639 return Err(fidl::Error::NonZeroPadding {
13640 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
13641 });
13642 }
13643 fidl::decode!(
13644 fidl_fuchsia_bluetooth::PeerId,
13645 fidl::encoding::DefaultFuchsiaResourceDialect,
13646 &mut self.peer_id,
13647 decoder,
13648 offset + 0,
13649 _depth
13650 )?;
13651 fidl::decode!(
13652 fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
13653 fidl::encoding::DefaultFuchsiaResourceDialect,
13654 &mut self.client,
13655 decoder,
13656 offset + 8,
13657 _depth
13658 )?;
13659 Ok(())
13660 }
13661 }
13662
13663 impl fidl::encoding::ResourceTypeMarker for PeerManagerRegisterTargetHandlerRequest {
13664 type Borrowed<'a> = &'a mut Self;
13665 fn take_or_borrow<'a>(
13666 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13667 ) -> Self::Borrowed<'a> {
13668 value
13669 }
13670 }
13671
13672 unsafe impl fidl::encoding::TypeMarker for PeerManagerRegisterTargetHandlerRequest {
13673 type Owned = Self;
13674
13675 #[inline(always)]
13676 fn inline_align(_context: fidl::encoding::Context) -> usize {
13677 4
13678 }
13679
13680 #[inline(always)]
13681 fn inline_size(_context: fidl::encoding::Context) -> usize {
13682 4
13683 }
13684 }
13685
13686 unsafe impl
13687 fidl::encoding::Encode<
13688 PeerManagerRegisterTargetHandlerRequest,
13689 fidl::encoding::DefaultFuchsiaResourceDialect,
13690 > for &mut PeerManagerRegisterTargetHandlerRequest
13691 {
13692 #[inline]
13693 unsafe fn encode(
13694 self,
13695 encoder: &mut fidl::encoding::Encoder<
13696 '_,
13697 fidl::encoding::DefaultFuchsiaResourceDialect,
13698 >,
13699 offset: usize,
13700 _depth: fidl::encoding::Depth,
13701 ) -> fidl::Result<()> {
13702 encoder.debug_check_bounds::<PeerManagerRegisterTargetHandlerRequest>(offset);
13703 fidl::encoding::Encode::<PeerManagerRegisterTargetHandlerRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
13705 (
13706 <fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<TargetHandlerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.handler),
13707 ),
13708 encoder, offset, _depth
13709 )
13710 }
13711 }
13712 unsafe impl<
13713 T0: fidl::encoding::Encode<
13714 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<TargetHandlerMarker>>,
13715 fidl::encoding::DefaultFuchsiaResourceDialect,
13716 >,
13717 >
13718 fidl::encoding::Encode<
13719 PeerManagerRegisterTargetHandlerRequest,
13720 fidl::encoding::DefaultFuchsiaResourceDialect,
13721 > for (T0,)
13722 {
13723 #[inline]
13724 unsafe fn encode(
13725 self,
13726 encoder: &mut fidl::encoding::Encoder<
13727 '_,
13728 fidl::encoding::DefaultFuchsiaResourceDialect,
13729 >,
13730 offset: usize,
13731 depth: fidl::encoding::Depth,
13732 ) -> fidl::Result<()> {
13733 encoder.debug_check_bounds::<PeerManagerRegisterTargetHandlerRequest>(offset);
13734 self.0.encode(encoder, offset + 0, depth)?;
13738 Ok(())
13739 }
13740 }
13741
13742 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13743 for PeerManagerRegisterTargetHandlerRequest
13744 {
13745 #[inline(always)]
13746 fn new_empty() -> Self {
13747 Self {
13748 handler: fidl::new_empty!(
13749 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<TargetHandlerMarker>>,
13750 fidl::encoding::DefaultFuchsiaResourceDialect
13751 ),
13752 }
13753 }
13754
13755 #[inline]
13756 unsafe fn decode(
13757 &mut self,
13758 decoder: &mut fidl::encoding::Decoder<
13759 '_,
13760 fidl::encoding::DefaultFuchsiaResourceDialect,
13761 >,
13762 offset: usize,
13763 _depth: fidl::encoding::Depth,
13764 ) -> fidl::Result<()> {
13765 decoder.debug_check_bounds::<Self>(offset);
13766 fidl::decode!(
13768 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<TargetHandlerMarker>>,
13769 fidl::encoding::DefaultFuchsiaResourceDialect,
13770 &mut self.handler,
13771 decoder,
13772 offset + 0,
13773 _depth
13774 )?;
13775 Ok(())
13776 }
13777 }
13778
13779 impl fidl::encoding::ResourceTypeMarker for PeerManagerSetAbsoluteVolumeHandlerRequest {
13780 type Borrowed<'a> = &'a mut Self;
13781 fn take_or_borrow<'a>(
13782 value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
13783 ) -> Self::Borrowed<'a> {
13784 value
13785 }
13786 }
13787
13788 unsafe impl fidl::encoding::TypeMarker for PeerManagerSetAbsoluteVolumeHandlerRequest {
13789 type Owned = Self;
13790
13791 #[inline(always)]
13792 fn inline_align(_context: fidl::encoding::Context) -> usize {
13793 4
13794 }
13795
13796 #[inline(always)]
13797 fn inline_size(_context: fidl::encoding::Context) -> usize {
13798 4
13799 }
13800 }
13801
13802 unsafe impl
13803 fidl::encoding::Encode<
13804 PeerManagerSetAbsoluteVolumeHandlerRequest,
13805 fidl::encoding::DefaultFuchsiaResourceDialect,
13806 > for &mut PeerManagerSetAbsoluteVolumeHandlerRequest
13807 {
13808 #[inline]
13809 unsafe fn encode(
13810 self,
13811 encoder: &mut fidl::encoding::Encoder<
13812 '_,
13813 fidl::encoding::DefaultFuchsiaResourceDialect,
13814 >,
13815 offset: usize,
13816 _depth: fidl::encoding::Depth,
13817 ) -> fidl::Result<()> {
13818 encoder.debug_check_bounds::<PeerManagerSetAbsoluteVolumeHandlerRequest>(offset);
13819 fidl::encoding::Encode::<
13821 PeerManagerSetAbsoluteVolumeHandlerRequest,
13822 fidl::encoding::DefaultFuchsiaResourceDialect,
13823 >::encode(
13824 (
13825 <fidl::encoding::Endpoint<
13826 fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
13827 > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
13828 &mut self.handler
13829 ),
13830 ),
13831 encoder,
13832 offset,
13833 _depth,
13834 )
13835 }
13836 }
13837 unsafe impl<
13838 T0: fidl::encoding::Encode<
13839 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>>,
13840 fidl::encoding::DefaultFuchsiaResourceDialect,
13841 >,
13842 >
13843 fidl::encoding::Encode<
13844 PeerManagerSetAbsoluteVolumeHandlerRequest,
13845 fidl::encoding::DefaultFuchsiaResourceDialect,
13846 > for (T0,)
13847 {
13848 #[inline]
13849 unsafe fn encode(
13850 self,
13851 encoder: &mut fidl::encoding::Encoder<
13852 '_,
13853 fidl::encoding::DefaultFuchsiaResourceDialect,
13854 >,
13855 offset: usize,
13856 depth: fidl::encoding::Depth,
13857 ) -> fidl::Result<()> {
13858 encoder.debug_check_bounds::<PeerManagerSetAbsoluteVolumeHandlerRequest>(offset);
13859 self.0.encode(encoder, offset + 0, depth)?;
13863 Ok(())
13864 }
13865 }
13866
13867 impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
13868 for PeerManagerSetAbsoluteVolumeHandlerRequest
13869 {
13870 #[inline(always)]
13871 fn new_empty() -> Self {
13872 Self {
13873 handler: fidl::new_empty!(
13874 fidl::encoding::Endpoint<
13875 fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
13876 >,
13877 fidl::encoding::DefaultFuchsiaResourceDialect
13878 ),
13879 }
13880 }
13881
13882 #[inline]
13883 unsafe fn decode(
13884 &mut self,
13885 decoder: &mut fidl::encoding::Decoder<
13886 '_,
13887 fidl::encoding::DefaultFuchsiaResourceDialect,
13888 >,
13889 offset: usize,
13890 _depth: fidl::encoding::Depth,
13891 ) -> fidl::Result<()> {
13892 decoder.debug_check_bounds::<Self>(offset);
13893 fidl::decode!(
13895 fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>>,
13896 fidl::encoding::DefaultFuchsiaResourceDialect,
13897 &mut self.handler,
13898 decoder,
13899 offset + 0,
13900 _depth
13901 )?;
13902 Ok(())
13903 }
13904 }
13905
13906 impl fidl::encoding::ValueTypeMarker for TargetHandlerGetNotificationRequest {
13907 type Borrowed<'a> = &'a Self;
13908 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13909 value
13910 }
13911 }
13912
13913 unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetNotificationRequest {
13914 type Owned = Self;
13915
13916 #[inline(always)]
13917 fn inline_align(_context: fidl::encoding::Context) -> usize {
13918 1
13919 }
13920
13921 #[inline(always)]
13922 fn inline_size(_context: fidl::encoding::Context) -> usize {
13923 1
13924 }
13925 }
13926
13927 unsafe impl<D: fidl::encoding::ResourceDialect>
13928 fidl::encoding::Encode<TargetHandlerGetNotificationRequest, D>
13929 for &TargetHandlerGetNotificationRequest
13930 {
13931 #[inline]
13932 unsafe fn encode(
13933 self,
13934 encoder: &mut fidl::encoding::Encoder<'_, D>,
13935 offset: usize,
13936 _depth: fidl::encoding::Depth,
13937 ) -> fidl::Result<()> {
13938 encoder.debug_check_bounds::<TargetHandlerGetNotificationRequest>(offset);
13939 fidl::encoding::Encode::<TargetHandlerGetNotificationRequest, D>::encode(
13941 (<NotificationEvent as fidl::encoding::ValueTypeMarker>::borrow(&self.event_id),),
13942 encoder,
13943 offset,
13944 _depth,
13945 )
13946 }
13947 }
13948 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<NotificationEvent, D>>
13949 fidl::encoding::Encode<TargetHandlerGetNotificationRequest, D> for (T0,)
13950 {
13951 #[inline]
13952 unsafe fn encode(
13953 self,
13954 encoder: &mut fidl::encoding::Encoder<'_, D>,
13955 offset: usize,
13956 depth: fidl::encoding::Depth,
13957 ) -> fidl::Result<()> {
13958 encoder.debug_check_bounds::<TargetHandlerGetNotificationRequest>(offset);
13959 self.0.encode(encoder, offset + 0, depth)?;
13963 Ok(())
13964 }
13965 }
13966
13967 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
13968 for TargetHandlerGetNotificationRequest
13969 {
13970 #[inline(always)]
13971 fn new_empty() -> Self {
13972 Self { event_id: fidl::new_empty!(NotificationEvent, D) }
13973 }
13974
13975 #[inline]
13976 unsafe fn decode(
13977 &mut self,
13978 decoder: &mut fidl::encoding::Decoder<'_, D>,
13979 offset: usize,
13980 _depth: fidl::encoding::Depth,
13981 ) -> fidl::Result<()> {
13982 decoder.debug_check_bounds::<Self>(offset);
13983 fidl::decode!(NotificationEvent, D, &mut self.event_id, decoder, offset + 0, _depth)?;
13985 Ok(())
13986 }
13987 }
13988
13989 impl fidl::encoding::ValueTypeMarker for TargetHandlerGetPlayerApplicationSettingsRequest {
13990 type Borrowed<'a> = &'a Self;
13991 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13992 value
13993 }
13994 }
13995
13996 unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetPlayerApplicationSettingsRequest {
13997 type Owned = Self;
13998
13999 #[inline(always)]
14000 fn inline_align(_context: fidl::encoding::Context) -> usize {
14001 8
14002 }
14003
14004 #[inline(always)]
14005 fn inline_size(_context: fidl::encoding::Context) -> usize {
14006 16
14007 }
14008 }
14009
14010 unsafe impl<D: fidl::encoding::ResourceDialect>
14011 fidl::encoding::Encode<TargetHandlerGetPlayerApplicationSettingsRequest, D>
14012 for &TargetHandlerGetPlayerApplicationSettingsRequest
14013 {
14014 #[inline]
14015 unsafe fn encode(
14016 self,
14017 encoder: &mut fidl::encoding::Encoder<'_, D>,
14018 offset: usize,
14019 _depth: fidl::encoding::Depth,
14020 ) -> fidl::Result<()> {
14021 encoder.debug_check_bounds::<TargetHandlerGetPlayerApplicationSettingsRequest>(offset);
14022 fidl::encoding::Encode::<TargetHandlerGetPlayerApplicationSettingsRequest, D>::encode(
14024 (
14025 <fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131> as fidl::encoding::ValueTypeMarker>::borrow(&self.attribute_ids),
14026 ),
14027 encoder, offset, _depth
14028 )
14029 }
14030 }
14031 unsafe impl<
14032 D: fidl::encoding::ResourceDialect,
14033 T0: fidl::encoding::Encode<
14034 fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>,
14035 D,
14036 >,
14037 > fidl::encoding::Encode<TargetHandlerGetPlayerApplicationSettingsRequest, D> for (T0,)
14038 {
14039 #[inline]
14040 unsafe fn encode(
14041 self,
14042 encoder: &mut fidl::encoding::Encoder<'_, D>,
14043 offset: usize,
14044 depth: fidl::encoding::Depth,
14045 ) -> fidl::Result<()> {
14046 encoder.debug_check_bounds::<TargetHandlerGetPlayerApplicationSettingsRequest>(offset);
14047 self.0.encode(encoder, offset + 0, depth)?;
14051 Ok(())
14052 }
14053 }
14054
14055 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14056 for TargetHandlerGetPlayerApplicationSettingsRequest
14057 {
14058 #[inline(always)]
14059 fn new_empty() -> Self {
14060 Self {
14061 attribute_ids: fidl::new_empty!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D),
14062 }
14063 }
14064
14065 #[inline]
14066 unsafe fn decode(
14067 &mut self,
14068 decoder: &mut fidl::encoding::Decoder<'_, D>,
14069 offset: usize,
14070 _depth: fidl::encoding::Depth,
14071 ) -> fidl::Result<()> {
14072 decoder.debug_check_bounds::<Self>(offset);
14073 fidl::decode!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D, &mut self.attribute_ids, decoder, offset + 0, _depth)?;
14075 Ok(())
14076 }
14077 }
14078
14079 impl fidl::encoding::ValueTypeMarker for TargetHandlerSendCommandRequest {
14080 type Borrowed<'a> = &'a Self;
14081 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14082 value
14083 }
14084 }
14085
14086 unsafe impl fidl::encoding::TypeMarker for TargetHandlerSendCommandRequest {
14087 type Owned = Self;
14088
14089 #[inline(always)]
14090 fn inline_align(_context: fidl::encoding::Context) -> usize {
14091 1
14092 }
14093
14094 #[inline(always)]
14095 fn inline_size(_context: fidl::encoding::Context) -> usize {
14096 2
14097 }
14098 }
14099
14100 unsafe impl<D: fidl::encoding::ResourceDialect>
14101 fidl::encoding::Encode<TargetHandlerSendCommandRequest, D>
14102 for &TargetHandlerSendCommandRequest
14103 {
14104 #[inline]
14105 unsafe fn encode(
14106 self,
14107 encoder: &mut fidl::encoding::Encoder<'_, D>,
14108 offset: usize,
14109 _depth: fidl::encoding::Depth,
14110 ) -> fidl::Result<()> {
14111 encoder.debug_check_bounds::<TargetHandlerSendCommandRequest>(offset);
14112 fidl::encoding::Encode::<TargetHandlerSendCommandRequest, D>::encode(
14114 (
14115 <AvcPanelCommand as fidl::encoding::ValueTypeMarker>::borrow(&self.command),
14116 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.pressed),
14117 ),
14118 encoder,
14119 offset,
14120 _depth,
14121 )
14122 }
14123 }
14124 unsafe impl<
14125 D: fidl::encoding::ResourceDialect,
14126 T0: fidl::encoding::Encode<AvcPanelCommand, D>,
14127 T1: fidl::encoding::Encode<bool, D>,
14128 > fidl::encoding::Encode<TargetHandlerSendCommandRequest, D> for (T0, T1)
14129 {
14130 #[inline]
14131 unsafe fn encode(
14132 self,
14133 encoder: &mut fidl::encoding::Encoder<'_, D>,
14134 offset: usize,
14135 depth: fidl::encoding::Depth,
14136 ) -> fidl::Result<()> {
14137 encoder.debug_check_bounds::<TargetHandlerSendCommandRequest>(offset);
14138 self.0.encode(encoder, offset + 0, depth)?;
14142 self.1.encode(encoder, offset + 1, depth)?;
14143 Ok(())
14144 }
14145 }
14146
14147 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14148 for TargetHandlerSendCommandRequest
14149 {
14150 #[inline(always)]
14151 fn new_empty() -> Self {
14152 Self {
14153 command: fidl::new_empty!(AvcPanelCommand, D),
14154 pressed: fidl::new_empty!(bool, D),
14155 }
14156 }
14157
14158 #[inline]
14159 unsafe fn decode(
14160 &mut self,
14161 decoder: &mut fidl::encoding::Decoder<'_, D>,
14162 offset: usize,
14163 _depth: fidl::encoding::Depth,
14164 ) -> fidl::Result<()> {
14165 decoder.debug_check_bounds::<Self>(offset);
14166 fidl::decode!(AvcPanelCommand, D, &mut self.command, decoder, offset + 0, _depth)?;
14168 fidl::decode!(bool, D, &mut self.pressed, decoder, offset + 1, _depth)?;
14169 Ok(())
14170 }
14171 }
14172
14173 impl fidl::encoding::ValueTypeMarker for TargetHandlerSetAddressedPlayerRequest {
14174 type Borrowed<'a> = &'a Self;
14175 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14176 value
14177 }
14178 }
14179
14180 unsafe impl fidl::encoding::TypeMarker for TargetHandlerSetAddressedPlayerRequest {
14181 type Owned = Self;
14182
14183 #[inline(always)]
14184 fn inline_align(_context: fidl::encoding::Context) -> usize {
14185 2
14186 }
14187
14188 #[inline(always)]
14189 fn inline_size(_context: fidl::encoding::Context) -> usize {
14190 2
14191 }
14192 #[inline(always)]
14193 fn encode_is_copy() -> bool {
14194 true
14195 }
14196
14197 #[inline(always)]
14198 fn decode_is_copy() -> bool {
14199 true
14200 }
14201 }
14202
14203 unsafe impl<D: fidl::encoding::ResourceDialect>
14204 fidl::encoding::Encode<TargetHandlerSetAddressedPlayerRequest, D>
14205 for &TargetHandlerSetAddressedPlayerRequest
14206 {
14207 #[inline]
14208 unsafe fn encode(
14209 self,
14210 encoder: &mut fidl::encoding::Encoder<'_, D>,
14211 offset: usize,
14212 _depth: fidl::encoding::Depth,
14213 ) -> fidl::Result<()> {
14214 encoder.debug_check_bounds::<TargetHandlerSetAddressedPlayerRequest>(offset);
14215 unsafe {
14216 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
14218 (buf_ptr as *mut TargetHandlerSetAddressedPlayerRequest).write_unaligned(
14219 (self as *const TargetHandlerSetAddressedPlayerRequest).read(),
14220 );
14221 }
14224 Ok(())
14225 }
14226 }
14227 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AddressedPlayerId, D>>
14228 fidl::encoding::Encode<TargetHandlerSetAddressedPlayerRequest, D> for (T0,)
14229 {
14230 #[inline]
14231 unsafe fn encode(
14232 self,
14233 encoder: &mut fidl::encoding::Encoder<'_, D>,
14234 offset: usize,
14235 depth: fidl::encoding::Depth,
14236 ) -> fidl::Result<()> {
14237 encoder.debug_check_bounds::<TargetHandlerSetAddressedPlayerRequest>(offset);
14238 self.0.encode(encoder, offset + 0, depth)?;
14242 Ok(())
14243 }
14244 }
14245
14246 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14247 for TargetHandlerSetAddressedPlayerRequest
14248 {
14249 #[inline(always)]
14250 fn new_empty() -> Self {
14251 Self { player_id: fidl::new_empty!(AddressedPlayerId, D) }
14252 }
14253
14254 #[inline]
14255 unsafe fn decode(
14256 &mut self,
14257 decoder: &mut fidl::encoding::Decoder<'_, D>,
14258 offset: usize,
14259 _depth: fidl::encoding::Depth,
14260 ) -> fidl::Result<()> {
14261 decoder.debug_check_bounds::<Self>(offset);
14262 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
14263 unsafe {
14266 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
14267 }
14268 Ok(())
14269 }
14270 }
14271
14272 impl fidl::encoding::ValueTypeMarker for TargetHandlerSetPlayerApplicationSettingsRequest {
14273 type Borrowed<'a> = &'a Self;
14274 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14275 value
14276 }
14277 }
14278
14279 unsafe impl fidl::encoding::TypeMarker for TargetHandlerSetPlayerApplicationSettingsRequest {
14280 type Owned = Self;
14281
14282 #[inline(always)]
14283 fn inline_align(_context: fidl::encoding::Context) -> usize {
14284 8
14285 }
14286
14287 #[inline(always)]
14288 fn inline_size(_context: fidl::encoding::Context) -> usize {
14289 16
14290 }
14291 }
14292
14293 unsafe impl<D: fidl::encoding::ResourceDialect>
14294 fidl::encoding::Encode<TargetHandlerSetPlayerApplicationSettingsRequest, D>
14295 for &TargetHandlerSetPlayerApplicationSettingsRequest
14296 {
14297 #[inline]
14298 unsafe fn encode(
14299 self,
14300 encoder: &mut fidl::encoding::Encoder<'_, D>,
14301 offset: usize,
14302 _depth: fidl::encoding::Depth,
14303 ) -> fidl::Result<()> {
14304 encoder.debug_check_bounds::<TargetHandlerSetPlayerApplicationSettingsRequest>(offset);
14305 fidl::encoding::Encode::<TargetHandlerSetPlayerApplicationSettingsRequest, D>::encode(
14307 (<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
14308 &self.requested_settings,
14309 ),),
14310 encoder,
14311 offset,
14312 _depth,
14313 )
14314 }
14315 }
14316 unsafe impl<
14317 D: fidl::encoding::ResourceDialect,
14318 T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
14319 > fidl::encoding::Encode<TargetHandlerSetPlayerApplicationSettingsRequest, D> for (T0,)
14320 {
14321 #[inline]
14322 unsafe fn encode(
14323 self,
14324 encoder: &mut fidl::encoding::Encoder<'_, D>,
14325 offset: usize,
14326 depth: fidl::encoding::Depth,
14327 ) -> fidl::Result<()> {
14328 encoder.debug_check_bounds::<TargetHandlerSetPlayerApplicationSettingsRequest>(offset);
14329 self.0.encode(encoder, offset + 0, depth)?;
14333 Ok(())
14334 }
14335 }
14336
14337 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14338 for TargetHandlerSetPlayerApplicationSettingsRequest
14339 {
14340 #[inline(always)]
14341 fn new_empty() -> Self {
14342 Self { requested_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
14343 }
14344
14345 #[inline]
14346 unsafe fn decode(
14347 &mut self,
14348 decoder: &mut fidl::encoding::Decoder<'_, D>,
14349 offset: usize,
14350 _depth: fidl::encoding::Depth,
14351 ) -> fidl::Result<()> {
14352 decoder.debug_check_bounds::<Self>(offset);
14353 fidl::decode!(
14355 PlayerApplicationSettings,
14356 D,
14357 &mut self.requested_settings,
14358 decoder,
14359 offset + 0,
14360 _depth
14361 )?;
14362 Ok(())
14363 }
14364 }
14365
14366 impl fidl::encoding::ValueTypeMarker for TargetHandlerWatchNotificationRequest {
14367 type Borrowed<'a> = &'a Self;
14368 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14369 value
14370 }
14371 }
14372
14373 unsafe impl fidl::encoding::TypeMarker for TargetHandlerWatchNotificationRequest {
14374 type Owned = Self;
14375
14376 #[inline(always)]
14377 fn inline_align(_context: fidl::encoding::Context) -> usize {
14378 8
14379 }
14380
14381 #[inline(always)]
14382 fn inline_size(_context: fidl::encoding::Context) -> usize {
14383 32
14384 }
14385 }
14386
14387 unsafe impl<D: fidl::encoding::ResourceDialect>
14388 fidl::encoding::Encode<TargetHandlerWatchNotificationRequest, D>
14389 for &TargetHandlerWatchNotificationRequest
14390 {
14391 #[inline]
14392 unsafe fn encode(
14393 self,
14394 encoder: &mut fidl::encoding::Encoder<'_, D>,
14395 offset: usize,
14396 _depth: fidl::encoding::Depth,
14397 ) -> fidl::Result<()> {
14398 encoder.debug_check_bounds::<TargetHandlerWatchNotificationRequest>(offset);
14399 fidl::encoding::Encode::<TargetHandlerWatchNotificationRequest, D>::encode(
14401 (
14402 <NotificationEvent as fidl::encoding::ValueTypeMarker>::borrow(&self.event_id),
14403 <Notification as fidl::encoding::ValueTypeMarker>::borrow(&self.current),
14404 <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.pos_change_interval),
14405 ),
14406 encoder,
14407 offset,
14408 _depth,
14409 )
14410 }
14411 }
14412 unsafe impl<
14413 D: fidl::encoding::ResourceDialect,
14414 T0: fidl::encoding::Encode<NotificationEvent, D>,
14415 T1: fidl::encoding::Encode<Notification, D>,
14416 T2: fidl::encoding::Encode<u32, D>,
14417 > fidl::encoding::Encode<TargetHandlerWatchNotificationRequest, D> for (T0, T1, T2)
14418 {
14419 #[inline]
14420 unsafe fn encode(
14421 self,
14422 encoder: &mut fidl::encoding::Encoder<'_, D>,
14423 offset: usize,
14424 depth: fidl::encoding::Depth,
14425 ) -> fidl::Result<()> {
14426 encoder.debug_check_bounds::<TargetHandlerWatchNotificationRequest>(offset);
14427 unsafe {
14430 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
14431 (ptr as *mut u64).write_unaligned(0);
14432 }
14433 unsafe {
14434 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
14435 (ptr as *mut u64).write_unaligned(0);
14436 }
14437 self.0.encode(encoder, offset + 0, depth)?;
14439 self.1.encode(encoder, offset + 8, depth)?;
14440 self.2.encode(encoder, offset + 24, depth)?;
14441 Ok(())
14442 }
14443 }
14444
14445 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14446 for TargetHandlerWatchNotificationRequest
14447 {
14448 #[inline(always)]
14449 fn new_empty() -> Self {
14450 Self {
14451 event_id: fidl::new_empty!(NotificationEvent, D),
14452 current: fidl::new_empty!(Notification, D),
14453 pos_change_interval: fidl::new_empty!(u32, D),
14454 }
14455 }
14456
14457 #[inline]
14458 unsafe fn decode(
14459 &mut self,
14460 decoder: &mut fidl::encoding::Decoder<'_, D>,
14461 offset: usize,
14462 _depth: fidl::encoding::Depth,
14463 ) -> fidl::Result<()> {
14464 decoder.debug_check_bounds::<Self>(offset);
14465 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
14467 let padval = unsafe { (ptr as *const u64).read_unaligned() };
14468 let mask = 0xffffffffffffff00u64;
14469 let maskedval = padval & mask;
14470 if maskedval != 0 {
14471 return Err(fidl::Error::NonZeroPadding {
14472 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
14473 });
14474 }
14475 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
14476 let padval = unsafe { (ptr as *const u64).read_unaligned() };
14477 let mask = 0xffffffff00000000u64;
14478 let maskedval = padval & mask;
14479 if maskedval != 0 {
14480 return Err(fidl::Error::NonZeroPadding {
14481 padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
14482 });
14483 }
14484 fidl::decode!(NotificationEvent, D, &mut self.event_id, decoder, offset + 0, _depth)?;
14485 fidl::decode!(Notification, D, &mut self.current, decoder, offset + 8, _depth)?;
14486 fidl::decode!(u32, D, &mut self.pos_change_interval, decoder, offset + 24, _depth)?;
14487 Ok(())
14488 }
14489 }
14490
14491 impl fidl::encoding::ValueTypeMarker for TargetHandlerGetEventsSupportedResponse {
14492 type Borrowed<'a> = &'a Self;
14493 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14494 value
14495 }
14496 }
14497
14498 unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetEventsSupportedResponse {
14499 type Owned = Self;
14500
14501 #[inline(always)]
14502 fn inline_align(_context: fidl::encoding::Context) -> usize {
14503 8
14504 }
14505
14506 #[inline(always)]
14507 fn inline_size(_context: fidl::encoding::Context) -> usize {
14508 16
14509 }
14510 }
14511
14512 unsafe impl<D: fidl::encoding::ResourceDialect>
14513 fidl::encoding::Encode<TargetHandlerGetEventsSupportedResponse, D>
14514 for &TargetHandlerGetEventsSupportedResponse
14515 {
14516 #[inline]
14517 unsafe fn encode(
14518 self,
14519 encoder: &mut fidl::encoding::Encoder<'_, D>,
14520 offset: usize,
14521 _depth: fidl::encoding::Depth,
14522 ) -> fidl::Result<()> {
14523 encoder.debug_check_bounds::<TargetHandlerGetEventsSupportedResponse>(offset);
14524 fidl::encoding::Encode::<TargetHandlerGetEventsSupportedResponse, D>::encode(
14526 (
14527 <fidl::encoding::Vector<NotificationEvent, 255> as fidl::encoding::ValueTypeMarker>::borrow(&self.notification_ids),
14528 ),
14529 encoder, offset, _depth
14530 )
14531 }
14532 }
14533 unsafe impl<
14534 D: fidl::encoding::ResourceDialect,
14535 T0: fidl::encoding::Encode<fidl::encoding::Vector<NotificationEvent, 255>, D>,
14536 > fidl::encoding::Encode<TargetHandlerGetEventsSupportedResponse, D> for (T0,)
14537 {
14538 #[inline]
14539 unsafe fn encode(
14540 self,
14541 encoder: &mut fidl::encoding::Encoder<'_, D>,
14542 offset: usize,
14543 depth: fidl::encoding::Depth,
14544 ) -> fidl::Result<()> {
14545 encoder.debug_check_bounds::<TargetHandlerGetEventsSupportedResponse>(offset);
14546 self.0.encode(encoder, offset + 0, depth)?;
14550 Ok(())
14551 }
14552 }
14553
14554 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14555 for TargetHandlerGetEventsSupportedResponse
14556 {
14557 #[inline(always)]
14558 fn new_empty() -> Self {
14559 Self {
14560 notification_ids: fidl::new_empty!(fidl::encoding::Vector<NotificationEvent, 255>, D),
14561 }
14562 }
14563
14564 #[inline]
14565 unsafe fn decode(
14566 &mut self,
14567 decoder: &mut fidl::encoding::Decoder<'_, D>,
14568 offset: usize,
14569 _depth: fidl::encoding::Depth,
14570 ) -> fidl::Result<()> {
14571 decoder.debug_check_bounds::<Self>(offset);
14572 fidl::decode!(fidl::encoding::Vector<NotificationEvent, 255>, D, &mut self.notification_ids, decoder, offset + 0, _depth)?;
14574 Ok(())
14575 }
14576 }
14577
14578 impl fidl::encoding::ValueTypeMarker for TargetHandlerGetMediaAttributesResponse {
14579 type Borrowed<'a> = &'a Self;
14580 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14581 value
14582 }
14583 }
14584
14585 unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetMediaAttributesResponse {
14586 type Owned = Self;
14587
14588 #[inline(always)]
14589 fn inline_align(_context: fidl::encoding::Context) -> usize {
14590 8
14591 }
14592
14593 #[inline(always)]
14594 fn inline_size(_context: fidl::encoding::Context) -> usize {
14595 16
14596 }
14597 }
14598
14599 unsafe impl<D: fidl::encoding::ResourceDialect>
14600 fidl::encoding::Encode<TargetHandlerGetMediaAttributesResponse, D>
14601 for &TargetHandlerGetMediaAttributesResponse
14602 {
14603 #[inline]
14604 unsafe fn encode(
14605 self,
14606 encoder: &mut fidl::encoding::Encoder<'_, D>,
14607 offset: usize,
14608 _depth: fidl::encoding::Depth,
14609 ) -> fidl::Result<()> {
14610 encoder.debug_check_bounds::<TargetHandlerGetMediaAttributesResponse>(offset);
14611 fidl::encoding::Encode::<TargetHandlerGetMediaAttributesResponse, D>::encode(
14613 (<MediaAttributes as fidl::encoding::ValueTypeMarker>::borrow(&self.attributes),),
14614 encoder,
14615 offset,
14616 _depth,
14617 )
14618 }
14619 }
14620 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<MediaAttributes, D>>
14621 fidl::encoding::Encode<TargetHandlerGetMediaAttributesResponse, D> for (T0,)
14622 {
14623 #[inline]
14624 unsafe fn encode(
14625 self,
14626 encoder: &mut fidl::encoding::Encoder<'_, D>,
14627 offset: usize,
14628 depth: fidl::encoding::Depth,
14629 ) -> fidl::Result<()> {
14630 encoder.debug_check_bounds::<TargetHandlerGetMediaAttributesResponse>(offset);
14631 self.0.encode(encoder, offset + 0, depth)?;
14635 Ok(())
14636 }
14637 }
14638
14639 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14640 for TargetHandlerGetMediaAttributesResponse
14641 {
14642 #[inline(always)]
14643 fn new_empty() -> Self {
14644 Self { attributes: fidl::new_empty!(MediaAttributes, D) }
14645 }
14646
14647 #[inline]
14648 unsafe fn decode(
14649 &mut self,
14650 decoder: &mut fidl::encoding::Decoder<'_, D>,
14651 offset: usize,
14652 _depth: fidl::encoding::Depth,
14653 ) -> fidl::Result<()> {
14654 decoder.debug_check_bounds::<Self>(offset);
14655 fidl::decode!(MediaAttributes, D, &mut self.attributes, decoder, offset + 0, _depth)?;
14657 Ok(())
14658 }
14659 }
14660
14661 impl fidl::encoding::ValueTypeMarker for TargetHandlerGetMediaPlayerItemsResponse {
14662 type Borrowed<'a> = &'a Self;
14663 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14664 value
14665 }
14666 }
14667
14668 unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetMediaPlayerItemsResponse {
14669 type Owned = Self;
14670
14671 #[inline(always)]
14672 fn inline_align(_context: fidl::encoding::Context) -> usize {
14673 8
14674 }
14675
14676 #[inline(always)]
14677 fn inline_size(_context: fidl::encoding::Context) -> usize {
14678 16
14679 }
14680 }
14681
14682 unsafe impl<D: fidl::encoding::ResourceDialect>
14683 fidl::encoding::Encode<TargetHandlerGetMediaPlayerItemsResponse, D>
14684 for &TargetHandlerGetMediaPlayerItemsResponse
14685 {
14686 #[inline]
14687 unsafe fn encode(
14688 self,
14689 encoder: &mut fidl::encoding::Encoder<'_, D>,
14690 offset: usize,
14691 _depth: fidl::encoding::Depth,
14692 ) -> fidl::Result<()> {
14693 encoder.debug_check_bounds::<TargetHandlerGetMediaPlayerItemsResponse>(offset);
14694 fidl::encoding::Encode::<TargetHandlerGetMediaPlayerItemsResponse, D>::encode(
14696 (
14697 <fidl::encoding::Vector<MediaPlayerItem, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
14698 ),
14699 encoder, offset, _depth
14700 )
14701 }
14702 }
14703 unsafe impl<
14704 D: fidl::encoding::ResourceDialect,
14705 T0: fidl::encoding::Encode<fidl::encoding::Vector<MediaPlayerItem, 16>, D>,
14706 > fidl::encoding::Encode<TargetHandlerGetMediaPlayerItemsResponse, D> for (T0,)
14707 {
14708 #[inline]
14709 unsafe fn encode(
14710 self,
14711 encoder: &mut fidl::encoding::Encoder<'_, D>,
14712 offset: usize,
14713 depth: fidl::encoding::Depth,
14714 ) -> fidl::Result<()> {
14715 encoder.debug_check_bounds::<TargetHandlerGetMediaPlayerItemsResponse>(offset);
14716 self.0.encode(encoder, offset + 0, depth)?;
14720 Ok(())
14721 }
14722 }
14723
14724 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14725 for TargetHandlerGetMediaPlayerItemsResponse
14726 {
14727 #[inline(always)]
14728 fn new_empty() -> Self {
14729 Self { items: fidl::new_empty!(fidl::encoding::Vector<MediaPlayerItem, 16>, D) }
14730 }
14731
14732 #[inline]
14733 unsafe fn decode(
14734 &mut self,
14735 decoder: &mut fidl::encoding::Decoder<'_, D>,
14736 offset: usize,
14737 _depth: fidl::encoding::Depth,
14738 ) -> fidl::Result<()> {
14739 decoder.debug_check_bounds::<Self>(offset);
14740 fidl::decode!(fidl::encoding::Vector<MediaPlayerItem, 16>, D, &mut self.items, decoder, offset + 0, _depth)?;
14742 Ok(())
14743 }
14744 }
14745
14746 impl fidl::encoding::ValueTypeMarker for TargetHandlerGetNotificationResponse {
14747 type Borrowed<'a> = &'a Self;
14748 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14749 value
14750 }
14751 }
14752
14753 unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetNotificationResponse {
14754 type Owned = Self;
14755
14756 #[inline(always)]
14757 fn inline_align(_context: fidl::encoding::Context) -> usize {
14758 8
14759 }
14760
14761 #[inline(always)]
14762 fn inline_size(_context: fidl::encoding::Context) -> usize {
14763 16
14764 }
14765 }
14766
14767 unsafe impl<D: fidl::encoding::ResourceDialect>
14768 fidl::encoding::Encode<TargetHandlerGetNotificationResponse, D>
14769 for &TargetHandlerGetNotificationResponse
14770 {
14771 #[inline]
14772 unsafe fn encode(
14773 self,
14774 encoder: &mut fidl::encoding::Encoder<'_, D>,
14775 offset: usize,
14776 _depth: fidl::encoding::Depth,
14777 ) -> fidl::Result<()> {
14778 encoder.debug_check_bounds::<TargetHandlerGetNotificationResponse>(offset);
14779 fidl::encoding::Encode::<TargetHandlerGetNotificationResponse, D>::encode(
14781 (<Notification as fidl::encoding::ValueTypeMarker>::borrow(&self.current_value),),
14782 encoder,
14783 offset,
14784 _depth,
14785 )
14786 }
14787 }
14788 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Notification, D>>
14789 fidl::encoding::Encode<TargetHandlerGetNotificationResponse, D> for (T0,)
14790 {
14791 #[inline]
14792 unsafe fn encode(
14793 self,
14794 encoder: &mut fidl::encoding::Encoder<'_, D>,
14795 offset: usize,
14796 depth: fidl::encoding::Depth,
14797 ) -> fidl::Result<()> {
14798 encoder.debug_check_bounds::<TargetHandlerGetNotificationResponse>(offset);
14799 self.0.encode(encoder, offset + 0, depth)?;
14803 Ok(())
14804 }
14805 }
14806
14807 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14808 for TargetHandlerGetNotificationResponse
14809 {
14810 #[inline(always)]
14811 fn new_empty() -> Self {
14812 Self { current_value: fidl::new_empty!(Notification, D) }
14813 }
14814
14815 #[inline]
14816 unsafe fn decode(
14817 &mut self,
14818 decoder: &mut fidl::encoding::Decoder<'_, D>,
14819 offset: usize,
14820 _depth: fidl::encoding::Depth,
14821 ) -> fidl::Result<()> {
14822 decoder.debug_check_bounds::<Self>(offset);
14823 fidl::decode!(Notification, D, &mut self.current_value, decoder, offset + 0, _depth)?;
14825 Ok(())
14826 }
14827 }
14828
14829 impl fidl::encoding::ValueTypeMarker for TargetHandlerGetPlayStatusResponse {
14830 type Borrowed<'a> = &'a Self;
14831 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14832 value
14833 }
14834 }
14835
14836 unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetPlayStatusResponse {
14837 type Owned = Self;
14838
14839 #[inline(always)]
14840 fn inline_align(_context: fidl::encoding::Context) -> usize {
14841 8
14842 }
14843
14844 #[inline(always)]
14845 fn inline_size(_context: fidl::encoding::Context) -> usize {
14846 16
14847 }
14848 }
14849
14850 unsafe impl<D: fidl::encoding::ResourceDialect>
14851 fidl::encoding::Encode<TargetHandlerGetPlayStatusResponse, D>
14852 for &TargetHandlerGetPlayStatusResponse
14853 {
14854 #[inline]
14855 unsafe fn encode(
14856 self,
14857 encoder: &mut fidl::encoding::Encoder<'_, D>,
14858 offset: usize,
14859 _depth: fidl::encoding::Depth,
14860 ) -> fidl::Result<()> {
14861 encoder.debug_check_bounds::<TargetHandlerGetPlayStatusResponse>(offset);
14862 fidl::encoding::Encode::<TargetHandlerGetPlayStatusResponse, D>::encode(
14864 (<PlayStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.play_status),),
14865 encoder,
14866 offset,
14867 _depth,
14868 )
14869 }
14870 }
14871 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PlayStatus, D>>
14872 fidl::encoding::Encode<TargetHandlerGetPlayStatusResponse, D> for (T0,)
14873 {
14874 #[inline]
14875 unsafe fn encode(
14876 self,
14877 encoder: &mut fidl::encoding::Encoder<'_, D>,
14878 offset: usize,
14879 depth: fidl::encoding::Depth,
14880 ) -> fidl::Result<()> {
14881 encoder.debug_check_bounds::<TargetHandlerGetPlayStatusResponse>(offset);
14882 self.0.encode(encoder, offset + 0, depth)?;
14886 Ok(())
14887 }
14888 }
14889
14890 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14891 for TargetHandlerGetPlayStatusResponse
14892 {
14893 #[inline(always)]
14894 fn new_empty() -> Self {
14895 Self { play_status: fidl::new_empty!(PlayStatus, D) }
14896 }
14897
14898 #[inline]
14899 unsafe fn decode(
14900 &mut self,
14901 decoder: &mut fidl::encoding::Decoder<'_, D>,
14902 offset: usize,
14903 _depth: fidl::encoding::Depth,
14904 ) -> fidl::Result<()> {
14905 decoder.debug_check_bounds::<Self>(offset);
14906 fidl::decode!(PlayStatus, D, &mut self.play_status, decoder, offset + 0, _depth)?;
14908 Ok(())
14909 }
14910 }
14911
14912 impl fidl::encoding::ValueTypeMarker for TargetHandlerGetPlayerApplicationSettingsResponse {
14913 type Borrowed<'a> = &'a Self;
14914 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14915 value
14916 }
14917 }
14918
14919 unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetPlayerApplicationSettingsResponse {
14920 type Owned = Self;
14921
14922 #[inline(always)]
14923 fn inline_align(_context: fidl::encoding::Context) -> usize {
14924 8
14925 }
14926
14927 #[inline(always)]
14928 fn inline_size(_context: fidl::encoding::Context) -> usize {
14929 16
14930 }
14931 }
14932
14933 unsafe impl<D: fidl::encoding::ResourceDialect>
14934 fidl::encoding::Encode<TargetHandlerGetPlayerApplicationSettingsResponse, D>
14935 for &TargetHandlerGetPlayerApplicationSettingsResponse
14936 {
14937 #[inline]
14938 unsafe fn encode(
14939 self,
14940 encoder: &mut fidl::encoding::Encoder<'_, D>,
14941 offset: usize,
14942 _depth: fidl::encoding::Depth,
14943 ) -> fidl::Result<()> {
14944 encoder.debug_check_bounds::<TargetHandlerGetPlayerApplicationSettingsResponse>(offset);
14945 fidl::encoding::Encode::<TargetHandlerGetPlayerApplicationSettingsResponse, D>::encode(
14947 (<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
14948 &self.current_settings,
14949 ),),
14950 encoder,
14951 offset,
14952 _depth,
14953 )
14954 }
14955 }
14956 unsafe impl<
14957 D: fidl::encoding::ResourceDialect,
14958 T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
14959 > fidl::encoding::Encode<TargetHandlerGetPlayerApplicationSettingsResponse, D> for (T0,)
14960 {
14961 #[inline]
14962 unsafe fn encode(
14963 self,
14964 encoder: &mut fidl::encoding::Encoder<'_, D>,
14965 offset: usize,
14966 depth: fidl::encoding::Depth,
14967 ) -> fidl::Result<()> {
14968 encoder.debug_check_bounds::<TargetHandlerGetPlayerApplicationSettingsResponse>(offset);
14969 self.0.encode(encoder, offset + 0, depth)?;
14973 Ok(())
14974 }
14975 }
14976
14977 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
14978 for TargetHandlerGetPlayerApplicationSettingsResponse
14979 {
14980 #[inline(always)]
14981 fn new_empty() -> Self {
14982 Self { current_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
14983 }
14984
14985 #[inline]
14986 unsafe fn decode(
14987 &mut self,
14988 decoder: &mut fidl::encoding::Decoder<'_, D>,
14989 offset: usize,
14990 _depth: fidl::encoding::Depth,
14991 ) -> fidl::Result<()> {
14992 decoder.debug_check_bounds::<Self>(offset);
14993 fidl::decode!(
14995 PlayerApplicationSettings,
14996 D,
14997 &mut self.current_settings,
14998 decoder,
14999 offset + 0,
15000 _depth
15001 )?;
15002 Ok(())
15003 }
15004 }
15005
15006 impl fidl::encoding::ValueTypeMarker
15007 for TargetHandlerListPlayerApplicationSettingAttributesResponse
15008 {
15009 type Borrowed<'a> = &'a Self;
15010 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15011 value
15012 }
15013 }
15014
15015 unsafe impl fidl::encoding::TypeMarker
15016 for TargetHandlerListPlayerApplicationSettingAttributesResponse
15017 {
15018 type Owned = Self;
15019
15020 #[inline(always)]
15021 fn inline_align(_context: fidl::encoding::Context) -> usize {
15022 8
15023 }
15024
15025 #[inline(always)]
15026 fn inline_size(_context: fidl::encoding::Context) -> usize {
15027 16
15028 }
15029 }
15030
15031 unsafe impl<D: fidl::encoding::ResourceDialect>
15032 fidl::encoding::Encode<TargetHandlerListPlayerApplicationSettingAttributesResponse, D>
15033 for &TargetHandlerListPlayerApplicationSettingAttributesResponse
15034 {
15035 #[inline]
15036 unsafe fn encode(
15037 self,
15038 encoder: &mut fidl::encoding::Encoder<'_, D>,
15039 offset: usize,
15040 _depth: fidl::encoding::Depth,
15041 ) -> fidl::Result<()> {
15042 encoder
15043 .debug_check_bounds::<TargetHandlerListPlayerApplicationSettingAttributesResponse>(
15044 offset,
15045 );
15046 fidl::encoding::Encode::<TargetHandlerListPlayerApplicationSettingAttributesResponse, D>::encode(
15048 (
15049 <fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131> as fidl::encoding::ValueTypeMarker>::borrow(&self.attributes),
15050 ),
15051 encoder, offset, _depth
15052 )
15053 }
15054 }
15055 unsafe impl<
15056 D: fidl::encoding::ResourceDialect,
15057 T0: fidl::encoding::Encode<
15058 fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>,
15059 D,
15060 >,
15061 > fidl::encoding::Encode<TargetHandlerListPlayerApplicationSettingAttributesResponse, D>
15062 for (T0,)
15063 {
15064 #[inline]
15065 unsafe fn encode(
15066 self,
15067 encoder: &mut fidl::encoding::Encoder<'_, D>,
15068 offset: usize,
15069 depth: fidl::encoding::Depth,
15070 ) -> fidl::Result<()> {
15071 encoder
15072 .debug_check_bounds::<TargetHandlerListPlayerApplicationSettingAttributesResponse>(
15073 offset,
15074 );
15075 self.0.encode(encoder, offset + 0, depth)?;
15079 Ok(())
15080 }
15081 }
15082
15083 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
15084 for TargetHandlerListPlayerApplicationSettingAttributesResponse
15085 {
15086 #[inline(always)]
15087 fn new_empty() -> Self {
15088 Self {
15089 attributes: fidl::new_empty!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D),
15090 }
15091 }
15092
15093 #[inline]
15094 unsafe fn decode(
15095 &mut self,
15096 decoder: &mut fidl::encoding::Decoder<'_, D>,
15097 offset: usize,
15098 _depth: fidl::encoding::Depth,
15099 ) -> fidl::Result<()> {
15100 decoder.debug_check_bounds::<Self>(offset);
15101 fidl::decode!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D, &mut self.attributes, decoder, offset + 0, _depth)?;
15103 Ok(())
15104 }
15105 }
15106
15107 impl fidl::encoding::ValueTypeMarker for TargetHandlerSetPlayerApplicationSettingsResponse {
15108 type Borrowed<'a> = &'a Self;
15109 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15110 value
15111 }
15112 }
15113
15114 unsafe impl fidl::encoding::TypeMarker for TargetHandlerSetPlayerApplicationSettingsResponse {
15115 type Owned = Self;
15116
15117 #[inline(always)]
15118 fn inline_align(_context: fidl::encoding::Context) -> usize {
15119 8
15120 }
15121
15122 #[inline(always)]
15123 fn inline_size(_context: fidl::encoding::Context) -> usize {
15124 16
15125 }
15126 }
15127
15128 unsafe impl<D: fidl::encoding::ResourceDialect>
15129 fidl::encoding::Encode<TargetHandlerSetPlayerApplicationSettingsResponse, D>
15130 for &TargetHandlerSetPlayerApplicationSettingsResponse
15131 {
15132 #[inline]
15133 unsafe fn encode(
15134 self,
15135 encoder: &mut fidl::encoding::Encoder<'_, D>,
15136 offset: usize,
15137 _depth: fidl::encoding::Depth,
15138 ) -> fidl::Result<()> {
15139 encoder.debug_check_bounds::<TargetHandlerSetPlayerApplicationSettingsResponse>(offset);
15140 fidl::encoding::Encode::<TargetHandlerSetPlayerApplicationSettingsResponse, D>::encode(
15142 (<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
15143 &self.set_settings,
15144 ),),
15145 encoder,
15146 offset,
15147 _depth,
15148 )
15149 }
15150 }
15151 unsafe impl<
15152 D: fidl::encoding::ResourceDialect,
15153 T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
15154 > fidl::encoding::Encode<TargetHandlerSetPlayerApplicationSettingsResponse, D> for (T0,)
15155 {
15156 #[inline]
15157 unsafe fn encode(
15158 self,
15159 encoder: &mut fidl::encoding::Encoder<'_, D>,
15160 offset: usize,
15161 depth: fidl::encoding::Depth,
15162 ) -> fidl::Result<()> {
15163 encoder.debug_check_bounds::<TargetHandlerSetPlayerApplicationSettingsResponse>(offset);
15164 self.0.encode(encoder, offset + 0, depth)?;
15168 Ok(())
15169 }
15170 }
15171
15172 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
15173 for TargetHandlerSetPlayerApplicationSettingsResponse
15174 {
15175 #[inline(always)]
15176 fn new_empty() -> Self {
15177 Self { set_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
15178 }
15179
15180 #[inline]
15181 unsafe fn decode(
15182 &mut self,
15183 decoder: &mut fidl::encoding::Decoder<'_, D>,
15184 offset: usize,
15185 _depth: fidl::encoding::Depth,
15186 ) -> fidl::Result<()> {
15187 decoder.debug_check_bounds::<Self>(offset);
15188 fidl::decode!(
15190 PlayerApplicationSettings,
15191 D,
15192 &mut self.set_settings,
15193 decoder,
15194 offset + 0,
15195 _depth
15196 )?;
15197 Ok(())
15198 }
15199 }
15200
15201 impl fidl::encoding::ValueTypeMarker for TargetHandlerWatchNotificationResponse {
15202 type Borrowed<'a> = &'a Self;
15203 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15204 value
15205 }
15206 }
15207
15208 unsafe impl fidl::encoding::TypeMarker for TargetHandlerWatchNotificationResponse {
15209 type Owned = Self;
15210
15211 #[inline(always)]
15212 fn inline_align(_context: fidl::encoding::Context) -> usize {
15213 8
15214 }
15215
15216 #[inline(always)]
15217 fn inline_size(_context: fidl::encoding::Context) -> usize {
15218 16
15219 }
15220 }
15221
15222 unsafe impl<D: fidl::encoding::ResourceDialect>
15223 fidl::encoding::Encode<TargetHandlerWatchNotificationResponse, D>
15224 for &TargetHandlerWatchNotificationResponse
15225 {
15226 #[inline]
15227 unsafe fn encode(
15228 self,
15229 encoder: &mut fidl::encoding::Encoder<'_, D>,
15230 offset: usize,
15231 _depth: fidl::encoding::Depth,
15232 ) -> fidl::Result<()> {
15233 encoder.debug_check_bounds::<TargetHandlerWatchNotificationResponse>(offset);
15234 fidl::encoding::Encode::<TargetHandlerWatchNotificationResponse, D>::encode(
15236 (<Notification as fidl::encoding::ValueTypeMarker>::borrow(&self.new_value),),
15237 encoder,
15238 offset,
15239 _depth,
15240 )
15241 }
15242 }
15243 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Notification, D>>
15244 fidl::encoding::Encode<TargetHandlerWatchNotificationResponse, D> for (T0,)
15245 {
15246 #[inline]
15247 unsafe fn encode(
15248 self,
15249 encoder: &mut fidl::encoding::Encoder<'_, D>,
15250 offset: usize,
15251 depth: fidl::encoding::Depth,
15252 ) -> fidl::Result<()> {
15253 encoder.debug_check_bounds::<TargetHandlerWatchNotificationResponse>(offset);
15254 self.0.encode(encoder, offset + 0, depth)?;
15258 Ok(())
15259 }
15260 }
15261
15262 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
15263 for TargetHandlerWatchNotificationResponse
15264 {
15265 #[inline(always)]
15266 fn new_empty() -> Self {
15267 Self { new_value: fidl::new_empty!(Notification, D) }
15268 }
15269
15270 #[inline]
15271 unsafe fn decode(
15272 &mut self,
15273 decoder: &mut fidl::encoding::Decoder<'_, D>,
15274 offset: usize,
15275 _depth: fidl::encoding::Depth,
15276 ) -> fidl::Result<()> {
15277 decoder.debug_check_bounds::<Self>(offset);
15278 fidl::decode!(Notification, D, &mut self.new_value, decoder, offset + 0, _depth)?;
15280 Ok(())
15281 }
15282 }
15283
15284 impl CustomPlayerApplicationSetting {
15285 #[inline(always)]
15286 fn max_ordinal_present(&self) -> u64 {
15287 if let Some(_) = self.current_value {
15288 return 4;
15289 }
15290 if let Some(_) = self.possible_values {
15291 return 3;
15292 }
15293 if let Some(_) = self.attribute_name {
15294 return 2;
15295 }
15296 if let Some(_) = self.attribute_id {
15297 return 1;
15298 }
15299 0
15300 }
15301 }
15302
15303 impl fidl::encoding::ValueTypeMarker for CustomPlayerApplicationSetting {
15304 type Borrowed<'a> = &'a Self;
15305 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15306 value
15307 }
15308 }
15309
15310 unsafe impl fidl::encoding::TypeMarker for CustomPlayerApplicationSetting {
15311 type Owned = Self;
15312
15313 #[inline(always)]
15314 fn inline_align(_context: fidl::encoding::Context) -> usize {
15315 8
15316 }
15317
15318 #[inline(always)]
15319 fn inline_size(_context: fidl::encoding::Context) -> usize {
15320 16
15321 }
15322 }
15323
15324 unsafe impl<D: fidl::encoding::ResourceDialect>
15325 fidl::encoding::Encode<CustomPlayerApplicationSetting, D>
15326 for &CustomPlayerApplicationSetting
15327 {
15328 unsafe fn encode(
15329 self,
15330 encoder: &mut fidl::encoding::Encoder<'_, D>,
15331 offset: usize,
15332 mut depth: fidl::encoding::Depth,
15333 ) -> fidl::Result<()> {
15334 encoder.debug_check_bounds::<CustomPlayerApplicationSetting>(offset);
15335 let max_ordinal: u64 = self.max_ordinal_present();
15337 encoder.write_num(max_ordinal, offset);
15338 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15339 if max_ordinal == 0 {
15341 return Ok(());
15342 }
15343 depth.increment()?;
15344 let envelope_size = 8;
15345 let bytes_len = max_ordinal as usize * envelope_size;
15346 #[allow(unused_variables)]
15347 let offset = encoder.out_of_line_offset(bytes_len);
15348 let mut _prev_end_offset: usize = 0;
15349 if 1 > max_ordinal {
15350 return Ok(());
15351 }
15352
15353 let cur_offset: usize = (1 - 1) * envelope_size;
15356
15357 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15359
15360 fidl::encoding::encode_in_envelope_optional::<u8, D>(
15365 self.attribute_id.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
15366 encoder,
15367 offset + cur_offset,
15368 depth,
15369 )?;
15370
15371 _prev_end_offset = cur_offset + envelope_size;
15372 if 2 > max_ordinal {
15373 return Ok(());
15374 }
15375
15376 let cur_offset: usize = (2 - 1) * envelope_size;
15379
15380 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15382
15383 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
15388 self.attribute_name.as_ref().map(
15389 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
15390 ),
15391 encoder,
15392 offset + cur_offset,
15393 depth,
15394 )?;
15395
15396 _prev_end_offset = cur_offset + envelope_size;
15397 if 3 > max_ordinal {
15398 return Ok(());
15399 }
15400
15401 let cur_offset: usize = (3 - 1) * envelope_size;
15404
15405 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15407
15408 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<CustomAttributeValue, 255>, D>(
15413 self.possible_values.as_ref().map(<fidl::encoding::Vector<CustomAttributeValue, 255> as fidl::encoding::ValueTypeMarker>::borrow),
15414 encoder, offset + cur_offset, depth
15415 )?;
15416
15417 _prev_end_offset = cur_offset + envelope_size;
15418 if 4 > max_ordinal {
15419 return Ok(());
15420 }
15421
15422 let cur_offset: usize = (4 - 1) * envelope_size;
15425
15426 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15428
15429 fidl::encoding::encode_in_envelope_optional::<u8, D>(
15434 self.current_value.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
15435 encoder,
15436 offset + cur_offset,
15437 depth,
15438 )?;
15439
15440 _prev_end_offset = cur_offset + envelope_size;
15441
15442 Ok(())
15443 }
15444 }
15445
15446 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
15447 for CustomPlayerApplicationSetting
15448 {
15449 #[inline(always)]
15450 fn new_empty() -> Self {
15451 Self::default()
15452 }
15453
15454 unsafe fn decode(
15455 &mut self,
15456 decoder: &mut fidl::encoding::Decoder<'_, D>,
15457 offset: usize,
15458 mut depth: fidl::encoding::Depth,
15459 ) -> fidl::Result<()> {
15460 decoder.debug_check_bounds::<Self>(offset);
15461 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15462 None => return Err(fidl::Error::NotNullable),
15463 Some(len) => len,
15464 };
15465 if len == 0 {
15467 return Ok(());
15468 };
15469 depth.increment()?;
15470 let envelope_size = 8;
15471 let bytes_len = len * envelope_size;
15472 let offset = decoder.out_of_line_offset(bytes_len)?;
15473 let mut _next_ordinal_to_read = 0;
15475 let mut next_offset = offset;
15476 let end_offset = offset + bytes_len;
15477 _next_ordinal_to_read += 1;
15478 if next_offset >= end_offset {
15479 return Ok(());
15480 }
15481
15482 while _next_ordinal_to_read < 1 {
15484 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15485 _next_ordinal_to_read += 1;
15486 next_offset += envelope_size;
15487 }
15488
15489 let next_out_of_line = decoder.next_out_of_line();
15490 let handles_before = decoder.remaining_handles();
15491 if let Some((inlined, num_bytes, num_handles)) =
15492 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15493 {
15494 let member_inline_size =
15495 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15496 if inlined != (member_inline_size <= 4) {
15497 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15498 }
15499 let inner_offset;
15500 let mut inner_depth = depth.clone();
15501 if inlined {
15502 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15503 inner_offset = next_offset;
15504 } else {
15505 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15506 inner_depth.increment()?;
15507 }
15508 let val_ref = self.attribute_id.get_or_insert_with(|| fidl::new_empty!(u8, D));
15509 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
15510 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15511 {
15512 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15513 }
15514 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15515 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15516 }
15517 }
15518
15519 next_offset += envelope_size;
15520 _next_ordinal_to_read += 1;
15521 if next_offset >= end_offset {
15522 return Ok(());
15523 }
15524
15525 while _next_ordinal_to_read < 2 {
15527 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15528 _next_ordinal_to_read += 1;
15529 next_offset += envelope_size;
15530 }
15531
15532 let next_out_of_line = decoder.next_out_of_line();
15533 let handles_before = decoder.remaining_handles();
15534 if let Some((inlined, num_bytes, num_handles)) =
15535 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15536 {
15537 let member_inline_size =
15538 <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
15539 decoder.context,
15540 );
15541 if inlined != (member_inline_size <= 4) {
15542 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15543 }
15544 let inner_offset;
15545 let mut inner_depth = depth.clone();
15546 if inlined {
15547 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15548 inner_offset = next_offset;
15549 } else {
15550 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15551 inner_depth.increment()?;
15552 }
15553 let val_ref = self
15554 .attribute_name
15555 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
15556 fidl::decode!(
15557 fidl::encoding::BoundedString<255>,
15558 D,
15559 val_ref,
15560 decoder,
15561 inner_offset,
15562 inner_depth
15563 )?;
15564 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15565 {
15566 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15567 }
15568 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15569 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15570 }
15571 }
15572
15573 next_offset += envelope_size;
15574 _next_ordinal_to_read += 1;
15575 if next_offset >= end_offset {
15576 return Ok(());
15577 }
15578
15579 while _next_ordinal_to_read < 3 {
15581 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15582 _next_ordinal_to_read += 1;
15583 next_offset += envelope_size;
15584 }
15585
15586 let next_out_of_line = decoder.next_out_of_line();
15587 let handles_before = decoder.remaining_handles();
15588 if let Some((inlined, num_bytes, num_handles)) =
15589 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15590 {
15591 let member_inline_size = <fidl::encoding::Vector<CustomAttributeValue, 255> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15592 if inlined != (member_inline_size <= 4) {
15593 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15594 }
15595 let inner_offset;
15596 let mut inner_depth = depth.clone();
15597 if inlined {
15598 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15599 inner_offset = next_offset;
15600 } else {
15601 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15602 inner_depth.increment()?;
15603 }
15604 let val_ref = self.possible_values.get_or_insert_with(
15605 || fidl::new_empty!(fidl::encoding::Vector<CustomAttributeValue, 255>, D),
15606 );
15607 fidl::decode!(fidl::encoding::Vector<CustomAttributeValue, 255>, D, val_ref, decoder, inner_offset, inner_depth)?;
15608 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15609 {
15610 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15611 }
15612 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15613 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15614 }
15615 }
15616
15617 next_offset += envelope_size;
15618 _next_ordinal_to_read += 1;
15619 if next_offset >= end_offset {
15620 return Ok(());
15621 }
15622
15623 while _next_ordinal_to_read < 4 {
15625 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15626 _next_ordinal_to_read += 1;
15627 next_offset += envelope_size;
15628 }
15629
15630 let next_out_of_line = decoder.next_out_of_line();
15631 let handles_before = decoder.remaining_handles();
15632 if let Some((inlined, num_bytes, num_handles)) =
15633 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15634 {
15635 let member_inline_size =
15636 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15637 if inlined != (member_inline_size <= 4) {
15638 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15639 }
15640 let inner_offset;
15641 let mut inner_depth = depth.clone();
15642 if inlined {
15643 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15644 inner_offset = next_offset;
15645 } else {
15646 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15647 inner_depth.increment()?;
15648 }
15649 let val_ref = self.current_value.get_or_insert_with(|| fidl::new_empty!(u8, D));
15650 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
15651 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15652 {
15653 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15654 }
15655 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15656 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15657 }
15658 }
15659
15660 next_offset += envelope_size;
15661
15662 while next_offset < end_offset {
15664 _next_ordinal_to_read += 1;
15665 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15666 next_offset += envelope_size;
15667 }
15668
15669 Ok(())
15670 }
15671 }
15672
15673 impl FolderItem {
15674 #[inline(always)]
15675 fn max_ordinal_present(&self) -> u64 {
15676 if let Some(_) = self.displayable_name {
15677 return 4;
15678 }
15679 if let Some(_) = self.is_playable {
15680 return 3;
15681 }
15682 if let Some(_) = self.folder_type {
15683 return 2;
15684 }
15685 if let Some(_) = self.folder_uid {
15686 return 1;
15687 }
15688 0
15689 }
15690 }
15691
15692 impl fidl::encoding::ValueTypeMarker for FolderItem {
15693 type Borrowed<'a> = &'a Self;
15694 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15695 value
15696 }
15697 }
15698
15699 unsafe impl fidl::encoding::TypeMarker for FolderItem {
15700 type Owned = Self;
15701
15702 #[inline(always)]
15703 fn inline_align(_context: fidl::encoding::Context) -> usize {
15704 8
15705 }
15706
15707 #[inline(always)]
15708 fn inline_size(_context: fidl::encoding::Context) -> usize {
15709 16
15710 }
15711 }
15712
15713 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FolderItem, D>
15714 for &FolderItem
15715 {
15716 unsafe fn encode(
15717 self,
15718 encoder: &mut fidl::encoding::Encoder<'_, D>,
15719 offset: usize,
15720 mut depth: fidl::encoding::Depth,
15721 ) -> fidl::Result<()> {
15722 encoder.debug_check_bounds::<FolderItem>(offset);
15723 let max_ordinal: u64 = self.max_ordinal_present();
15725 encoder.write_num(max_ordinal, offset);
15726 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15727 if max_ordinal == 0 {
15729 return Ok(());
15730 }
15731 depth.increment()?;
15732 let envelope_size = 8;
15733 let bytes_len = max_ordinal as usize * envelope_size;
15734 #[allow(unused_variables)]
15735 let offset = encoder.out_of_line_offset(bytes_len);
15736 let mut _prev_end_offset: usize = 0;
15737 if 1 > max_ordinal {
15738 return Ok(());
15739 }
15740
15741 let cur_offset: usize = (1 - 1) * envelope_size;
15744
15745 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15747
15748 fidl::encoding::encode_in_envelope_optional::<u64, D>(
15753 self.folder_uid.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
15754 encoder,
15755 offset + cur_offset,
15756 depth,
15757 )?;
15758
15759 _prev_end_offset = cur_offset + envelope_size;
15760 if 2 > max_ordinal {
15761 return Ok(());
15762 }
15763
15764 let cur_offset: usize = (2 - 1) * envelope_size;
15767
15768 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15770
15771 fidl::encoding::encode_in_envelope_optional::<FolderType, D>(
15776 self.folder_type
15777 .as_ref()
15778 .map(<FolderType as fidl::encoding::ValueTypeMarker>::borrow),
15779 encoder,
15780 offset + cur_offset,
15781 depth,
15782 )?;
15783
15784 _prev_end_offset = cur_offset + envelope_size;
15785 if 3 > max_ordinal {
15786 return Ok(());
15787 }
15788
15789 let cur_offset: usize = (3 - 1) * envelope_size;
15792
15793 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15795
15796 fidl::encoding::encode_in_envelope_optional::<bool, D>(
15801 self.is_playable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
15802 encoder,
15803 offset + cur_offset,
15804 depth,
15805 )?;
15806
15807 _prev_end_offset = cur_offset + envelope_size;
15808 if 4 > max_ordinal {
15809 return Ok(());
15810 }
15811
15812 let cur_offset: usize = (4 - 1) * envelope_size;
15815
15816 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15818
15819 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
15824 self.displayable_name.as_ref().map(
15825 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
15826 ),
15827 encoder,
15828 offset + cur_offset,
15829 depth,
15830 )?;
15831
15832 _prev_end_offset = cur_offset + envelope_size;
15833
15834 Ok(())
15835 }
15836 }
15837
15838 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FolderItem {
15839 #[inline(always)]
15840 fn new_empty() -> Self {
15841 Self::default()
15842 }
15843
15844 unsafe fn decode(
15845 &mut self,
15846 decoder: &mut fidl::encoding::Decoder<'_, D>,
15847 offset: usize,
15848 mut depth: fidl::encoding::Depth,
15849 ) -> fidl::Result<()> {
15850 decoder.debug_check_bounds::<Self>(offset);
15851 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15852 None => return Err(fidl::Error::NotNullable),
15853 Some(len) => len,
15854 };
15855 if len == 0 {
15857 return Ok(());
15858 };
15859 depth.increment()?;
15860 let envelope_size = 8;
15861 let bytes_len = len * envelope_size;
15862 let offset = decoder.out_of_line_offset(bytes_len)?;
15863 let mut _next_ordinal_to_read = 0;
15865 let mut next_offset = offset;
15866 let end_offset = offset + bytes_len;
15867 _next_ordinal_to_read += 1;
15868 if next_offset >= end_offset {
15869 return Ok(());
15870 }
15871
15872 while _next_ordinal_to_read < 1 {
15874 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15875 _next_ordinal_to_read += 1;
15876 next_offset += envelope_size;
15877 }
15878
15879 let next_out_of_line = decoder.next_out_of_line();
15880 let handles_before = decoder.remaining_handles();
15881 if let Some((inlined, num_bytes, num_handles)) =
15882 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15883 {
15884 let member_inline_size =
15885 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15886 if inlined != (member_inline_size <= 4) {
15887 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15888 }
15889 let inner_offset;
15890 let mut inner_depth = depth.clone();
15891 if inlined {
15892 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15893 inner_offset = next_offset;
15894 } else {
15895 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15896 inner_depth.increment()?;
15897 }
15898 let val_ref = self.folder_uid.get_or_insert_with(|| fidl::new_empty!(u64, D));
15899 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
15900 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15901 {
15902 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15903 }
15904 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15905 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15906 }
15907 }
15908
15909 next_offset += envelope_size;
15910 _next_ordinal_to_read += 1;
15911 if next_offset >= end_offset {
15912 return Ok(());
15913 }
15914
15915 while _next_ordinal_to_read < 2 {
15917 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15918 _next_ordinal_to_read += 1;
15919 next_offset += envelope_size;
15920 }
15921
15922 let next_out_of_line = decoder.next_out_of_line();
15923 let handles_before = decoder.remaining_handles();
15924 if let Some((inlined, num_bytes, num_handles)) =
15925 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15926 {
15927 let member_inline_size =
15928 <FolderType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15929 if inlined != (member_inline_size <= 4) {
15930 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15931 }
15932 let inner_offset;
15933 let mut inner_depth = depth.clone();
15934 if inlined {
15935 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15936 inner_offset = next_offset;
15937 } else {
15938 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15939 inner_depth.increment()?;
15940 }
15941 let val_ref =
15942 self.folder_type.get_or_insert_with(|| fidl::new_empty!(FolderType, D));
15943 fidl::decode!(FolderType, D, val_ref, decoder, inner_offset, inner_depth)?;
15944 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15945 {
15946 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15947 }
15948 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15949 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15950 }
15951 }
15952
15953 next_offset += envelope_size;
15954 _next_ordinal_to_read += 1;
15955 if next_offset >= end_offset {
15956 return Ok(());
15957 }
15958
15959 while _next_ordinal_to_read < 3 {
15961 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15962 _next_ordinal_to_read += 1;
15963 next_offset += envelope_size;
15964 }
15965
15966 let next_out_of_line = decoder.next_out_of_line();
15967 let handles_before = decoder.remaining_handles();
15968 if let Some((inlined, num_bytes, num_handles)) =
15969 fidl::encoding::decode_envelope_header(decoder, next_offset)?
15970 {
15971 let member_inline_size =
15972 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15973 if inlined != (member_inline_size <= 4) {
15974 return Err(fidl::Error::InvalidInlineBitInEnvelope);
15975 }
15976 let inner_offset;
15977 let mut inner_depth = depth.clone();
15978 if inlined {
15979 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15980 inner_offset = next_offset;
15981 } else {
15982 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15983 inner_depth.increment()?;
15984 }
15985 let val_ref = self.is_playable.get_or_insert_with(|| fidl::new_empty!(bool, D));
15986 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
15987 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15988 {
15989 return Err(fidl::Error::InvalidNumBytesInEnvelope);
15990 }
15991 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15992 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15993 }
15994 }
15995
15996 next_offset += envelope_size;
15997 _next_ordinal_to_read += 1;
15998 if next_offset >= end_offset {
15999 return Ok(());
16000 }
16001
16002 while _next_ordinal_to_read < 4 {
16004 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16005 _next_ordinal_to_read += 1;
16006 next_offset += envelope_size;
16007 }
16008
16009 let next_out_of_line = decoder.next_out_of_line();
16010 let handles_before = decoder.remaining_handles();
16011 if let Some((inlined, num_bytes, num_handles)) =
16012 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16013 {
16014 let member_inline_size =
16015 <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
16016 decoder.context,
16017 );
16018 if inlined != (member_inline_size <= 4) {
16019 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16020 }
16021 let inner_offset;
16022 let mut inner_depth = depth.clone();
16023 if inlined {
16024 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16025 inner_offset = next_offset;
16026 } else {
16027 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16028 inner_depth.increment()?;
16029 }
16030 let val_ref = self
16031 .displayable_name
16032 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
16033 fidl::decode!(
16034 fidl::encoding::BoundedString<255>,
16035 D,
16036 val_ref,
16037 decoder,
16038 inner_offset,
16039 inner_depth
16040 )?;
16041 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16042 {
16043 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16044 }
16045 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16046 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16047 }
16048 }
16049
16050 next_offset += envelope_size;
16051
16052 while next_offset < end_offset {
16054 _next_ordinal_to_read += 1;
16055 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16056 next_offset += envelope_size;
16057 }
16058
16059 Ok(())
16060 }
16061 }
16062
16063 impl MediaAttributes {
16064 #[inline(always)]
16065 fn max_ordinal_present(&self) -> u64 {
16066 if let Some(_) = self.playing_time {
16067 return 7;
16068 }
16069 if let Some(_) = self.genre {
16070 return 6;
16071 }
16072 if let Some(_) = self.total_number_of_tracks {
16073 return 5;
16074 }
16075 if let Some(_) = self.track_number {
16076 return 4;
16077 }
16078 if let Some(_) = self.album_name {
16079 return 3;
16080 }
16081 if let Some(_) = self.artist_name {
16082 return 2;
16083 }
16084 if let Some(_) = self.title {
16085 return 1;
16086 }
16087 0
16088 }
16089 }
16090
16091 impl fidl::encoding::ValueTypeMarker for MediaAttributes {
16092 type Borrowed<'a> = &'a Self;
16093 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16094 value
16095 }
16096 }
16097
16098 unsafe impl fidl::encoding::TypeMarker for MediaAttributes {
16099 type Owned = Self;
16100
16101 #[inline(always)]
16102 fn inline_align(_context: fidl::encoding::Context) -> usize {
16103 8
16104 }
16105
16106 #[inline(always)]
16107 fn inline_size(_context: fidl::encoding::Context) -> usize {
16108 16
16109 }
16110 }
16111
16112 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MediaAttributes, D>
16113 for &MediaAttributes
16114 {
16115 unsafe fn encode(
16116 self,
16117 encoder: &mut fidl::encoding::Encoder<'_, D>,
16118 offset: usize,
16119 mut depth: fidl::encoding::Depth,
16120 ) -> fidl::Result<()> {
16121 encoder.debug_check_bounds::<MediaAttributes>(offset);
16122 let max_ordinal: u64 = self.max_ordinal_present();
16124 encoder.write_num(max_ordinal, offset);
16125 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16126 if max_ordinal == 0 {
16128 return Ok(());
16129 }
16130 depth.increment()?;
16131 let envelope_size = 8;
16132 let bytes_len = max_ordinal as usize * envelope_size;
16133 #[allow(unused_variables)]
16134 let offset = encoder.out_of_line_offset(bytes_len);
16135 let mut _prev_end_offset: usize = 0;
16136 if 1 > max_ordinal {
16137 return Ok(());
16138 }
16139
16140 let cur_offset: usize = (1 - 1) * envelope_size;
16143
16144 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16146
16147 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
16152 self.title.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
16153 encoder, offset + cur_offset, depth
16154 )?;
16155
16156 _prev_end_offset = cur_offset + envelope_size;
16157 if 2 > max_ordinal {
16158 return Ok(());
16159 }
16160
16161 let cur_offset: usize = (2 - 1) * envelope_size;
16164
16165 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16167
16168 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
16173 self.artist_name.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
16174 encoder, offset + cur_offset, depth
16175 )?;
16176
16177 _prev_end_offset = cur_offset + envelope_size;
16178 if 3 > max_ordinal {
16179 return Ok(());
16180 }
16181
16182 let cur_offset: usize = (3 - 1) * envelope_size;
16185
16186 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16188
16189 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
16194 self.album_name.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
16195 encoder, offset + cur_offset, depth
16196 )?;
16197
16198 _prev_end_offset = cur_offset + envelope_size;
16199 if 4 > max_ordinal {
16200 return Ok(());
16201 }
16202
16203 let cur_offset: usize = (4 - 1) * envelope_size;
16206
16207 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16209
16210 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
16215 self.track_number.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
16216 encoder, offset + cur_offset, depth
16217 )?;
16218
16219 _prev_end_offset = cur_offset + envelope_size;
16220 if 5 > max_ordinal {
16221 return Ok(());
16222 }
16223
16224 let cur_offset: usize = (5 - 1) * envelope_size;
16227
16228 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16230
16231 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
16236 self.total_number_of_tracks.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
16237 encoder, offset + cur_offset, depth
16238 )?;
16239
16240 _prev_end_offset = cur_offset + envelope_size;
16241 if 6 > max_ordinal {
16242 return Ok(());
16243 }
16244
16245 let cur_offset: usize = (6 - 1) * envelope_size;
16248
16249 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16251
16252 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
16257 self.genre.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
16258 encoder, offset + cur_offset, depth
16259 )?;
16260
16261 _prev_end_offset = cur_offset + envelope_size;
16262 if 7 > max_ordinal {
16263 return Ok(());
16264 }
16265
16266 let cur_offset: usize = (7 - 1) * envelope_size;
16269
16270 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16272
16273 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
16278 self.playing_time.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
16279 encoder, offset + cur_offset, depth
16280 )?;
16281
16282 _prev_end_offset = cur_offset + envelope_size;
16283
16284 Ok(())
16285 }
16286 }
16287
16288 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MediaAttributes {
16289 #[inline(always)]
16290 fn new_empty() -> Self {
16291 Self::default()
16292 }
16293
16294 unsafe fn decode(
16295 &mut self,
16296 decoder: &mut fidl::encoding::Decoder<'_, D>,
16297 offset: usize,
16298 mut depth: fidl::encoding::Depth,
16299 ) -> fidl::Result<()> {
16300 decoder.debug_check_bounds::<Self>(offset);
16301 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16302 None => return Err(fidl::Error::NotNullable),
16303 Some(len) => len,
16304 };
16305 if len == 0 {
16307 return Ok(());
16308 };
16309 depth.increment()?;
16310 let envelope_size = 8;
16311 let bytes_len = len * envelope_size;
16312 let offset = decoder.out_of_line_offset(bytes_len)?;
16313 let mut _next_ordinal_to_read = 0;
16315 let mut next_offset = offset;
16316 let end_offset = offset + bytes_len;
16317 _next_ordinal_to_read += 1;
16318 if next_offset >= end_offset {
16319 return Ok(());
16320 }
16321
16322 while _next_ordinal_to_read < 1 {
16324 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16325 _next_ordinal_to_read += 1;
16326 next_offset += envelope_size;
16327 }
16328
16329 let next_out_of_line = decoder.next_out_of_line();
16330 let handles_before = decoder.remaining_handles();
16331 if let Some((inlined, num_bytes, num_handles)) =
16332 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16333 {
16334 let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16335 if inlined != (member_inline_size <= 4) {
16336 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16337 }
16338 let inner_offset;
16339 let mut inner_depth = depth.clone();
16340 if inlined {
16341 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16342 inner_offset = next_offset;
16343 } else {
16344 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16345 inner_depth.increment()?;
16346 }
16347 let val_ref = self.title.get_or_insert_with(|| {
16348 fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
16349 });
16350 fidl::decode!(
16351 fidl::encoding::BoundedString<65535>,
16352 D,
16353 val_ref,
16354 decoder,
16355 inner_offset,
16356 inner_depth
16357 )?;
16358 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16359 {
16360 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16361 }
16362 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16363 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16364 }
16365 }
16366
16367 next_offset += envelope_size;
16368 _next_ordinal_to_read += 1;
16369 if next_offset >= end_offset {
16370 return Ok(());
16371 }
16372
16373 while _next_ordinal_to_read < 2 {
16375 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16376 _next_ordinal_to_read += 1;
16377 next_offset += envelope_size;
16378 }
16379
16380 let next_out_of_line = decoder.next_out_of_line();
16381 let handles_before = decoder.remaining_handles();
16382 if let Some((inlined, num_bytes, num_handles)) =
16383 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16384 {
16385 let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16386 if inlined != (member_inline_size <= 4) {
16387 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16388 }
16389 let inner_offset;
16390 let mut inner_depth = depth.clone();
16391 if inlined {
16392 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16393 inner_offset = next_offset;
16394 } else {
16395 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16396 inner_depth.increment()?;
16397 }
16398 let val_ref = self.artist_name.get_or_insert_with(|| {
16399 fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
16400 });
16401 fidl::decode!(
16402 fidl::encoding::BoundedString<65535>,
16403 D,
16404 val_ref,
16405 decoder,
16406 inner_offset,
16407 inner_depth
16408 )?;
16409 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16410 {
16411 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16412 }
16413 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16414 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16415 }
16416 }
16417
16418 next_offset += envelope_size;
16419 _next_ordinal_to_read += 1;
16420 if next_offset >= end_offset {
16421 return Ok(());
16422 }
16423
16424 while _next_ordinal_to_read < 3 {
16426 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16427 _next_ordinal_to_read += 1;
16428 next_offset += envelope_size;
16429 }
16430
16431 let next_out_of_line = decoder.next_out_of_line();
16432 let handles_before = decoder.remaining_handles();
16433 if let Some((inlined, num_bytes, num_handles)) =
16434 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16435 {
16436 let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16437 if inlined != (member_inline_size <= 4) {
16438 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16439 }
16440 let inner_offset;
16441 let mut inner_depth = depth.clone();
16442 if inlined {
16443 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16444 inner_offset = next_offset;
16445 } else {
16446 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16447 inner_depth.increment()?;
16448 }
16449 let val_ref = self.album_name.get_or_insert_with(|| {
16450 fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
16451 });
16452 fidl::decode!(
16453 fidl::encoding::BoundedString<65535>,
16454 D,
16455 val_ref,
16456 decoder,
16457 inner_offset,
16458 inner_depth
16459 )?;
16460 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16461 {
16462 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16463 }
16464 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16465 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16466 }
16467 }
16468
16469 next_offset += envelope_size;
16470 _next_ordinal_to_read += 1;
16471 if next_offset >= end_offset {
16472 return Ok(());
16473 }
16474
16475 while _next_ordinal_to_read < 4 {
16477 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16478 _next_ordinal_to_read += 1;
16479 next_offset += envelope_size;
16480 }
16481
16482 let next_out_of_line = decoder.next_out_of_line();
16483 let handles_before = decoder.remaining_handles();
16484 if let Some((inlined, num_bytes, num_handles)) =
16485 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16486 {
16487 let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16488 if inlined != (member_inline_size <= 4) {
16489 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16490 }
16491 let inner_offset;
16492 let mut inner_depth = depth.clone();
16493 if inlined {
16494 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16495 inner_offset = next_offset;
16496 } else {
16497 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16498 inner_depth.increment()?;
16499 }
16500 let val_ref = self.track_number.get_or_insert_with(|| {
16501 fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
16502 });
16503 fidl::decode!(
16504 fidl::encoding::BoundedString<65535>,
16505 D,
16506 val_ref,
16507 decoder,
16508 inner_offset,
16509 inner_depth
16510 )?;
16511 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16512 {
16513 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16514 }
16515 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16516 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16517 }
16518 }
16519
16520 next_offset += envelope_size;
16521 _next_ordinal_to_read += 1;
16522 if next_offset >= end_offset {
16523 return Ok(());
16524 }
16525
16526 while _next_ordinal_to_read < 5 {
16528 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16529 _next_ordinal_to_read += 1;
16530 next_offset += envelope_size;
16531 }
16532
16533 let next_out_of_line = decoder.next_out_of_line();
16534 let handles_before = decoder.remaining_handles();
16535 if let Some((inlined, num_bytes, num_handles)) =
16536 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16537 {
16538 let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16539 if inlined != (member_inline_size <= 4) {
16540 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16541 }
16542 let inner_offset;
16543 let mut inner_depth = depth.clone();
16544 if inlined {
16545 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16546 inner_offset = next_offset;
16547 } else {
16548 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16549 inner_depth.increment()?;
16550 }
16551 let val_ref = self.total_number_of_tracks.get_or_insert_with(|| {
16552 fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
16553 });
16554 fidl::decode!(
16555 fidl::encoding::BoundedString<65535>,
16556 D,
16557 val_ref,
16558 decoder,
16559 inner_offset,
16560 inner_depth
16561 )?;
16562 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16563 {
16564 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16565 }
16566 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16567 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16568 }
16569 }
16570
16571 next_offset += envelope_size;
16572 _next_ordinal_to_read += 1;
16573 if next_offset >= end_offset {
16574 return Ok(());
16575 }
16576
16577 while _next_ordinal_to_read < 6 {
16579 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16580 _next_ordinal_to_read += 1;
16581 next_offset += envelope_size;
16582 }
16583
16584 let next_out_of_line = decoder.next_out_of_line();
16585 let handles_before = decoder.remaining_handles();
16586 if let Some((inlined, num_bytes, num_handles)) =
16587 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16588 {
16589 let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16590 if inlined != (member_inline_size <= 4) {
16591 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16592 }
16593 let inner_offset;
16594 let mut inner_depth = depth.clone();
16595 if inlined {
16596 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16597 inner_offset = next_offset;
16598 } else {
16599 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16600 inner_depth.increment()?;
16601 }
16602 let val_ref = self.genre.get_or_insert_with(|| {
16603 fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
16604 });
16605 fidl::decode!(
16606 fidl::encoding::BoundedString<65535>,
16607 D,
16608 val_ref,
16609 decoder,
16610 inner_offset,
16611 inner_depth
16612 )?;
16613 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16614 {
16615 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16616 }
16617 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16618 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16619 }
16620 }
16621
16622 next_offset += envelope_size;
16623 _next_ordinal_to_read += 1;
16624 if next_offset >= end_offset {
16625 return Ok(());
16626 }
16627
16628 while _next_ordinal_to_read < 7 {
16630 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16631 _next_ordinal_to_read += 1;
16632 next_offset += envelope_size;
16633 }
16634
16635 let next_out_of_line = decoder.next_out_of_line();
16636 let handles_before = decoder.remaining_handles();
16637 if let Some((inlined, num_bytes, num_handles)) =
16638 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16639 {
16640 let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16641 if inlined != (member_inline_size <= 4) {
16642 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16643 }
16644 let inner_offset;
16645 let mut inner_depth = depth.clone();
16646 if inlined {
16647 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16648 inner_offset = next_offset;
16649 } else {
16650 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16651 inner_depth.increment()?;
16652 }
16653 let val_ref = self.playing_time.get_or_insert_with(|| {
16654 fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
16655 });
16656 fidl::decode!(
16657 fidl::encoding::BoundedString<65535>,
16658 D,
16659 val_ref,
16660 decoder,
16661 inner_offset,
16662 inner_depth
16663 )?;
16664 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16665 {
16666 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16667 }
16668 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16669 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16670 }
16671 }
16672
16673 next_offset += envelope_size;
16674
16675 while next_offset < end_offset {
16677 _next_ordinal_to_read += 1;
16678 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16679 next_offset += envelope_size;
16680 }
16681
16682 Ok(())
16683 }
16684 }
16685
16686 impl MediaElementItem {
16687 #[inline(always)]
16688 fn max_ordinal_present(&self) -> u64 {
16689 if let Some(_) = self.attributes {
16690 return 4;
16691 }
16692 if let Some(_) = self.displayable_name {
16693 return 3;
16694 }
16695 if let Some(_) = self.media_type {
16696 return 2;
16697 }
16698 if let Some(_) = self.media_element_uid {
16699 return 1;
16700 }
16701 0
16702 }
16703 }
16704
16705 impl fidl::encoding::ValueTypeMarker for MediaElementItem {
16706 type Borrowed<'a> = &'a Self;
16707 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16708 value
16709 }
16710 }
16711
16712 unsafe impl fidl::encoding::TypeMarker for MediaElementItem {
16713 type Owned = Self;
16714
16715 #[inline(always)]
16716 fn inline_align(_context: fidl::encoding::Context) -> usize {
16717 8
16718 }
16719
16720 #[inline(always)]
16721 fn inline_size(_context: fidl::encoding::Context) -> usize {
16722 16
16723 }
16724 }
16725
16726 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MediaElementItem, D>
16727 for &MediaElementItem
16728 {
16729 unsafe fn encode(
16730 self,
16731 encoder: &mut fidl::encoding::Encoder<'_, D>,
16732 offset: usize,
16733 mut depth: fidl::encoding::Depth,
16734 ) -> fidl::Result<()> {
16735 encoder.debug_check_bounds::<MediaElementItem>(offset);
16736 let max_ordinal: u64 = self.max_ordinal_present();
16738 encoder.write_num(max_ordinal, offset);
16739 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16740 if max_ordinal == 0 {
16742 return Ok(());
16743 }
16744 depth.increment()?;
16745 let envelope_size = 8;
16746 let bytes_len = max_ordinal as usize * envelope_size;
16747 #[allow(unused_variables)]
16748 let offset = encoder.out_of_line_offset(bytes_len);
16749 let mut _prev_end_offset: usize = 0;
16750 if 1 > max_ordinal {
16751 return Ok(());
16752 }
16753
16754 let cur_offset: usize = (1 - 1) * envelope_size;
16757
16758 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16760
16761 fidl::encoding::encode_in_envelope_optional::<u64, D>(
16766 self.media_element_uid
16767 .as_ref()
16768 .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
16769 encoder,
16770 offset + cur_offset,
16771 depth,
16772 )?;
16773
16774 _prev_end_offset = cur_offset + envelope_size;
16775 if 2 > max_ordinal {
16776 return Ok(());
16777 }
16778
16779 let cur_offset: usize = (2 - 1) * envelope_size;
16782
16783 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16785
16786 fidl::encoding::encode_in_envelope_optional::<MediaType, D>(
16791 self.media_type
16792 .as_ref()
16793 .map(<MediaType as fidl::encoding::ValueTypeMarker>::borrow),
16794 encoder,
16795 offset + cur_offset,
16796 depth,
16797 )?;
16798
16799 _prev_end_offset = cur_offset + envelope_size;
16800 if 3 > max_ordinal {
16801 return Ok(());
16802 }
16803
16804 let cur_offset: usize = (3 - 1) * envelope_size;
16807
16808 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16810
16811 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
16816 self.displayable_name.as_ref().map(
16817 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
16818 ),
16819 encoder,
16820 offset + cur_offset,
16821 depth,
16822 )?;
16823
16824 _prev_end_offset = cur_offset + envelope_size;
16825 if 4 > max_ordinal {
16826 return Ok(());
16827 }
16828
16829 let cur_offset: usize = (4 - 1) * envelope_size;
16832
16833 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16835
16836 fidl::encoding::encode_in_envelope_optional::<MediaAttributes, D>(
16841 self.attributes
16842 .as_ref()
16843 .map(<MediaAttributes as fidl::encoding::ValueTypeMarker>::borrow),
16844 encoder,
16845 offset + cur_offset,
16846 depth,
16847 )?;
16848
16849 _prev_end_offset = cur_offset + envelope_size;
16850
16851 Ok(())
16852 }
16853 }
16854
16855 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MediaElementItem {
16856 #[inline(always)]
16857 fn new_empty() -> Self {
16858 Self::default()
16859 }
16860
16861 unsafe fn decode(
16862 &mut self,
16863 decoder: &mut fidl::encoding::Decoder<'_, D>,
16864 offset: usize,
16865 mut depth: fidl::encoding::Depth,
16866 ) -> fidl::Result<()> {
16867 decoder.debug_check_bounds::<Self>(offset);
16868 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16869 None => return Err(fidl::Error::NotNullable),
16870 Some(len) => len,
16871 };
16872 if len == 0 {
16874 return Ok(());
16875 };
16876 depth.increment()?;
16877 let envelope_size = 8;
16878 let bytes_len = len * envelope_size;
16879 let offset = decoder.out_of_line_offset(bytes_len)?;
16880 let mut _next_ordinal_to_read = 0;
16882 let mut next_offset = offset;
16883 let end_offset = offset + bytes_len;
16884 _next_ordinal_to_read += 1;
16885 if next_offset >= end_offset {
16886 return Ok(());
16887 }
16888
16889 while _next_ordinal_to_read < 1 {
16891 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16892 _next_ordinal_to_read += 1;
16893 next_offset += envelope_size;
16894 }
16895
16896 let next_out_of_line = decoder.next_out_of_line();
16897 let handles_before = decoder.remaining_handles();
16898 if let Some((inlined, num_bytes, num_handles)) =
16899 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16900 {
16901 let member_inline_size =
16902 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16903 if inlined != (member_inline_size <= 4) {
16904 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16905 }
16906 let inner_offset;
16907 let mut inner_depth = depth.clone();
16908 if inlined {
16909 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16910 inner_offset = next_offset;
16911 } else {
16912 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16913 inner_depth.increment()?;
16914 }
16915 let val_ref =
16916 self.media_element_uid.get_or_insert_with(|| fidl::new_empty!(u64, D));
16917 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
16918 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16919 {
16920 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16921 }
16922 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16923 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16924 }
16925 }
16926
16927 next_offset += envelope_size;
16928 _next_ordinal_to_read += 1;
16929 if next_offset >= end_offset {
16930 return Ok(());
16931 }
16932
16933 while _next_ordinal_to_read < 2 {
16935 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16936 _next_ordinal_to_read += 1;
16937 next_offset += envelope_size;
16938 }
16939
16940 let next_out_of_line = decoder.next_out_of_line();
16941 let handles_before = decoder.remaining_handles();
16942 if let Some((inlined, num_bytes, num_handles)) =
16943 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16944 {
16945 let member_inline_size =
16946 <MediaType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16947 if inlined != (member_inline_size <= 4) {
16948 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16949 }
16950 let inner_offset;
16951 let mut inner_depth = depth.clone();
16952 if inlined {
16953 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16954 inner_offset = next_offset;
16955 } else {
16956 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16957 inner_depth.increment()?;
16958 }
16959 let val_ref = self.media_type.get_or_insert_with(|| fidl::new_empty!(MediaType, D));
16960 fidl::decode!(MediaType, D, val_ref, decoder, inner_offset, inner_depth)?;
16961 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16962 {
16963 return Err(fidl::Error::InvalidNumBytesInEnvelope);
16964 }
16965 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16966 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16967 }
16968 }
16969
16970 next_offset += envelope_size;
16971 _next_ordinal_to_read += 1;
16972 if next_offset >= end_offset {
16973 return Ok(());
16974 }
16975
16976 while _next_ordinal_to_read < 3 {
16978 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16979 _next_ordinal_to_read += 1;
16980 next_offset += envelope_size;
16981 }
16982
16983 let next_out_of_line = decoder.next_out_of_line();
16984 let handles_before = decoder.remaining_handles();
16985 if let Some((inlined, num_bytes, num_handles)) =
16986 fidl::encoding::decode_envelope_header(decoder, next_offset)?
16987 {
16988 let member_inline_size =
16989 <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
16990 decoder.context,
16991 );
16992 if inlined != (member_inline_size <= 4) {
16993 return Err(fidl::Error::InvalidInlineBitInEnvelope);
16994 }
16995 let inner_offset;
16996 let mut inner_depth = depth.clone();
16997 if inlined {
16998 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16999 inner_offset = next_offset;
17000 } else {
17001 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17002 inner_depth.increment()?;
17003 }
17004 let val_ref = self
17005 .displayable_name
17006 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
17007 fidl::decode!(
17008 fidl::encoding::BoundedString<255>,
17009 D,
17010 val_ref,
17011 decoder,
17012 inner_offset,
17013 inner_depth
17014 )?;
17015 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17016 {
17017 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17018 }
17019 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17020 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17021 }
17022 }
17023
17024 next_offset += envelope_size;
17025 _next_ordinal_to_read += 1;
17026 if next_offset >= end_offset {
17027 return Ok(());
17028 }
17029
17030 while _next_ordinal_to_read < 4 {
17032 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17033 _next_ordinal_to_read += 1;
17034 next_offset += envelope_size;
17035 }
17036
17037 let next_out_of_line = decoder.next_out_of_line();
17038 let handles_before = decoder.remaining_handles();
17039 if let Some((inlined, num_bytes, num_handles)) =
17040 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17041 {
17042 let member_inline_size =
17043 <MediaAttributes as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17044 if inlined != (member_inline_size <= 4) {
17045 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17046 }
17047 let inner_offset;
17048 let mut inner_depth = depth.clone();
17049 if inlined {
17050 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17051 inner_offset = next_offset;
17052 } else {
17053 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17054 inner_depth.increment()?;
17055 }
17056 let val_ref =
17057 self.attributes.get_or_insert_with(|| fidl::new_empty!(MediaAttributes, D));
17058 fidl::decode!(MediaAttributes, D, val_ref, decoder, inner_offset, inner_depth)?;
17059 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17060 {
17061 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17062 }
17063 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17064 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17065 }
17066 }
17067
17068 next_offset += envelope_size;
17069
17070 while next_offset < end_offset {
17072 _next_ordinal_to_read += 1;
17073 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17074 next_offset += envelope_size;
17075 }
17076
17077 Ok(())
17078 }
17079 }
17080
17081 impl MediaPlayerItem {
17082 #[inline(always)]
17083 fn max_ordinal_present(&self) -> u64 {
17084 if let Some(_) = self.feature_bits_ext {
17085 return 7;
17086 }
17087 if let Some(_) = self.feature_bits {
17088 return 6;
17089 }
17090 if let Some(_) = self.displayable_name {
17091 return 5;
17092 }
17093 if let Some(_) = self.playback_status {
17094 return 4;
17095 }
17096 if let Some(_) = self.sub_type {
17097 return 3;
17098 }
17099 if let Some(_) = self.major_type {
17100 return 2;
17101 }
17102 if let Some(_) = self.player_id {
17103 return 1;
17104 }
17105 0
17106 }
17107 }
17108
17109 impl fidl::encoding::ValueTypeMarker for MediaPlayerItem {
17110 type Borrowed<'a> = &'a Self;
17111 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17112 value
17113 }
17114 }
17115
17116 unsafe impl fidl::encoding::TypeMarker for MediaPlayerItem {
17117 type Owned = Self;
17118
17119 #[inline(always)]
17120 fn inline_align(_context: fidl::encoding::Context) -> usize {
17121 8
17122 }
17123
17124 #[inline(always)]
17125 fn inline_size(_context: fidl::encoding::Context) -> usize {
17126 16
17127 }
17128 }
17129
17130 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MediaPlayerItem, D>
17131 for &MediaPlayerItem
17132 {
17133 unsafe fn encode(
17134 self,
17135 encoder: &mut fidl::encoding::Encoder<'_, D>,
17136 offset: usize,
17137 mut depth: fidl::encoding::Depth,
17138 ) -> fidl::Result<()> {
17139 encoder.debug_check_bounds::<MediaPlayerItem>(offset);
17140 let max_ordinal: u64 = self.max_ordinal_present();
17142 encoder.write_num(max_ordinal, offset);
17143 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17144 if max_ordinal == 0 {
17146 return Ok(());
17147 }
17148 depth.increment()?;
17149 let envelope_size = 8;
17150 let bytes_len = max_ordinal as usize * envelope_size;
17151 #[allow(unused_variables)]
17152 let offset = encoder.out_of_line_offset(bytes_len);
17153 let mut _prev_end_offset: usize = 0;
17154 if 1 > max_ordinal {
17155 return Ok(());
17156 }
17157
17158 let cur_offset: usize = (1 - 1) * envelope_size;
17161
17162 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17164
17165 fidl::encoding::encode_in_envelope_optional::<u16, D>(
17170 self.player_id.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
17171 encoder,
17172 offset + cur_offset,
17173 depth,
17174 )?;
17175
17176 _prev_end_offset = cur_offset + envelope_size;
17177 if 2 > max_ordinal {
17178 return Ok(());
17179 }
17180
17181 let cur_offset: usize = (2 - 1) * envelope_size;
17184
17185 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17187
17188 fidl::encoding::encode_in_envelope_optional::<MajorPlayerType, D>(
17193 self.major_type
17194 .as_ref()
17195 .map(<MajorPlayerType as fidl::encoding::ValueTypeMarker>::borrow),
17196 encoder,
17197 offset + cur_offset,
17198 depth,
17199 )?;
17200
17201 _prev_end_offset = cur_offset + envelope_size;
17202 if 3 > max_ordinal {
17203 return Ok(());
17204 }
17205
17206 let cur_offset: usize = (3 - 1) * envelope_size;
17209
17210 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17212
17213 fidl::encoding::encode_in_envelope_optional::<PlayerSubType, D>(
17218 self.sub_type
17219 .as_ref()
17220 .map(<PlayerSubType as fidl::encoding::ValueTypeMarker>::borrow),
17221 encoder,
17222 offset + cur_offset,
17223 depth,
17224 )?;
17225
17226 _prev_end_offset = cur_offset + envelope_size;
17227 if 4 > max_ordinal {
17228 return Ok(());
17229 }
17230
17231 let cur_offset: usize = (4 - 1) * envelope_size;
17234
17235 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17237
17238 fidl::encoding::encode_in_envelope_optional::<PlaybackStatus, D>(
17243 self.playback_status
17244 .as_ref()
17245 .map(<PlaybackStatus as fidl::encoding::ValueTypeMarker>::borrow),
17246 encoder,
17247 offset + cur_offset,
17248 depth,
17249 )?;
17250
17251 _prev_end_offset = cur_offset + envelope_size;
17252 if 5 > max_ordinal {
17253 return Ok(());
17254 }
17255
17256 let cur_offset: usize = (5 - 1) * envelope_size;
17259
17260 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17262
17263 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
17268 self.displayable_name.as_ref().map(
17269 <fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
17270 ),
17271 encoder,
17272 offset + cur_offset,
17273 depth,
17274 )?;
17275
17276 _prev_end_offset = cur_offset + envelope_size;
17277 if 6 > max_ordinal {
17278 return Ok(());
17279 }
17280
17281 let cur_offset: usize = (6 - 1) * envelope_size;
17284
17285 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17287
17288 fidl::encoding::encode_in_envelope_optional::<PlayerFeatureBits, D>(
17293 self.feature_bits
17294 .as_ref()
17295 .map(<PlayerFeatureBits as fidl::encoding::ValueTypeMarker>::borrow),
17296 encoder,
17297 offset + cur_offset,
17298 depth,
17299 )?;
17300
17301 _prev_end_offset = cur_offset + envelope_size;
17302 if 7 > max_ordinal {
17303 return Ok(());
17304 }
17305
17306 let cur_offset: usize = (7 - 1) * envelope_size;
17309
17310 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17312
17313 fidl::encoding::encode_in_envelope_optional::<PlayerFeatureBitsExt, D>(
17318 self.feature_bits_ext
17319 .as_ref()
17320 .map(<PlayerFeatureBitsExt as fidl::encoding::ValueTypeMarker>::borrow),
17321 encoder,
17322 offset + cur_offset,
17323 depth,
17324 )?;
17325
17326 _prev_end_offset = cur_offset + envelope_size;
17327
17328 Ok(())
17329 }
17330 }
17331
17332 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MediaPlayerItem {
17333 #[inline(always)]
17334 fn new_empty() -> Self {
17335 Self::default()
17336 }
17337
17338 unsafe fn decode(
17339 &mut self,
17340 decoder: &mut fidl::encoding::Decoder<'_, D>,
17341 offset: usize,
17342 mut depth: fidl::encoding::Depth,
17343 ) -> fidl::Result<()> {
17344 decoder.debug_check_bounds::<Self>(offset);
17345 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17346 None => return Err(fidl::Error::NotNullable),
17347 Some(len) => len,
17348 };
17349 if len == 0 {
17351 return Ok(());
17352 };
17353 depth.increment()?;
17354 let envelope_size = 8;
17355 let bytes_len = len * envelope_size;
17356 let offset = decoder.out_of_line_offset(bytes_len)?;
17357 let mut _next_ordinal_to_read = 0;
17359 let mut next_offset = offset;
17360 let end_offset = offset + bytes_len;
17361 _next_ordinal_to_read += 1;
17362 if next_offset >= end_offset {
17363 return Ok(());
17364 }
17365
17366 while _next_ordinal_to_read < 1 {
17368 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17369 _next_ordinal_to_read += 1;
17370 next_offset += envelope_size;
17371 }
17372
17373 let next_out_of_line = decoder.next_out_of_line();
17374 let handles_before = decoder.remaining_handles();
17375 if let Some((inlined, num_bytes, num_handles)) =
17376 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17377 {
17378 let member_inline_size =
17379 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17380 if inlined != (member_inline_size <= 4) {
17381 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17382 }
17383 let inner_offset;
17384 let mut inner_depth = depth.clone();
17385 if inlined {
17386 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17387 inner_offset = next_offset;
17388 } else {
17389 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17390 inner_depth.increment()?;
17391 }
17392 let val_ref = self.player_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
17393 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
17394 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17395 {
17396 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17397 }
17398 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17399 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17400 }
17401 }
17402
17403 next_offset += envelope_size;
17404 _next_ordinal_to_read += 1;
17405 if next_offset >= end_offset {
17406 return Ok(());
17407 }
17408
17409 while _next_ordinal_to_read < 2 {
17411 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17412 _next_ordinal_to_read += 1;
17413 next_offset += envelope_size;
17414 }
17415
17416 let next_out_of_line = decoder.next_out_of_line();
17417 let handles_before = decoder.remaining_handles();
17418 if let Some((inlined, num_bytes, num_handles)) =
17419 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17420 {
17421 let member_inline_size =
17422 <MajorPlayerType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17423 if inlined != (member_inline_size <= 4) {
17424 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17425 }
17426 let inner_offset;
17427 let mut inner_depth = depth.clone();
17428 if inlined {
17429 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17430 inner_offset = next_offset;
17431 } else {
17432 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17433 inner_depth.increment()?;
17434 }
17435 let val_ref =
17436 self.major_type.get_or_insert_with(|| fidl::new_empty!(MajorPlayerType, D));
17437 fidl::decode!(MajorPlayerType, D, val_ref, decoder, inner_offset, inner_depth)?;
17438 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17439 {
17440 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17441 }
17442 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17443 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17444 }
17445 }
17446
17447 next_offset += envelope_size;
17448 _next_ordinal_to_read += 1;
17449 if next_offset >= end_offset {
17450 return Ok(());
17451 }
17452
17453 while _next_ordinal_to_read < 3 {
17455 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17456 _next_ordinal_to_read += 1;
17457 next_offset += envelope_size;
17458 }
17459
17460 let next_out_of_line = decoder.next_out_of_line();
17461 let handles_before = decoder.remaining_handles();
17462 if let Some((inlined, num_bytes, num_handles)) =
17463 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17464 {
17465 let member_inline_size =
17466 <PlayerSubType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17467 if inlined != (member_inline_size <= 4) {
17468 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17469 }
17470 let inner_offset;
17471 let mut inner_depth = depth.clone();
17472 if inlined {
17473 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17474 inner_offset = next_offset;
17475 } else {
17476 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17477 inner_depth.increment()?;
17478 }
17479 let val_ref =
17480 self.sub_type.get_or_insert_with(|| fidl::new_empty!(PlayerSubType, D));
17481 fidl::decode!(PlayerSubType, D, val_ref, decoder, inner_offset, inner_depth)?;
17482 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17483 {
17484 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17485 }
17486 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17487 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17488 }
17489 }
17490
17491 next_offset += envelope_size;
17492 _next_ordinal_to_read += 1;
17493 if next_offset >= end_offset {
17494 return Ok(());
17495 }
17496
17497 while _next_ordinal_to_read < 4 {
17499 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17500 _next_ordinal_to_read += 1;
17501 next_offset += envelope_size;
17502 }
17503
17504 let next_out_of_line = decoder.next_out_of_line();
17505 let handles_before = decoder.remaining_handles();
17506 if let Some((inlined, num_bytes, num_handles)) =
17507 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17508 {
17509 let member_inline_size =
17510 <PlaybackStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17511 if inlined != (member_inline_size <= 4) {
17512 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17513 }
17514 let inner_offset;
17515 let mut inner_depth = depth.clone();
17516 if inlined {
17517 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17518 inner_offset = next_offset;
17519 } else {
17520 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17521 inner_depth.increment()?;
17522 }
17523 let val_ref =
17524 self.playback_status.get_or_insert_with(|| fidl::new_empty!(PlaybackStatus, D));
17525 fidl::decode!(PlaybackStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
17526 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17527 {
17528 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17529 }
17530 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17531 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17532 }
17533 }
17534
17535 next_offset += envelope_size;
17536 _next_ordinal_to_read += 1;
17537 if next_offset >= end_offset {
17538 return Ok(());
17539 }
17540
17541 while _next_ordinal_to_read < 5 {
17543 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17544 _next_ordinal_to_read += 1;
17545 next_offset += envelope_size;
17546 }
17547
17548 let next_out_of_line = decoder.next_out_of_line();
17549 let handles_before = decoder.remaining_handles();
17550 if let Some((inlined, num_bytes, num_handles)) =
17551 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17552 {
17553 let member_inline_size =
17554 <fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
17555 decoder.context,
17556 );
17557 if inlined != (member_inline_size <= 4) {
17558 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17559 }
17560 let inner_offset;
17561 let mut inner_depth = depth.clone();
17562 if inlined {
17563 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17564 inner_offset = next_offset;
17565 } else {
17566 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17567 inner_depth.increment()?;
17568 }
17569 let val_ref = self
17570 .displayable_name
17571 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
17572 fidl::decode!(
17573 fidl::encoding::BoundedString<255>,
17574 D,
17575 val_ref,
17576 decoder,
17577 inner_offset,
17578 inner_depth
17579 )?;
17580 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17581 {
17582 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17583 }
17584 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17585 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17586 }
17587 }
17588
17589 next_offset += envelope_size;
17590 _next_ordinal_to_read += 1;
17591 if next_offset >= end_offset {
17592 return Ok(());
17593 }
17594
17595 while _next_ordinal_to_read < 6 {
17597 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17598 _next_ordinal_to_read += 1;
17599 next_offset += envelope_size;
17600 }
17601
17602 let next_out_of_line = decoder.next_out_of_line();
17603 let handles_before = decoder.remaining_handles();
17604 if let Some((inlined, num_bytes, num_handles)) =
17605 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17606 {
17607 let member_inline_size =
17608 <PlayerFeatureBits as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17609 if inlined != (member_inline_size <= 4) {
17610 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17611 }
17612 let inner_offset;
17613 let mut inner_depth = depth.clone();
17614 if inlined {
17615 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17616 inner_offset = next_offset;
17617 } else {
17618 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17619 inner_depth.increment()?;
17620 }
17621 let val_ref =
17622 self.feature_bits.get_or_insert_with(|| fidl::new_empty!(PlayerFeatureBits, D));
17623 fidl::decode!(PlayerFeatureBits, D, val_ref, decoder, inner_offset, inner_depth)?;
17624 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17625 {
17626 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17627 }
17628 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17629 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17630 }
17631 }
17632
17633 next_offset += envelope_size;
17634 _next_ordinal_to_read += 1;
17635 if next_offset >= end_offset {
17636 return Ok(());
17637 }
17638
17639 while _next_ordinal_to_read < 7 {
17641 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17642 _next_ordinal_to_read += 1;
17643 next_offset += envelope_size;
17644 }
17645
17646 let next_out_of_line = decoder.next_out_of_line();
17647 let handles_before = decoder.remaining_handles();
17648 if let Some((inlined, num_bytes, num_handles)) =
17649 fidl::encoding::decode_envelope_header(decoder, next_offset)?
17650 {
17651 let member_inline_size =
17652 <PlayerFeatureBitsExt as fidl::encoding::TypeMarker>::inline_size(
17653 decoder.context,
17654 );
17655 if inlined != (member_inline_size <= 4) {
17656 return Err(fidl::Error::InvalidInlineBitInEnvelope);
17657 }
17658 let inner_offset;
17659 let mut inner_depth = depth.clone();
17660 if inlined {
17661 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17662 inner_offset = next_offset;
17663 } else {
17664 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17665 inner_depth.increment()?;
17666 }
17667 let val_ref = self
17668 .feature_bits_ext
17669 .get_or_insert_with(|| fidl::new_empty!(PlayerFeatureBitsExt, D));
17670 fidl::decode!(
17671 PlayerFeatureBitsExt,
17672 D,
17673 val_ref,
17674 decoder,
17675 inner_offset,
17676 inner_depth
17677 )?;
17678 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17679 {
17680 return Err(fidl::Error::InvalidNumBytesInEnvelope);
17681 }
17682 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17683 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17684 }
17685 }
17686
17687 next_offset += envelope_size;
17688
17689 while next_offset < end_offset {
17691 _next_ordinal_to_read += 1;
17692 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17693 next_offset += envelope_size;
17694 }
17695
17696 Ok(())
17697 }
17698 }
17699
17700 impl Notification {
17701 #[inline(always)]
17702 fn max_ordinal_present(&self) -> u64 {
17703 if let Some(_) = self.addressed_player {
17704 return 11;
17705 }
17706 if let Some(_) = self.available_players_changed {
17707 return 10;
17708 }
17709 if let Some(_) = self.device_connected {
17710 return 9;
17711 }
17712 if let Some(_) = self.volume {
17713 return 8;
17714 }
17715 if let Some(_) = self.player_id {
17716 return 7;
17717 }
17718 if let Some(_) = self.application_settings {
17719 return 6;
17720 }
17721 if let Some(_) = self.system_status {
17722 return 5;
17723 }
17724 if let Some(_) = self.battery_status {
17725 return 4;
17726 }
17727 if let Some(_) = self.pos {
17728 return 3;
17729 }
17730 if let Some(_) = self.track_id {
17731 return 2;
17732 }
17733 if let Some(_) = self.status {
17734 return 1;
17735 }
17736 0
17737 }
17738 }
17739
17740 impl fidl::encoding::ValueTypeMarker for Notification {
17741 type Borrowed<'a> = &'a Self;
17742 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17743 value
17744 }
17745 }
17746
17747 unsafe impl fidl::encoding::TypeMarker for Notification {
17748 type Owned = Self;
17749
17750 #[inline(always)]
17751 fn inline_align(_context: fidl::encoding::Context) -> usize {
17752 8
17753 }
17754
17755 #[inline(always)]
17756 fn inline_size(_context: fidl::encoding::Context) -> usize {
17757 16
17758 }
17759 }
17760
17761 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Notification, D>
17762 for &Notification
17763 {
17764 unsafe fn encode(
17765 self,
17766 encoder: &mut fidl::encoding::Encoder<'_, D>,
17767 offset: usize,
17768 mut depth: fidl::encoding::Depth,
17769 ) -> fidl::Result<()> {
17770 encoder.debug_check_bounds::<Notification>(offset);
17771 let max_ordinal: u64 = self.max_ordinal_present();
17773 encoder.write_num(max_ordinal, offset);
17774 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17775 if max_ordinal == 0 {
17777 return Ok(());
17778 }
17779 depth.increment()?;
17780 let envelope_size = 8;
17781 let bytes_len = max_ordinal as usize * envelope_size;
17782 #[allow(unused_variables)]
17783 let offset = encoder.out_of_line_offset(bytes_len);
17784 let mut _prev_end_offset: usize = 0;
17785 if 1 > max_ordinal {
17786 return Ok(());
17787 }
17788
17789 let cur_offset: usize = (1 - 1) * envelope_size;
17792
17793 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17795
17796 fidl::encoding::encode_in_envelope_optional::<PlaybackStatus, D>(
17801 self.status
17802 .as_ref()
17803 .map(<PlaybackStatus as fidl::encoding::ValueTypeMarker>::borrow),
17804 encoder,
17805 offset + cur_offset,
17806 depth,
17807 )?;
17808
17809 _prev_end_offset = cur_offset + envelope_size;
17810 if 2 > max_ordinal {
17811 return Ok(());
17812 }
17813
17814 let cur_offset: usize = (2 - 1) * envelope_size;
17817
17818 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17820
17821 fidl::encoding::encode_in_envelope_optional::<u64, D>(
17826 self.track_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
17827 encoder,
17828 offset + cur_offset,
17829 depth,
17830 )?;
17831
17832 _prev_end_offset = cur_offset + envelope_size;
17833 if 3 > max_ordinal {
17834 return Ok(());
17835 }
17836
17837 let cur_offset: usize = (3 - 1) * envelope_size;
17840
17841 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17843
17844 fidl::encoding::encode_in_envelope_optional::<u32, D>(
17849 self.pos.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
17850 encoder,
17851 offset + cur_offset,
17852 depth,
17853 )?;
17854
17855 _prev_end_offset = cur_offset + envelope_size;
17856 if 4 > max_ordinal {
17857 return Ok(());
17858 }
17859
17860 let cur_offset: usize = (4 - 1) * envelope_size;
17863
17864 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17866
17867 fidl::encoding::encode_in_envelope_optional::<BatteryStatus, D>(
17872 self.battery_status
17873 .as_ref()
17874 .map(<BatteryStatus as fidl::encoding::ValueTypeMarker>::borrow),
17875 encoder,
17876 offset + cur_offset,
17877 depth,
17878 )?;
17879
17880 _prev_end_offset = cur_offset + envelope_size;
17881 if 5 > max_ordinal {
17882 return Ok(());
17883 }
17884
17885 let cur_offset: usize = (5 - 1) * envelope_size;
17888
17889 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17891
17892 fidl::encoding::encode_in_envelope_optional::<SystemStatus, D>(
17897 self.system_status
17898 .as_ref()
17899 .map(<SystemStatus as fidl::encoding::ValueTypeMarker>::borrow),
17900 encoder,
17901 offset + cur_offset,
17902 depth,
17903 )?;
17904
17905 _prev_end_offset = cur_offset + envelope_size;
17906 if 6 > max_ordinal {
17907 return Ok(());
17908 }
17909
17910 let cur_offset: usize = (6 - 1) * envelope_size;
17913
17914 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17916
17917 fidl::encoding::encode_in_envelope_optional::<PlayerApplicationSettings, D>(
17922 self.application_settings
17923 .as_ref()
17924 .map(<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow),
17925 encoder,
17926 offset + cur_offset,
17927 depth,
17928 )?;
17929
17930 _prev_end_offset = cur_offset + envelope_size;
17931 if 7 > max_ordinal {
17932 return Ok(());
17933 }
17934
17935 let cur_offset: usize = (7 - 1) * envelope_size;
17938
17939 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17941
17942 fidl::encoding::encode_in_envelope_optional::<u16, D>(
17947 self.player_id.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
17948 encoder,
17949 offset + cur_offset,
17950 depth,
17951 )?;
17952
17953 _prev_end_offset = cur_offset + envelope_size;
17954 if 8 > max_ordinal {
17955 return Ok(());
17956 }
17957
17958 let cur_offset: usize = (8 - 1) * envelope_size;
17961
17962 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17964
17965 fidl::encoding::encode_in_envelope_optional::<u8, D>(
17970 self.volume.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
17971 encoder,
17972 offset + cur_offset,
17973 depth,
17974 )?;
17975
17976 _prev_end_offset = cur_offset + envelope_size;
17977 if 9 > max_ordinal {
17978 return Ok(());
17979 }
17980
17981 let cur_offset: usize = (9 - 1) * envelope_size;
17984
17985 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17987
17988 fidl::encoding::encode_in_envelope_optional::<bool, D>(
17993 self.device_connected
17994 .as_ref()
17995 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
17996 encoder,
17997 offset + cur_offset,
17998 depth,
17999 )?;
18000
18001 _prev_end_offset = cur_offset + envelope_size;
18002 if 10 > max_ordinal {
18003 return Ok(());
18004 }
18005
18006 let cur_offset: usize = (10 - 1) * envelope_size;
18009
18010 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18012
18013 fidl::encoding::encode_in_envelope_optional::<bool, D>(
18018 self.available_players_changed
18019 .as_ref()
18020 .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
18021 encoder,
18022 offset + cur_offset,
18023 depth,
18024 )?;
18025
18026 _prev_end_offset = cur_offset + envelope_size;
18027 if 11 > max_ordinal {
18028 return Ok(());
18029 }
18030
18031 let cur_offset: usize = (11 - 1) * envelope_size;
18034
18035 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18037
18038 fidl::encoding::encode_in_envelope_optional::<u16, D>(
18043 self.addressed_player
18044 .as_ref()
18045 .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
18046 encoder,
18047 offset + cur_offset,
18048 depth,
18049 )?;
18050
18051 _prev_end_offset = cur_offset + envelope_size;
18052
18053 Ok(())
18054 }
18055 }
18056
18057 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Notification {
18058 #[inline(always)]
18059 fn new_empty() -> Self {
18060 Self::default()
18061 }
18062
18063 unsafe fn decode(
18064 &mut self,
18065 decoder: &mut fidl::encoding::Decoder<'_, D>,
18066 offset: usize,
18067 mut depth: fidl::encoding::Depth,
18068 ) -> fidl::Result<()> {
18069 decoder.debug_check_bounds::<Self>(offset);
18070 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18071 None => return Err(fidl::Error::NotNullable),
18072 Some(len) => len,
18073 };
18074 if len == 0 {
18076 return Ok(());
18077 };
18078 depth.increment()?;
18079 let envelope_size = 8;
18080 let bytes_len = len * envelope_size;
18081 let offset = decoder.out_of_line_offset(bytes_len)?;
18082 let mut _next_ordinal_to_read = 0;
18084 let mut next_offset = offset;
18085 let end_offset = offset + bytes_len;
18086 _next_ordinal_to_read += 1;
18087 if next_offset >= end_offset {
18088 return Ok(());
18089 }
18090
18091 while _next_ordinal_to_read < 1 {
18093 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18094 _next_ordinal_to_read += 1;
18095 next_offset += envelope_size;
18096 }
18097
18098 let next_out_of_line = decoder.next_out_of_line();
18099 let handles_before = decoder.remaining_handles();
18100 if let Some((inlined, num_bytes, num_handles)) =
18101 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18102 {
18103 let member_inline_size =
18104 <PlaybackStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18105 if inlined != (member_inline_size <= 4) {
18106 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18107 }
18108 let inner_offset;
18109 let mut inner_depth = depth.clone();
18110 if inlined {
18111 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18112 inner_offset = next_offset;
18113 } else {
18114 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18115 inner_depth.increment()?;
18116 }
18117 let val_ref =
18118 self.status.get_or_insert_with(|| fidl::new_empty!(PlaybackStatus, D));
18119 fidl::decode!(PlaybackStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
18120 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18121 {
18122 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18123 }
18124 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18125 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18126 }
18127 }
18128
18129 next_offset += envelope_size;
18130 _next_ordinal_to_read += 1;
18131 if next_offset >= end_offset {
18132 return Ok(());
18133 }
18134
18135 while _next_ordinal_to_read < 2 {
18137 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18138 _next_ordinal_to_read += 1;
18139 next_offset += envelope_size;
18140 }
18141
18142 let next_out_of_line = decoder.next_out_of_line();
18143 let handles_before = decoder.remaining_handles();
18144 if let Some((inlined, num_bytes, num_handles)) =
18145 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18146 {
18147 let member_inline_size =
18148 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18149 if inlined != (member_inline_size <= 4) {
18150 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18151 }
18152 let inner_offset;
18153 let mut inner_depth = depth.clone();
18154 if inlined {
18155 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18156 inner_offset = next_offset;
18157 } else {
18158 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18159 inner_depth.increment()?;
18160 }
18161 let val_ref = self.track_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
18162 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
18163 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18164 {
18165 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18166 }
18167 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18168 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18169 }
18170 }
18171
18172 next_offset += envelope_size;
18173 _next_ordinal_to_read += 1;
18174 if next_offset >= end_offset {
18175 return Ok(());
18176 }
18177
18178 while _next_ordinal_to_read < 3 {
18180 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18181 _next_ordinal_to_read += 1;
18182 next_offset += envelope_size;
18183 }
18184
18185 let next_out_of_line = decoder.next_out_of_line();
18186 let handles_before = decoder.remaining_handles();
18187 if let Some((inlined, num_bytes, num_handles)) =
18188 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18189 {
18190 let member_inline_size =
18191 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18192 if inlined != (member_inline_size <= 4) {
18193 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18194 }
18195 let inner_offset;
18196 let mut inner_depth = depth.clone();
18197 if inlined {
18198 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18199 inner_offset = next_offset;
18200 } else {
18201 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18202 inner_depth.increment()?;
18203 }
18204 let val_ref = self.pos.get_or_insert_with(|| fidl::new_empty!(u32, D));
18205 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18206 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18207 {
18208 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18209 }
18210 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18211 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18212 }
18213 }
18214
18215 next_offset += envelope_size;
18216 _next_ordinal_to_read += 1;
18217 if next_offset >= end_offset {
18218 return Ok(());
18219 }
18220
18221 while _next_ordinal_to_read < 4 {
18223 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18224 _next_ordinal_to_read += 1;
18225 next_offset += envelope_size;
18226 }
18227
18228 let next_out_of_line = decoder.next_out_of_line();
18229 let handles_before = decoder.remaining_handles();
18230 if let Some((inlined, num_bytes, num_handles)) =
18231 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18232 {
18233 let member_inline_size =
18234 <BatteryStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18235 if inlined != (member_inline_size <= 4) {
18236 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18237 }
18238 let inner_offset;
18239 let mut inner_depth = depth.clone();
18240 if inlined {
18241 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18242 inner_offset = next_offset;
18243 } else {
18244 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18245 inner_depth.increment()?;
18246 }
18247 let val_ref =
18248 self.battery_status.get_or_insert_with(|| fidl::new_empty!(BatteryStatus, D));
18249 fidl::decode!(BatteryStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
18250 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18251 {
18252 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18253 }
18254 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18255 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18256 }
18257 }
18258
18259 next_offset += envelope_size;
18260 _next_ordinal_to_read += 1;
18261 if next_offset >= end_offset {
18262 return Ok(());
18263 }
18264
18265 while _next_ordinal_to_read < 5 {
18267 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18268 _next_ordinal_to_read += 1;
18269 next_offset += envelope_size;
18270 }
18271
18272 let next_out_of_line = decoder.next_out_of_line();
18273 let handles_before = decoder.remaining_handles();
18274 if let Some((inlined, num_bytes, num_handles)) =
18275 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18276 {
18277 let member_inline_size =
18278 <SystemStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18279 if inlined != (member_inline_size <= 4) {
18280 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18281 }
18282 let inner_offset;
18283 let mut inner_depth = depth.clone();
18284 if inlined {
18285 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18286 inner_offset = next_offset;
18287 } else {
18288 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18289 inner_depth.increment()?;
18290 }
18291 let val_ref =
18292 self.system_status.get_or_insert_with(|| fidl::new_empty!(SystemStatus, D));
18293 fidl::decode!(SystemStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
18294 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18295 {
18296 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18297 }
18298 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18299 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18300 }
18301 }
18302
18303 next_offset += envelope_size;
18304 _next_ordinal_to_read += 1;
18305 if next_offset >= end_offset {
18306 return Ok(());
18307 }
18308
18309 while _next_ordinal_to_read < 6 {
18311 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18312 _next_ordinal_to_read += 1;
18313 next_offset += envelope_size;
18314 }
18315
18316 let next_out_of_line = decoder.next_out_of_line();
18317 let handles_before = decoder.remaining_handles();
18318 if let Some((inlined, num_bytes, num_handles)) =
18319 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18320 {
18321 let member_inline_size =
18322 <PlayerApplicationSettings as fidl::encoding::TypeMarker>::inline_size(
18323 decoder.context,
18324 );
18325 if inlined != (member_inline_size <= 4) {
18326 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18327 }
18328 let inner_offset;
18329 let mut inner_depth = depth.clone();
18330 if inlined {
18331 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18332 inner_offset = next_offset;
18333 } else {
18334 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18335 inner_depth.increment()?;
18336 }
18337 let val_ref = self
18338 .application_settings
18339 .get_or_insert_with(|| fidl::new_empty!(PlayerApplicationSettings, D));
18340 fidl::decode!(
18341 PlayerApplicationSettings,
18342 D,
18343 val_ref,
18344 decoder,
18345 inner_offset,
18346 inner_depth
18347 )?;
18348 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18349 {
18350 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18351 }
18352 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18353 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18354 }
18355 }
18356
18357 next_offset += envelope_size;
18358 _next_ordinal_to_read += 1;
18359 if next_offset >= end_offset {
18360 return Ok(());
18361 }
18362
18363 while _next_ordinal_to_read < 7 {
18365 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18366 _next_ordinal_to_read += 1;
18367 next_offset += envelope_size;
18368 }
18369
18370 let next_out_of_line = decoder.next_out_of_line();
18371 let handles_before = decoder.remaining_handles();
18372 if let Some((inlined, num_bytes, num_handles)) =
18373 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18374 {
18375 let member_inline_size =
18376 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18377 if inlined != (member_inline_size <= 4) {
18378 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18379 }
18380 let inner_offset;
18381 let mut inner_depth = depth.clone();
18382 if inlined {
18383 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18384 inner_offset = next_offset;
18385 } else {
18386 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18387 inner_depth.increment()?;
18388 }
18389 let val_ref = self.player_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
18390 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
18391 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18392 {
18393 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18394 }
18395 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18396 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18397 }
18398 }
18399
18400 next_offset += envelope_size;
18401 _next_ordinal_to_read += 1;
18402 if next_offset >= end_offset {
18403 return Ok(());
18404 }
18405
18406 while _next_ordinal_to_read < 8 {
18408 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18409 _next_ordinal_to_read += 1;
18410 next_offset += envelope_size;
18411 }
18412
18413 let next_out_of_line = decoder.next_out_of_line();
18414 let handles_before = decoder.remaining_handles();
18415 if let Some((inlined, num_bytes, num_handles)) =
18416 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18417 {
18418 let member_inline_size =
18419 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18420 if inlined != (member_inline_size <= 4) {
18421 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18422 }
18423 let inner_offset;
18424 let mut inner_depth = depth.clone();
18425 if inlined {
18426 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18427 inner_offset = next_offset;
18428 } else {
18429 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18430 inner_depth.increment()?;
18431 }
18432 let val_ref = self.volume.get_or_insert_with(|| fidl::new_empty!(u8, D));
18433 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
18434 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18435 {
18436 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18437 }
18438 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18439 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18440 }
18441 }
18442
18443 next_offset += envelope_size;
18444 _next_ordinal_to_read += 1;
18445 if next_offset >= end_offset {
18446 return Ok(());
18447 }
18448
18449 while _next_ordinal_to_read < 9 {
18451 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18452 _next_ordinal_to_read += 1;
18453 next_offset += envelope_size;
18454 }
18455
18456 let next_out_of_line = decoder.next_out_of_line();
18457 let handles_before = decoder.remaining_handles();
18458 if let Some((inlined, num_bytes, num_handles)) =
18459 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18460 {
18461 let member_inline_size =
18462 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18463 if inlined != (member_inline_size <= 4) {
18464 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18465 }
18466 let inner_offset;
18467 let mut inner_depth = depth.clone();
18468 if inlined {
18469 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18470 inner_offset = next_offset;
18471 } else {
18472 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18473 inner_depth.increment()?;
18474 }
18475 let val_ref =
18476 self.device_connected.get_or_insert_with(|| fidl::new_empty!(bool, D));
18477 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
18478 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18479 {
18480 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18481 }
18482 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18483 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18484 }
18485 }
18486
18487 next_offset += envelope_size;
18488 _next_ordinal_to_read += 1;
18489 if next_offset >= end_offset {
18490 return Ok(());
18491 }
18492
18493 while _next_ordinal_to_read < 10 {
18495 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18496 _next_ordinal_to_read += 1;
18497 next_offset += envelope_size;
18498 }
18499
18500 let next_out_of_line = decoder.next_out_of_line();
18501 let handles_before = decoder.remaining_handles();
18502 if let Some((inlined, num_bytes, num_handles)) =
18503 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18504 {
18505 let member_inline_size =
18506 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18507 if inlined != (member_inline_size <= 4) {
18508 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18509 }
18510 let inner_offset;
18511 let mut inner_depth = depth.clone();
18512 if inlined {
18513 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18514 inner_offset = next_offset;
18515 } else {
18516 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18517 inner_depth.increment()?;
18518 }
18519 let val_ref =
18520 self.available_players_changed.get_or_insert_with(|| fidl::new_empty!(bool, D));
18521 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
18522 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18523 {
18524 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18525 }
18526 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18527 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18528 }
18529 }
18530
18531 next_offset += envelope_size;
18532 _next_ordinal_to_read += 1;
18533 if next_offset >= end_offset {
18534 return Ok(());
18535 }
18536
18537 while _next_ordinal_to_read < 11 {
18539 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18540 _next_ordinal_to_read += 1;
18541 next_offset += envelope_size;
18542 }
18543
18544 let next_out_of_line = decoder.next_out_of_line();
18545 let handles_before = decoder.remaining_handles();
18546 if let Some((inlined, num_bytes, num_handles)) =
18547 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18548 {
18549 let member_inline_size =
18550 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18551 if inlined != (member_inline_size <= 4) {
18552 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18553 }
18554 let inner_offset;
18555 let mut inner_depth = depth.clone();
18556 if inlined {
18557 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18558 inner_offset = next_offset;
18559 } else {
18560 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18561 inner_depth.increment()?;
18562 }
18563 let val_ref = self.addressed_player.get_or_insert_with(|| fidl::new_empty!(u16, D));
18564 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
18565 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18566 {
18567 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18568 }
18569 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18570 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18571 }
18572 }
18573
18574 next_offset += envelope_size;
18575
18576 while next_offset < end_offset {
18578 _next_ordinal_to_read += 1;
18579 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18580 next_offset += envelope_size;
18581 }
18582
18583 Ok(())
18584 }
18585 }
18586
18587 impl PlayStatus {
18588 #[inline(always)]
18589 fn max_ordinal_present(&self) -> u64 {
18590 if let Some(_) = self.playback_status {
18591 return 3;
18592 }
18593 if let Some(_) = self.song_position {
18594 return 2;
18595 }
18596 if let Some(_) = self.song_length {
18597 return 1;
18598 }
18599 0
18600 }
18601 }
18602
18603 impl fidl::encoding::ValueTypeMarker for PlayStatus {
18604 type Borrowed<'a> = &'a Self;
18605 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18606 value
18607 }
18608 }
18609
18610 unsafe impl fidl::encoding::TypeMarker for PlayStatus {
18611 type Owned = Self;
18612
18613 #[inline(always)]
18614 fn inline_align(_context: fidl::encoding::Context) -> usize {
18615 8
18616 }
18617
18618 #[inline(always)]
18619 fn inline_size(_context: fidl::encoding::Context) -> usize {
18620 16
18621 }
18622 }
18623
18624 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PlayStatus, D>
18625 for &PlayStatus
18626 {
18627 unsafe fn encode(
18628 self,
18629 encoder: &mut fidl::encoding::Encoder<'_, D>,
18630 offset: usize,
18631 mut depth: fidl::encoding::Depth,
18632 ) -> fidl::Result<()> {
18633 encoder.debug_check_bounds::<PlayStatus>(offset);
18634 let max_ordinal: u64 = self.max_ordinal_present();
18636 encoder.write_num(max_ordinal, offset);
18637 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18638 if max_ordinal == 0 {
18640 return Ok(());
18641 }
18642 depth.increment()?;
18643 let envelope_size = 8;
18644 let bytes_len = max_ordinal as usize * envelope_size;
18645 #[allow(unused_variables)]
18646 let offset = encoder.out_of_line_offset(bytes_len);
18647 let mut _prev_end_offset: usize = 0;
18648 if 1 > max_ordinal {
18649 return Ok(());
18650 }
18651
18652 let cur_offset: usize = (1 - 1) * envelope_size;
18655
18656 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18658
18659 fidl::encoding::encode_in_envelope_optional::<u32, D>(
18664 self.song_length.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18665 encoder,
18666 offset + cur_offset,
18667 depth,
18668 )?;
18669
18670 _prev_end_offset = cur_offset + envelope_size;
18671 if 2 > max_ordinal {
18672 return Ok(());
18673 }
18674
18675 let cur_offset: usize = (2 - 1) * envelope_size;
18678
18679 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18681
18682 fidl::encoding::encode_in_envelope_optional::<u32, D>(
18687 self.song_position.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18688 encoder,
18689 offset + cur_offset,
18690 depth,
18691 )?;
18692
18693 _prev_end_offset = cur_offset + envelope_size;
18694 if 3 > max_ordinal {
18695 return Ok(());
18696 }
18697
18698 let cur_offset: usize = (3 - 1) * envelope_size;
18701
18702 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18704
18705 fidl::encoding::encode_in_envelope_optional::<PlaybackStatus, D>(
18710 self.playback_status
18711 .as_ref()
18712 .map(<PlaybackStatus as fidl::encoding::ValueTypeMarker>::borrow),
18713 encoder,
18714 offset + cur_offset,
18715 depth,
18716 )?;
18717
18718 _prev_end_offset = cur_offset + envelope_size;
18719
18720 Ok(())
18721 }
18722 }
18723
18724 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PlayStatus {
18725 #[inline(always)]
18726 fn new_empty() -> Self {
18727 Self::default()
18728 }
18729
18730 unsafe fn decode(
18731 &mut self,
18732 decoder: &mut fidl::encoding::Decoder<'_, D>,
18733 offset: usize,
18734 mut depth: fidl::encoding::Depth,
18735 ) -> fidl::Result<()> {
18736 decoder.debug_check_bounds::<Self>(offset);
18737 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18738 None => return Err(fidl::Error::NotNullable),
18739 Some(len) => len,
18740 };
18741 if len == 0 {
18743 return Ok(());
18744 };
18745 depth.increment()?;
18746 let envelope_size = 8;
18747 let bytes_len = len * envelope_size;
18748 let offset = decoder.out_of_line_offset(bytes_len)?;
18749 let mut _next_ordinal_to_read = 0;
18751 let mut next_offset = offset;
18752 let end_offset = offset + bytes_len;
18753 _next_ordinal_to_read += 1;
18754 if next_offset >= end_offset {
18755 return Ok(());
18756 }
18757
18758 while _next_ordinal_to_read < 1 {
18760 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18761 _next_ordinal_to_read += 1;
18762 next_offset += envelope_size;
18763 }
18764
18765 let next_out_of_line = decoder.next_out_of_line();
18766 let handles_before = decoder.remaining_handles();
18767 if let Some((inlined, num_bytes, num_handles)) =
18768 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18769 {
18770 let member_inline_size =
18771 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18772 if inlined != (member_inline_size <= 4) {
18773 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18774 }
18775 let inner_offset;
18776 let mut inner_depth = depth.clone();
18777 if inlined {
18778 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18779 inner_offset = next_offset;
18780 } else {
18781 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18782 inner_depth.increment()?;
18783 }
18784 let val_ref = self.song_length.get_or_insert_with(|| fidl::new_empty!(u32, D));
18785 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18786 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18787 {
18788 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18789 }
18790 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18791 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18792 }
18793 }
18794
18795 next_offset += envelope_size;
18796 _next_ordinal_to_read += 1;
18797 if next_offset >= end_offset {
18798 return Ok(());
18799 }
18800
18801 while _next_ordinal_to_read < 2 {
18803 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18804 _next_ordinal_to_read += 1;
18805 next_offset += envelope_size;
18806 }
18807
18808 let next_out_of_line = decoder.next_out_of_line();
18809 let handles_before = decoder.remaining_handles();
18810 if let Some((inlined, num_bytes, num_handles)) =
18811 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18812 {
18813 let member_inline_size =
18814 <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18815 if inlined != (member_inline_size <= 4) {
18816 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18817 }
18818 let inner_offset;
18819 let mut inner_depth = depth.clone();
18820 if inlined {
18821 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18822 inner_offset = next_offset;
18823 } else {
18824 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18825 inner_depth.increment()?;
18826 }
18827 let val_ref = self.song_position.get_or_insert_with(|| fidl::new_empty!(u32, D));
18828 fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18829 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18830 {
18831 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18832 }
18833 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18834 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18835 }
18836 }
18837
18838 next_offset += envelope_size;
18839 _next_ordinal_to_read += 1;
18840 if next_offset >= end_offset {
18841 return Ok(());
18842 }
18843
18844 while _next_ordinal_to_read < 3 {
18846 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18847 _next_ordinal_to_read += 1;
18848 next_offset += envelope_size;
18849 }
18850
18851 let next_out_of_line = decoder.next_out_of_line();
18852 let handles_before = decoder.remaining_handles();
18853 if let Some((inlined, num_bytes, num_handles)) =
18854 fidl::encoding::decode_envelope_header(decoder, next_offset)?
18855 {
18856 let member_inline_size =
18857 <PlaybackStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18858 if inlined != (member_inline_size <= 4) {
18859 return Err(fidl::Error::InvalidInlineBitInEnvelope);
18860 }
18861 let inner_offset;
18862 let mut inner_depth = depth.clone();
18863 if inlined {
18864 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18865 inner_offset = next_offset;
18866 } else {
18867 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18868 inner_depth.increment()?;
18869 }
18870 let val_ref =
18871 self.playback_status.get_or_insert_with(|| fidl::new_empty!(PlaybackStatus, D));
18872 fidl::decode!(PlaybackStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
18873 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18874 {
18875 return Err(fidl::Error::InvalidNumBytesInEnvelope);
18876 }
18877 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18878 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18879 }
18880 }
18881
18882 next_offset += envelope_size;
18883
18884 while next_offset < end_offset {
18886 _next_ordinal_to_read += 1;
18887 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18888 next_offset += envelope_size;
18889 }
18890
18891 Ok(())
18892 }
18893 }
18894
18895 impl PlayerApplicationSettings {
18896 #[inline(always)]
18897 fn max_ordinal_present(&self) -> u64 {
18898 if let Some(_) = self.custom_settings {
18899 return 5;
18900 }
18901 if let Some(_) = self.scan_mode {
18902 return 4;
18903 }
18904 if let Some(_) = self.shuffle_mode {
18905 return 3;
18906 }
18907 if let Some(_) = self.repeat_status_mode {
18908 return 2;
18909 }
18910 if let Some(_) = self.equalizer {
18911 return 1;
18912 }
18913 0
18914 }
18915 }
18916
18917 impl fidl::encoding::ValueTypeMarker for PlayerApplicationSettings {
18918 type Borrowed<'a> = &'a Self;
18919 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18920 value
18921 }
18922 }
18923
18924 unsafe impl fidl::encoding::TypeMarker for PlayerApplicationSettings {
18925 type Owned = Self;
18926
18927 #[inline(always)]
18928 fn inline_align(_context: fidl::encoding::Context) -> usize {
18929 8
18930 }
18931
18932 #[inline(always)]
18933 fn inline_size(_context: fidl::encoding::Context) -> usize {
18934 16
18935 }
18936 }
18937
18938 unsafe impl<D: fidl::encoding::ResourceDialect>
18939 fidl::encoding::Encode<PlayerApplicationSettings, D> for &PlayerApplicationSettings
18940 {
18941 unsafe fn encode(
18942 self,
18943 encoder: &mut fidl::encoding::Encoder<'_, D>,
18944 offset: usize,
18945 mut depth: fidl::encoding::Depth,
18946 ) -> fidl::Result<()> {
18947 encoder.debug_check_bounds::<PlayerApplicationSettings>(offset);
18948 let max_ordinal: u64 = self.max_ordinal_present();
18950 encoder.write_num(max_ordinal, offset);
18951 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18952 if max_ordinal == 0 {
18954 return Ok(());
18955 }
18956 depth.increment()?;
18957 let envelope_size = 8;
18958 let bytes_len = max_ordinal as usize * envelope_size;
18959 #[allow(unused_variables)]
18960 let offset = encoder.out_of_line_offset(bytes_len);
18961 let mut _prev_end_offset: usize = 0;
18962 if 1 > max_ordinal {
18963 return Ok(());
18964 }
18965
18966 let cur_offset: usize = (1 - 1) * envelope_size;
18969
18970 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18972
18973 fidl::encoding::encode_in_envelope_optional::<Equalizer, D>(
18978 self.equalizer.as_ref().map(<Equalizer as fidl::encoding::ValueTypeMarker>::borrow),
18979 encoder,
18980 offset + cur_offset,
18981 depth,
18982 )?;
18983
18984 _prev_end_offset = cur_offset + envelope_size;
18985 if 2 > max_ordinal {
18986 return Ok(());
18987 }
18988
18989 let cur_offset: usize = (2 - 1) * envelope_size;
18992
18993 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18995
18996 fidl::encoding::encode_in_envelope_optional::<RepeatStatusMode, D>(
19001 self.repeat_status_mode
19002 .as_ref()
19003 .map(<RepeatStatusMode as fidl::encoding::ValueTypeMarker>::borrow),
19004 encoder,
19005 offset + cur_offset,
19006 depth,
19007 )?;
19008
19009 _prev_end_offset = cur_offset + envelope_size;
19010 if 3 > max_ordinal {
19011 return Ok(());
19012 }
19013
19014 let cur_offset: usize = (3 - 1) * envelope_size;
19017
19018 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19020
19021 fidl::encoding::encode_in_envelope_optional::<ShuffleMode, D>(
19026 self.shuffle_mode
19027 .as_ref()
19028 .map(<ShuffleMode as fidl::encoding::ValueTypeMarker>::borrow),
19029 encoder,
19030 offset + cur_offset,
19031 depth,
19032 )?;
19033
19034 _prev_end_offset = cur_offset + envelope_size;
19035 if 4 > max_ordinal {
19036 return Ok(());
19037 }
19038
19039 let cur_offset: usize = (4 - 1) * envelope_size;
19042
19043 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19045
19046 fidl::encoding::encode_in_envelope_optional::<ScanMode, D>(
19051 self.scan_mode.as_ref().map(<ScanMode as fidl::encoding::ValueTypeMarker>::borrow),
19052 encoder,
19053 offset + cur_offset,
19054 depth,
19055 )?;
19056
19057 _prev_end_offset = cur_offset + envelope_size;
19058 if 5 > max_ordinal {
19059 return Ok(());
19060 }
19061
19062 let cur_offset: usize = (5 - 1) * envelope_size;
19065
19066 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19068
19069 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<CustomPlayerApplicationSetting, 127>, D>(
19074 self.custom_settings.as_ref().map(<fidl::encoding::Vector<CustomPlayerApplicationSetting, 127> as fidl::encoding::ValueTypeMarker>::borrow),
19075 encoder, offset + cur_offset, depth
19076 )?;
19077
19078 _prev_end_offset = cur_offset + envelope_size;
19079
19080 Ok(())
19081 }
19082 }
19083
19084 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
19085 for PlayerApplicationSettings
19086 {
19087 #[inline(always)]
19088 fn new_empty() -> Self {
19089 Self::default()
19090 }
19091
19092 unsafe fn decode(
19093 &mut self,
19094 decoder: &mut fidl::encoding::Decoder<'_, D>,
19095 offset: usize,
19096 mut depth: fidl::encoding::Depth,
19097 ) -> fidl::Result<()> {
19098 decoder.debug_check_bounds::<Self>(offset);
19099 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
19100 None => return Err(fidl::Error::NotNullable),
19101 Some(len) => len,
19102 };
19103 if len == 0 {
19105 return Ok(());
19106 };
19107 depth.increment()?;
19108 let envelope_size = 8;
19109 let bytes_len = len * envelope_size;
19110 let offset = decoder.out_of_line_offset(bytes_len)?;
19111 let mut _next_ordinal_to_read = 0;
19113 let mut next_offset = offset;
19114 let end_offset = offset + bytes_len;
19115 _next_ordinal_to_read += 1;
19116 if next_offset >= end_offset {
19117 return Ok(());
19118 }
19119
19120 while _next_ordinal_to_read < 1 {
19122 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19123 _next_ordinal_to_read += 1;
19124 next_offset += envelope_size;
19125 }
19126
19127 let next_out_of_line = decoder.next_out_of_line();
19128 let handles_before = decoder.remaining_handles();
19129 if let Some((inlined, num_bytes, num_handles)) =
19130 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19131 {
19132 let member_inline_size =
19133 <Equalizer as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19134 if inlined != (member_inline_size <= 4) {
19135 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19136 }
19137 let inner_offset;
19138 let mut inner_depth = depth.clone();
19139 if inlined {
19140 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19141 inner_offset = next_offset;
19142 } else {
19143 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19144 inner_depth.increment()?;
19145 }
19146 let val_ref = self.equalizer.get_or_insert_with(|| fidl::new_empty!(Equalizer, D));
19147 fidl::decode!(Equalizer, D, val_ref, decoder, inner_offset, inner_depth)?;
19148 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19149 {
19150 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19151 }
19152 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19153 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19154 }
19155 }
19156
19157 next_offset += envelope_size;
19158 _next_ordinal_to_read += 1;
19159 if next_offset >= end_offset {
19160 return Ok(());
19161 }
19162
19163 while _next_ordinal_to_read < 2 {
19165 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19166 _next_ordinal_to_read += 1;
19167 next_offset += envelope_size;
19168 }
19169
19170 let next_out_of_line = decoder.next_out_of_line();
19171 let handles_before = decoder.remaining_handles();
19172 if let Some((inlined, num_bytes, num_handles)) =
19173 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19174 {
19175 let member_inline_size =
19176 <RepeatStatusMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19177 if inlined != (member_inline_size <= 4) {
19178 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19179 }
19180 let inner_offset;
19181 let mut inner_depth = depth.clone();
19182 if inlined {
19183 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19184 inner_offset = next_offset;
19185 } else {
19186 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19187 inner_depth.increment()?;
19188 }
19189 let val_ref = self
19190 .repeat_status_mode
19191 .get_or_insert_with(|| fidl::new_empty!(RepeatStatusMode, D));
19192 fidl::decode!(RepeatStatusMode, D, val_ref, decoder, inner_offset, inner_depth)?;
19193 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19194 {
19195 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19196 }
19197 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19198 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19199 }
19200 }
19201
19202 next_offset += envelope_size;
19203 _next_ordinal_to_read += 1;
19204 if next_offset >= end_offset {
19205 return Ok(());
19206 }
19207
19208 while _next_ordinal_to_read < 3 {
19210 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19211 _next_ordinal_to_read += 1;
19212 next_offset += envelope_size;
19213 }
19214
19215 let next_out_of_line = decoder.next_out_of_line();
19216 let handles_before = decoder.remaining_handles();
19217 if let Some((inlined, num_bytes, num_handles)) =
19218 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19219 {
19220 let member_inline_size =
19221 <ShuffleMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19222 if inlined != (member_inline_size <= 4) {
19223 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19224 }
19225 let inner_offset;
19226 let mut inner_depth = depth.clone();
19227 if inlined {
19228 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19229 inner_offset = next_offset;
19230 } else {
19231 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19232 inner_depth.increment()?;
19233 }
19234 let val_ref =
19235 self.shuffle_mode.get_or_insert_with(|| fidl::new_empty!(ShuffleMode, D));
19236 fidl::decode!(ShuffleMode, D, val_ref, decoder, inner_offset, inner_depth)?;
19237 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19238 {
19239 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19240 }
19241 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19242 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19243 }
19244 }
19245
19246 next_offset += envelope_size;
19247 _next_ordinal_to_read += 1;
19248 if next_offset >= end_offset {
19249 return Ok(());
19250 }
19251
19252 while _next_ordinal_to_read < 4 {
19254 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19255 _next_ordinal_to_read += 1;
19256 next_offset += envelope_size;
19257 }
19258
19259 let next_out_of_line = decoder.next_out_of_line();
19260 let handles_before = decoder.remaining_handles();
19261 if let Some((inlined, num_bytes, num_handles)) =
19262 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19263 {
19264 let member_inline_size =
19265 <ScanMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19266 if inlined != (member_inline_size <= 4) {
19267 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19268 }
19269 let inner_offset;
19270 let mut inner_depth = depth.clone();
19271 if inlined {
19272 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19273 inner_offset = next_offset;
19274 } else {
19275 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19276 inner_depth.increment()?;
19277 }
19278 let val_ref = self.scan_mode.get_or_insert_with(|| fidl::new_empty!(ScanMode, D));
19279 fidl::decode!(ScanMode, D, val_ref, decoder, inner_offset, inner_depth)?;
19280 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19281 {
19282 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19283 }
19284 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19285 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19286 }
19287 }
19288
19289 next_offset += envelope_size;
19290 _next_ordinal_to_read += 1;
19291 if next_offset >= end_offset {
19292 return Ok(());
19293 }
19294
19295 while _next_ordinal_to_read < 5 {
19297 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19298 _next_ordinal_to_read += 1;
19299 next_offset += envelope_size;
19300 }
19301
19302 let next_out_of_line = decoder.next_out_of_line();
19303 let handles_before = decoder.remaining_handles();
19304 if let Some((inlined, num_bytes, num_handles)) =
19305 fidl::encoding::decode_envelope_header(decoder, next_offset)?
19306 {
19307 let member_inline_size = <fidl::encoding::Vector<
19308 CustomPlayerApplicationSetting,
19309 127,
19310 > as fidl::encoding::TypeMarker>::inline_size(
19311 decoder.context
19312 );
19313 if inlined != (member_inline_size <= 4) {
19314 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19315 }
19316 let inner_offset;
19317 let mut inner_depth = depth.clone();
19318 if inlined {
19319 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19320 inner_offset = next_offset;
19321 } else {
19322 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19323 inner_depth.increment()?;
19324 }
19325 let val_ref =
19326 self.custom_settings.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<CustomPlayerApplicationSetting, 127>, D));
19327 fidl::decode!(fidl::encoding::Vector<CustomPlayerApplicationSetting, 127>, D, val_ref, decoder, inner_offset, inner_depth)?;
19328 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19329 {
19330 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19331 }
19332 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19333 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19334 }
19335 }
19336
19337 next_offset += envelope_size;
19338
19339 while next_offset < end_offset {
19341 _next_ordinal_to_read += 1;
19342 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19343 next_offset += envelope_size;
19344 }
19345
19346 Ok(())
19347 }
19348 }
19349
19350 impl fidl::encoding::ValueTypeMarker for AttributeRequestOption {
19351 type Borrowed<'a> = &'a Self;
19352 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
19353 value
19354 }
19355 }
19356
19357 unsafe impl fidl::encoding::TypeMarker for AttributeRequestOption {
19358 type Owned = Self;
19359
19360 #[inline(always)]
19361 fn inline_align(_context: fidl::encoding::Context) -> usize {
19362 8
19363 }
19364
19365 #[inline(always)]
19366 fn inline_size(_context: fidl::encoding::Context) -> usize {
19367 16
19368 }
19369 }
19370
19371 unsafe impl<D: fidl::encoding::ResourceDialect>
19372 fidl::encoding::Encode<AttributeRequestOption, D> for &AttributeRequestOption
19373 {
19374 #[inline]
19375 unsafe fn encode(
19376 self,
19377 encoder: &mut fidl::encoding::Encoder<'_, D>,
19378 offset: usize,
19379 _depth: fidl::encoding::Depth,
19380 ) -> fidl::Result<()> {
19381 encoder.debug_check_bounds::<AttributeRequestOption>(offset);
19382 encoder.write_num::<u64>(self.ordinal(), offset);
19383 match self {
19384 AttributeRequestOption::GetAll(ref val) => {
19385 fidl::encoding::encode_in_envelope::<bool, D>(
19386 <bool as fidl::encoding::ValueTypeMarker>::borrow(val),
19387 encoder, offset + 8, _depth
19388 )
19389 }
19390 AttributeRequestOption::AttributeList(ref val) => {
19391 fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<MediaAttributeId, 8>, D>(
19392 <fidl::encoding::Vector<MediaAttributeId, 8> as fidl::encoding::ValueTypeMarker>::borrow(val),
19393 encoder, offset + 8, _depth
19394 )
19395 }
19396 }
19397 }
19398 }
19399
19400 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
19401 for AttributeRequestOption
19402 {
19403 #[inline(always)]
19404 fn new_empty() -> Self {
19405 Self::GetAll(fidl::new_empty!(bool, D))
19406 }
19407
19408 #[inline]
19409 unsafe fn decode(
19410 &mut self,
19411 decoder: &mut fidl::encoding::Decoder<'_, D>,
19412 offset: usize,
19413 mut depth: fidl::encoding::Depth,
19414 ) -> fidl::Result<()> {
19415 decoder.debug_check_bounds::<Self>(offset);
19416 #[allow(unused_variables)]
19417 let next_out_of_line = decoder.next_out_of_line();
19418 let handles_before = decoder.remaining_handles();
19419 let (ordinal, inlined, num_bytes, num_handles) =
19420 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
19421
19422 let member_inline_size = match ordinal {
19423 1 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19424 2 => <fidl::encoding::Vector<MediaAttributeId, 8> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19425 _ => return Err(fidl::Error::UnknownUnionTag),
19426 };
19427
19428 if inlined != (member_inline_size <= 4) {
19429 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19430 }
19431 let _inner_offset;
19432 if inlined {
19433 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
19434 _inner_offset = offset + 8;
19435 } else {
19436 depth.increment()?;
19437 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19438 }
19439 match ordinal {
19440 1 => {
19441 #[allow(irrefutable_let_patterns)]
19442 if let AttributeRequestOption::GetAll(_) = self {
19443 } else {
19445 *self = AttributeRequestOption::GetAll(fidl::new_empty!(bool, D));
19447 }
19448 #[allow(irrefutable_let_patterns)]
19449 if let AttributeRequestOption::GetAll(ref mut val) = self {
19450 fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
19451 } else {
19452 unreachable!()
19453 }
19454 }
19455 2 => {
19456 #[allow(irrefutable_let_patterns)]
19457 if let AttributeRequestOption::AttributeList(_) = self {
19458 } else {
19460 *self = AttributeRequestOption::AttributeList(
19462 fidl::new_empty!(fidl::encoding::Vector<MediaAttributeId, 8>, D),
19463 );
19464 }
19465 #[allow(irrefutable_let_patterns)]
19466 if let AttributeRequestOption::AttributeList(ref mut val) = self {
19467 fidl::decode!(fidl::encoding::Vector<MediaAttributeId, 8>, D, val, decoder, _inner_offset, depth)?;
19468 } else {
19469 unreachable!()
19470 }
19471 }
19472 ordinal => panic!("unexpected ordinal {:?}", ordinal),
19473 }
19474 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
19475 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19476 }
19477 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19478 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19479 }
19480 Ok(())
19481 }
19482 }
19483
19484 impl fidl::encoding::ValueTypeMarker for FileSystemItem {
19485 type Borrowed<'a> = &'a Self;
19486 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
19487 value
19488 }
19489 }
19490
19491 unsafe impl fidl::encoding::TypeMarker for FileSystemItem {
19492 type Owned = Self;
19493
19494 #[inline(always)]
19495 fn inline_align(_context: fidl::encoding::Context) -> usize {
19496 8
19497 }
19498
19499 #[inline(always)]
19500 fn inline_size(_context: fidl::encoding::Context) -> usize {
19501 16
19502 }
19503 }
19504
19505 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileSystemItem, D>
19506 for &FileSystemItem
19507 {
19508 #[inline]
19509 unsafe fn encode(
19510 self,
19511 encoder: &mut fidl::encoding::Encoder<'_, D>,
19512 offset: usize,
19513 _depth: fidl::encoding::Depth,
19514 ) -> fidl::Result<()> {
19515 encoder.debug_check_bounds::<FileSystemItem>(offset);
19516 encoder.write_num::<u64>(self.ordinal(), offset);
19517 match self {
19518 FileSystemItem::Folder(ref val) => {
19519 fidl::encoding::encode_in_envelope::<FolderItem, D>(
19520 <FolderItem as fidl::encoding::ValueTypeMarker>::borrow(val),
19521 encoder,
19522 offset + 8,
19523 _depth,
19524 )
19525 }
19526 FileSystemItem::MediaElement(ref val) => {
19527 fidl::encoding::encode_in_envelope::<MediaElementItem, D>(
19528 <MediaElementItem as fidl::encoding::ValueTypeMarker>::borrow(val),
19529 encoder,
19530 offset + 8,
19531 _depth,
19532 )
19533 }
19534 }
19535 }
19536 }
19537
19538 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileSystemItem {
19539 #[inline(always)]
19540 fn new_empty() -> Self {
19541 Self::Folder(fidl::new_empty!(FolderItem, D))
19542 }
19543
19544 #[inline]
19545 unsafe fn decode(
19546 &mut self,
19547 decoder: &mut fidl::encoding::Decoder<'_, D>,
19548 offset: usize,
19549 mut depth: fidl::encoding::Depth,
19550 ) -> fidl::Result<()> {
19551 decoder.debug_check_bounds::<Self>(offset);
19552 #[allow(unused_variables)]
19553 let next_out_of_line = decoder.next_out_of_line();
19554 let handles_before = decoder.remaining_handles();
19555 let (ordinal, inlined, num_bytes, num_handles) =
19556 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
19557
19558 let member_inline_size = match ordinal {
19559 1 => <FolderItem as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19560 2 => <MediaElementItem as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19561 _ => return Err(fidl::Error::UnknownUnionTag),
19562 };
19563
19564 if inlined != (member_inline_size <= 4) {
19565 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19566 }
19567 let _inner_offset;
19568 if inlined {
19569 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
19570 _inner_offset = offset + 8;
19571 } else {
19572 depth.increment()?;
19573 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19574 }
19575 match ordinal {
19576 1 => {
19577 #[allow(irrefutable_let_patterns)]
19578 if let FileSystemItem::Folder(_) = self {
19579 } else {
19581 *self = FileSystemItem::Folder(fidl::new_empty!(FolderItem, D));
19583 }
19584 #[allow(irrefutable_let_patterns)]
19585 if let FileSystemItem::Folder(ref mut val) = self {
19586 fidl::decode!(FolderItem, D, val, decoder, _inner_offset, depth)?;
19587 } else {
19588 unreachable!()
19589 }
19590 }
19591 2 => {
19592 #[allow(irrefutable_let_patterns)]
19593 if let FileSystemItem::MediaElement(_) = self {
19594 } else {
19596 *self = FileSystemItem::MediaElement(fidl::new_empty!(MediaElementItem, D));
19598 }
19599 #[allow(irrefutable_let_patterns)]
19600 if let FileSystemItem::MediaElement(ref mut val) = self {
19601 fidl::decode!(MediaElementItem, D, val, decoder, _inner_offset, depth)?;
19602 } else {
19603 unreachable!()
19604 }
19605 }
19606 ordinal => panic!("unexpected ordinal {:?}", ordinal),
19607 }
19608 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
19609 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19610 }
19611 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19612 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19613 }
19614 Ok(())
19615 }
19616 }
19617
19618 impl fidl::encoding::ValueTypeMarker for Path {
19619 type Borrowed<'a> = &'a Self;
19620 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
19621 value
19622 }
19623 }
19624
19625 unsafe impl fidl::encoding::TypeMarker for Path {
19626 type Owned = Self;
19627
19628 #[inline(always)]
19629 fn inline_align(_context: fidl::encoding::Context) -> usize {
19630 8
19631 }
19632
19633 #[inline(always)]
19634 fn inline_size(_context: fidl::encoding::Context) -> usize {
19635 16
19636 }
19637 }
19638
19639 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Path, D> for &Path {
19640 #[inline]
19641 unsafe fn encode(
19642 self,
19643 encoder: &mut fidl::encoding::Encoder<'_, D>,
19644 offset: usize,
19645 _depth: fidl::encoding::Depth,
19646 ) -> fidl::Result<()> {
19647 encoder.debug_check_bounds::<Path>(offset);
19648 encoder.write_num::<u64>(self.ordinal(), offset);
19649 match self {
19650 Path::Parent(ref val) => fidl::encoding::encode_in_envelope::<Parent, D>(
19651 <Parent as fidl::encoding::ValueTypeMarker>::borrow(val),
19652 encoder,
19653 offset + 8,
19654 _depth,
19655 ),
19656 Path::ChildFolderUid(ref val) => fidl::encoding::encode_in_envelope::<u64, D>(
19657 <u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
19658 encoder,
19659 offset + 8,
19660 _depth,
19661 ),
19662 Path::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
19663 }
19664 }
19665 }
19666
19667 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Path {
19668 #[inline(always)]
19669 fn new_empty() -> Self {
19670 Self::__SourceBreaking { unknown_ordinal: 0 }
19671 }
19672
19673 #[inline]
19674 unsafe fn decode(
19675 &mut self,
19676 decoder: &mut fidl::encoding::Decoder<'_, D>,
19677 offset: usize,
19678 mut depth: fidl::encoding::Depth,
19679 ) -> fidl::Result<()> {
19680 decoder.debug_check_bounds::<Self>(offset);
19681 #[allow(unused_variables)]
19682 let next_out_of_line = decoder.next_out_of_line();
19683 let handles_before = decoder.remaining_handles();
19684 let (ordinal, inlined, num_bytes, num_handles) =
19685 fidl::encoding::decode_union_inline_portion(decoder, offset)?;
19686
19687 let member_inline_size = match ordinal {
19688 1 => <Parent as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19689 2 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
19690 0 => return Err(fidl::Error::UnknownUnionTag),
19691 _ => num_bytes as usize,
19692 };
19693
19694 if inlined != (member_inline_size <= 4) {
19695 return Err(fidl::Error::InvalidInlineBitInEnvelope);
19696 }
19697 let _inner_offset;
19698 if inlined {
19699 decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
19700 _inner_offset = offset + 8;
19701 } else {
19702 depth.increment()?;
19703 _inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19704 }
19705 match ordinal {
19706 1 => {
19707 #[allow(irrefutable_let_patterns)]
19708 if let Path::Parent(_) = self {
19709 } else {
19711 *self = Path::Parent(fidl::new_empty!(Parent, D));
19713 }
19714 #[allow(irrefutable_let_patterns)]
19715 if let Path::Parent(ref mut val) = self {
19716 fidl::decode!(Parent, D, val, decoder, _inner_offset, depth)?;
19717 } else {
19718 unreachable!()
19719 }
19720 }
19721 2 => {
19722 #[allow(irrefutable_let_patterns)]
19723 if let Path::ChildFolderUid(_) = self {
19724 } else {
19726 *self = Path::ChildFolderUid(fidl::new_empty!(u64, D));
19728 }
19729 #[allow(irrefutable_let_patterns)]
19730 if let Path::ChildFolderUid(ref mut val) = self {
19731 fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
19732 } else {
19733 unreachable!()
19734 }
19735 }
19736 #[allow(deprecated)]
19737 ordinal => {
19738 for _ in 0..num_handles {
19739 decoder.drop_next_handle()?;
19740 }
19741 *self = Path::__SourceBreaking { unknown_ordinal: ordinal };
19742 }
19743 }
19744 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
19745 return Err(fidl::Error::InvalidNumBytesInEnvelope);
19746 }
19747 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19748 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19749 }
19750 Ok(())
19751 }
19752 }
19753}