#![warn(clippy::all)]
#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
use bitflags::bitflags;
use fidl::client::QueryResponseFut;
use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
use fidl::endpoints::{ControlHandle as _, Responder as _};
use futures::future::{self, MaybeDone, TryFutureExt};
use zx_status;
pub const MAX_ATTRIBUTES: u64 = 131;
pub const MAX_ATTRIBUTE_VALUES: u64 = 255;
pub const MAX_ATTRIBUTE_VALUE_LENGTH: u64 = 65535;
pub const MAX_CUSTOM_ATTRIBUTES: u64 = 127;
pub const MAX_FILESYSTEM_ITEMS: u16 = 16;
pub const MAX_MEDIA_PLAYER_ITEMS: u16 = 16;
pub const MAX_NOTIFICATIONS: u8 = 255;
pub const MAX_NOW_PLAYING_ITEMS: u16 = 16;
pub const MAX_NUM_MEDIA_ATTRIBUTES: u8 = 8;
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct MajorPlayerType: u8 {
const AUDIO = 1;
const VIDEO = 2;
const BROADCASTING_AUDIO = 4;
const BROADCASTING_VIDEO = 8;
}
}
impl MajorPlayerType {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u8 {
0
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Notifications: u32 {
const PLAYBACK_STATUS = 1;
const TRACK = 2;
const TRACK_POS = 4;
const BATT_STATUS = 8;
const SYSTEM_STATUS = 16;
const PLAYER_APPLICATION_SETTINGS = 32;
const ADDRESSED_PLAYER = 64;
const VOLUME = 128;
const AVAILABLE_PLAYERS = 256;
const CONNECTION = 65536;
}
}
impl Notifications {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
0
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct PlayerFeatureBits: u64 {
const SELECT = 72057594037927936;
const UP = 144115188075855872;
const DOWN = 288230376151711744;
const LEFT = 576460752303423488;
const RIGHT = 1152921504606846976;
const RIGHT_UP = 2305843009213693952;
const RIGHT_DOWN = 4611686018427387904;
const LEFT_UP = 9223372036854775808;
const LEFT_DOWN = 281474976710656;
const ROOT_MENU = 562949953421312;
const SETUP_MENU = 1125899906842624;
const CONTENTS_MENU = 2251799813685248;
const FAVORITE_MENU = 4503599627370496;
const EXIT = 9007199254740992;
const ZERO = 18014398509481984;
const ONE = 36028797018963968;
const TWO = 1099511627776;
const THREE = 2199023255552;
const FOUR = 4398046511104;
const FIVE = 8796093022208;
const SIX = 17592186044416;
const SEVEN = 35184372088832;
const EIGHT = 70368744177664;
const NINE = 140737488355328;
const DOT = 4294967296;
const ENTER = 8589934592;
const CLEAR = 17179869184;
const CHANNEL_UP = 34359738368;
const CHANNEL_DOWN = 68719476736;
const PREVIOUS_CHANNEL = 137438953472;
const SOUND_SELECT = 274877906944;
const INPUT_SELECT = 549755813888;
const DISPLAY_INFORMATION = 16777216;
const HELP = 33554432;
const PAGE_UP = 67108864;
const PAGE_DOWN = 134217728;
const POWER = 268435456;
const VOLUME_UP = 536870912;
const VOLUME_DOWN = 1073741824;
const MUTE = 2147483648;
const PLAY = 65536;
const STOP = 131072;
const PAUSE = 262144;
const RECORD = 524288;
const REWIND = 1048576;
const FAST_FORWARD = 2097152;
const EJECT = 4194304;
const FORWARD = 8388608;
const BACKWARD = 256;
const ANGLE = 512;
const SUBPICTURE = 1024;
const F1 = 2048;
const F2 = 4096;
const F3 = 8192;
const F4 = 16384;
const F5 = 32768;
const VENDOR_UNIQUE = 1;
const BASIC_GROUP_NAVIGATION = 2;
const ADVANCED_CONTROL_PLAYER = 4;
const BROWSING = 8;
const SEARCHING = 16;
const ADD_TO_NOW_PLAYING = 32;
const UIDS_UNIQUE_IN_PLAYER_BROWSE_TREE = 64;
const ONLY_BROWSABLE_WHEN_ADDRESSED = 128;
}
}
impl PlayerFeatureBits {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u64 {
0
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct PlayerFeatureBitsExt: u64 {
const ONLY_SEARCHABLE_WHEN_ADDRESSED = 72057594037927936;
const NOW_PLAYING = 144115188075855872;
const UID_PERSISTENCY = 288230376151711744;
const NUMBER_OF_ITEMS = 576460752303423488;
const COVER_ART = 1152921504606846976;
}
}
impl PlayerFeatureBitsExt {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u64 {
0
}
}
bitflags! {
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct PlayerSubType: u32 {
const AUDIO_BOOK = 1;
const PODCAST = 2;
}
}
impl PlayerSubType {
#[deprecated = "Strict bits should not use `has_unknown_bits`"]
#[inline(always)]
pub fn has_unknown_bits(&self) -> bool {
false
}
#[deprecated = "Strict bits should not use `get_unknown_bits`"]
#[inline(always)]
pub fn get_unknown_bits(&self) -> u32 {
0
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum AvcPanelCommand {
Select = 0,
Up = 1,
Down = 2,
Left = 3,
Right = 4,
RootMenu = 9,
ContentsMenu = 11,
FavoriteMenu = 12,
Exit = 13,
OnDemandMenu = 14,
AppsMenu = 15,
Key0 = 32,
Key1 = 33,
Key2 = 34,
Key3 = 35,
Key4 = 36,
Key5 = 37,
Key6 = 38,
Key7 = 39,
Key8 = 40,
Key9 = 41,
Dot = 42,
Enter = 43,
ChannelUp = 48,
ChannelDown = 49,
ChannelPrevious = 50,
InputSelect = 52,
Info = 53,
Help = 54,
PageUp = 55,
PageDown = 56,
Lock = 58,
Power = 64,
VolumeUp = 65,
VolumeDown = 66,
Mute = 67,
Play = 68,
Stop = 69,
Pause = 70,
Record = 71,
Rewind = 72,
FastForward = 73,
Eject = 74,
Forward = 75,
Backward = 76,
List = 77,
F1 = 113,
F2 = 114,
F3 = 115,
F4 = 116,
F5 = 117,
F6 = 118,
F7 = 119,
F8 = 120,
F9 = 121,
Red = 122,
Green = 123,
Blue = 124,
Yellow = 125,
}
impl AvcPanelCommand {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
0 => Some(Self::Select),
1 => Some(Self::Up),
2 => Some(Self::Down),
3 => Some(Self::Left),
4 => Some(Self::Right),
9 => Some(Self::RootMenu),
11 => Some(Self::ContentsMenu),
12 => Some(Self::FavoriteMenu),
13 => Some(Self::Exit),
14 => Some(Self::OnDemandMenu),
15 => Some(Self::AppsMenu),
32 => Some(Self::Key0),
33 => Some(Self::Key1),
34 => Some(Self::Key2),
35 => Some(Self::Key3),
36 => Some(Self::Key4),
37 => Some(Self::Key5),
38 => Some(Self::Key6),
39 => Some(Self::Key7),
40 => Some(Self::Key8),
41 => Some(Self::Key9),
42 => Some(Self::Dot),
43 => Some(Self::Enter),
48 => Some(Self::ChannelUp),
49 => Some(Self::ChannelDown),
50 => Some(Self::ChannelPrevious),
52 => Some(Self::InputSelect),
53 => Some(Self::Info),
54 => Some(Self::Help),
55 => Some(Self::PageUp),
56 => Some(Self::PageDown),
58 => Some(Self::Lock),
64 => Some(Self::Power),
65 => Some(Self::VolumeUp),
66 => Some(Self::VolumeDown),
67 => Some(Self::Mute),
68 => Some(Self::Play),
69 => Some(Self::Stop),
70 => Some(Self::Pause),
71 => Some(Self::Record),
72 => Some(Self::Rewind),
73 => Some(Self::FastForward),
74 => Some(Self::Eject),
75 => Some(Self::Forward),
76 => Some(Self::Backward),
77 => Some(Self::List),
113 => Some(Self::F1),
114 => Some(Self::F2),
115 => Some(Self::F3),
116 => Some(Self::F4),
117 => Some(Self::F5),
118 => Some(Self::F6),
119 => Some(Self::F7),
120 => Some(Self::F8),
121 => Some(Self::F9),
122 => Some(Self::Red),
123 => Some(Self::Green),
124 => Some(Self::Blue),
125 => Some(Self::Yellow),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum BatteryStatus {
Normal = 0,
Warning = 1,
Critical = 2,
External = 3,
FullCharge = 4,
Reserved = 5,
}
impl BatteryStatus {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
0 => Some(Self::Normal),
1 => Some(Self::Warning),
2 => Some(Self::Critical),
3 => Some(Self::External),
4 => Some(Self::FullCharge),
5 => Some(Self::Reserved),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum BrowseControllerError {
UnknownFailure = 1,
TimedOut = 2,
RemoteNotConnected = 3,
CommandNotImplemented = 4,
CommandRejected = 5,
CommandUnexpected = 6,
PacketEncoding = 7,
ProtocolError = 8,
ConnectionError = 9,
UidChanged = 10,
InvalidDirection = 11,
InvalidId = 12,
InvalidScope = 13,
RangeOutOfBounds = 14,
ItemNotPlayable = 15,
MediaInUse = 16,
PlayerNotBrowsable = 17,
PlayerNotAddressed = 18,
NoValidResults = 19,
NoAvailablePlayers = 20,
}
impl BrowseControllerError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::UnknownFailure),
2 => Some(Self::TimedOut),
3 => Some(Self::RemoteNotConnected),
4 => Some(Self::CommandNotImplemented),
5 => Some(Self::CommandRejected),
6 => Some(Self::CommandUnexpected),
7 => Some(Self::PacketEncoding),
8 => Some(Self::ProtocolError),
9 => Some(Self::ConnectionError),
10 => Some(Self::UidChanged),
11 => Some(Self::InvalidDirection),
12 => Some(Self::InvalidId),
13 => Some(Self::InvalidScope),
14 => Some(Self::RangeOutOfBounds),
15 => Some(Self::ItemNotPlayable),
16 => Some(Self::MediaInUse),
17 => Some(Self::PlayerNotBrowsable),
18 => Some(Self::PlayerNotAddressed),
19 => Some(Self::NoValidResults),
20 => Some(Self::NoAvailablePlayers),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum ControllerError {
UnknownFailure = 1,
TimedOut = 2,
RemoteNotConnected = 3,
CommandNotImplemented = 4,
CommandRejected = 5,
CommandUnexpected = 6,
InvalidArguments = 7,
PacketEncoding = 8,
ProtocolError = 9,
ConnectionError = 10,
UnexpectedResponse = 11,
}
impl ControllerError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::UnknownFailure),
2 => Some(Self::TimedOut),
3 => Some(Self::RemoteNotConnected),
4 => Some(Self::CommandNotImplemented),
5 => Some(Self::CommandRejected),
6 => Some(Self::CommandUnexpected),
7 => Some(Self::InvalidArguments),
8 => Some(Self::PacketEncoding),
9 => Some(Self::ProtocolError),
10 => Some(Self::ConnectionError),
11 => Some(Self::UnexpectedResponse),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum Equalizer {
Off = 1,
On = 2,
}
impl Equalizer {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::Off),
2 => Some(Self::On),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum FolderType {
Mixed = 0,
Titles = 1,
Albums = 2,
Artists = 3,
Genres = 4,
Playlists = 5,
Years = 6,
}
impl FolderType {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
0 => Some(Self::Mixed),
1 => Some(Self::Titles),
2 => Some(Self::Albums),
3 => Some(Self::Artists),
4 => Some(Self::Genres),
5 => Some(Self::Playlists),
6 => Some(Self::Years),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum MediaAttributeId {
Title = 1,
ArtistName = 2,
AlbumName = 3,
TrackNumber = 4,
TotalNumberOfTracks = 5,
Genre = 6,
PlayingTime = 7,
DefaultCoverArt = 8,
}
impl MediaAttributeId {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::Title),
2 => Some(Self::ArtistName),
3 => Some(Self::AlbumName),
4 => Some(Self::TrackNumber),
5 => Some(Self::TotalNumberOfTracks),
6 => Some(Self::Genre),
7 => Some(Self::PlayingTime),
8 => Some(Self::DefaultCoverArt),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum MediaType {
Audio = 0,
Video = 1,
}
impl MediaType {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
0 => Some(Self::Audio),
1 => Some(Self::Video),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum NotificationEvent {
PlaybackStatusChanged = 1,
TrackChanged = 2,
TrackReachedEnd = 3,
TrackReachedStart = 4,
TrackPosChanged = 5,
BattStatusChanged = 6,
SystemStatusChanged = 7,
PlayerApplicationSettingChanged = 8,
NowPlayingContentChanged = 9,
AvailablePlayersChanged = 10,
AddressedPlayerChanged = 11,
UidsChanged = 12,
VolumeChanged = 13,
}
impl NotificationEvent {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::PlaybackStatusChanged),
2 => Some(Self::TrackChanged),
3 => Some(Self::TrackReachedEnd),
4 => Some(Self::TrackReachedStart),
5 => Some(Self::TrackPosChanged),
6 => Some(Self::BattStatusChanged),
7 => Some(Self::SystemStatusChanged),
8 => Some(Self::PlayerApplicationSettingChanged),
9 => Some(Self::NowPlayingContentChanged),
10 => Some(Self::AvailablePlayersChanged),
11 => Some(Self::AddressedPlayerChanged),
12 => Some(Self::UidsChanged),
13 => Some(Self::VolumeChanged),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum PlaybackStatus {
Stopped = 0,
Playing = 1,
Paused = 2,
FwdSeek = 3,
RevSeek = 4,
Error = 255,
}
impl PlaybackStatus {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
0 => Some(Self::Stopped),
1 => Some(Self::Playing),
2 => Some(Self::Paused),
3 => Some(Self::FwdSeek),
4 => Some(Self::RevSeek),
255 => Some(Self::Error),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum PlayerApplicationSettingAttributeId {
Equalizer = 1,
RepeatStatusMode = 2,
ShuffleMode = 3,
ScanMode = 4,
}
impl PlayerApplicationSettingAttributeId {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::Equalizer),
2 => Some(Self::RepeatStatusMode),
3 => Some(Self::ShuffleMode),
4 => Some(Self::ScanMode),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum RepeatStatusMode {
Off = 1,
SingleTrackRepeat = 2,
AllTrackRepeat = 3,
GroupRepeat = 4,
}
impl RepeatStatusMode {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::Off),
2 => Some(Self::SingleTrackRepeat),
3 => Some(Self::AllTrackRepeat),
4 => Some(Self::GroupRepeat),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum ScanMode {
Off = 1,
AllTrackScan = 2,
GroupScan = 3,
}
impl ScanMode {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::Off),
2 => Some(Self::AllTrackScan),
3 => Some(Self::GroupScan),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum ShuffleMode {
Off = 1,
AllTrackShuffle = 2,
GroupShuffle = 3,
}
impl ShuffleMode {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::Off),
2 => Some(Self::AllTrackShuffle),
3 => Some(Self::GroupShuffle),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum SystemStatus {
PowerOn = 0,
PowerOff = 1,
Unplugged = 2,
}
impl SystemStatus {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
0 => Some(Self::PowerOn),
1 => Some(Self::PowerOff),
2 => Some(Self::Unplugged),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u8 {
self as u8
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum TargetAvcError {
RejectedInvalidCommand = 0,
RejectedInvalidParameter = 1,
RejectedParameterContentError = 2,
RejectedInternalError = 3,
RejectedUidChanged = 5,
RejectedInvalidPlayerId = 17,
RejectedNoAvailablePlayers = 21,
RejectedAddressedPlayerChanged = 22,
}
impl TargetAvcError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::RejectedInvalidCommand),
1 => Some(Self::RejectedInvalidParameter),
2 => Some(Self::RejectedParameterContentError),
3 => Some(Self::RejectedInternalError),
5 => Some(Self::RejectedUidChanged),
17 => Some(Self::RejectedInvalidPlayerId),
21 => Some(Self::RejectedNoAvailablePlayers),
22 => Some(Self::RejectedAddressedPlayerChanged),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum TargetPassthroughError {
CommandNotImplemented = 1,
CommandRejected = 2,
}
impl TargetPassthroughError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::CommandNotImplemented),
2 => Some(Self::CommandRejected),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u32 {
self as u32
}
#[deprecated = "Strict enums should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct AbsoluteVolumeHandlerGetCurrentVolumeResponse {
pub volume: u8,
}
impl fidl::Persistable for AbsoluteVolumeHandlerGetCurrentVolumeResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct AbsoluteVolumeHandlerOnVolumeChangedResponse {
pub new_volume: u8,
}
impl fidl::Persistable for AbsoluteVolumeHandlerOnVolumeChangedResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct AbsoluteVolumeHandlerSetVolumeRequest {
pub requested_volume: u8,
}
impl fidl::Persistable for AbsoluteVolumeHandlerSetVolumeRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct AbsoluteVolumeHandlerSetVolumeResponse {
pub set_volume: u8,
}
impl fidl::Persistable for AbsoluteVolumeHandlerSetVolumeResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct AddressedPlayerId {
pub id: u16,
}
impl fidl::Persistable for AddressedPlayerId {}
#[derive(Clone, Debug, PartialEq)]
pub struct BrowseControllerChangePathRequest {
pub path: Path,
}
impl fidl::Persistable for BrowseControllerChangePathRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BrowseControllerGetFileSystemItemsRequest {
pub start_index: u32,
pub end_index: u32,
pub attribute_option: AttributeRequestOption,
}
impl fidl::Persistable for BrowseControllerGetFileSystemItemsRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BrowseControllerGetMediaPlayerItemsRequest {
pub start_index: u32,
pub end_index: u32,
}
impl fidl::Persistable for BrowseControllerGetMediaPlayerItemsRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct BrowseControllerGetNowPlayingItemsRequest {
pub start_index: u32,
pub end_index: u32,
pub attribute_option: AttributeRequestOption,
}
impl fidl::Persistable for BrowseControllerGetNowPlayingItemsRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BrowseControllerPlayFileSystemItemRequest {
pub uid: u64,
}
impl fidl::Persistable for BrowseControllerPlayFileSystemItemRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BrowseControllerPlayNowPlayingItemRequest {
pub uid: u64,
}
impl fidl::Persistable for BrowseControllerPlayNowPlayingItemRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BrowseControllerSetBrowsedPlayerRequest {
pub player_id: u16,
}
impl fidl::Persistable for BrowseControllerSetBrowsedPlayerRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct BrowseControllerChangePathResponse {
pub num_items: u32,
}
impl fidl::Persistable for BrowseControllerChangePathResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct BrowseControllerGetFileSystemItemsResponse {
pub items: Vec<FileSystemItem>,
}
impl fidl::Persistable for BrowseControllerGetFileSystemItemsResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct BrowseControllerGetMediaPlayerItemsResponse {
pub items: Vec<MediaPlayerItem>,
}
impl fidl::Persistable for BrowseControllerGetMediaPlayerItemsResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct BrowseControllerGetNowPlayingItemsResponse {
pub items: Vec<MediaElementItem>,
}
impl fidl::Persistable for BrowseControllerGetNowPlayingItemsResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ControllerGetPlayerApplicationSettingsRequest {
pub attribute_ids: Vec<PlayerApplicationSettingAttributeId>,
}
impl fidl::Persistable for ControllerGetPlayerApplicationSettingsRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ControllerInformBatteryStatusRequest {
pub battery_status: BatteryStatus,
}
impl fidl::Persistable for ControllerInformBatteryStatusRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct ControllerOnNotificationRequest {
pub timestamp: i64,
pub notification: Notification,
}
impl fidl::Persistable for ControllerOnNotificationRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ControllerSendCommandRequest {
pub command: AvcPanelCommand,
}
impl fidl::Persistable for ControllerSendCommandRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ControllerSetAbsoluteVolumeRequest {
pub requested_volume: u8,
}
impl fidl::Persistable for ControllerSetAbsoluteVolumeRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ControllerSetAddressedPlayerRequest {
pub player_id: u16,
}
impl fidl::Persistable for ControllerSetAddressedPlayerRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ControllerSetNotificationFilterRequest {
pub notifications: Notifications,
pub position_change_interval: u32,
}
impl fidl::Persistable for ControllerSetNotificationFilterRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct ControllerSetPlayerApplicationSettingsRequest {
pub requested_settings: PlayerApplicationSettings,
}
impl fidl::Persistable for ControllerSetPlayerApplicationSettingsRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct ControllerGetMediaAttributesResponse {
pub attributes: MediaAttributes,
}
impl fidl::Persistable for ControllerGetMediaAttributesResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct ControllerGetPlayStatusResponse {
pub play_status: PlayStatus,
}
impl fidl::Persistable for ControllerGetPlayStatusResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct ControllerGetPlayerApplicationSettingsResponse {
pub current_settings: PlayerApplicationSettings,
}
impl fidl::Persistable for ControllerGetPlayerApplicationSettingsResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct ControllerSetAbsoluteVolumeResponse {
pub set_volume: u8,
}
impl fidl::Persistable for ControllerSetAbsoluteVolumeResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct ControllerSetPlayerApplicationSettingsResponse {
pub set_settings: PlayerApplicationSettings,
}
impl fidl::Persistable for ControllerSetPlayerApplicationSettingsResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CustomAttributeValue {
pub description: String,
pub value: u8,
}
impl fidl::Persistable for CustomAttributeValue {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Parent;
impl fidl::Persistable for Parent {}
#[derive(Debug, PartialEq)]
pub struct PeerManagerGetBrowseControllerForTargetRequest {
pub peer_id: fidl_fuchsia_bluetooth::PeerId,
pub client: fidl::endpoints::ServerEnd<BrowseControllerMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for PeerManagerGetBrowseControllerForTargetRequest
{
}
#[derive(Debug, PartialEq)]
pub struct PeerManagerGetControllerForTargetRequest {
pub peer_id: fidl_fuchsia_bluetooth::PeerId,
pub client: fidl::endpoints::ServerEnd<ControllerMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for PeerManagerGetControllerForTargetRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PeerManagerRegisterTargetHandlerRequest {
pub handler: fidl::endpoints::ClientEnd<TargetHandlerMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for PeerManagerRegisterTargetHandlerRequest
{
}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PeerManagerSetAbsoluteVolumeHandlerRequest {
pub handler: fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for PeerManagerSetAbsoluteVolumeHandlerRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct TargetHandlerGetNotificationRequest {
pub event_id: NotificationEvent,
}
impl fidl::Persistable for TargetHandlerGetNotificationRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct TargetHandlerGetPlayerApplicationSettingsRequest {
pub attribute_ids: Vec<PlayerApplicationSettingAttributeId>,
}
impl fidl::Persistable for TargetHandlerGetPlayerApplicationSettingsRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct TargetHandlerSendCommandRequest {
pub command: AvcPanelCommand,
pub pressed: bool,
}
impl fidl::Persistable for TargetHandlerSendCommandRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct TargetHandlerSetAddressedPlayerRequest {
pub player_id: AddressedPlayerId,
}
impl fidl::Persistable for TargetHandlerSetAddressedPlayerRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct TargetHandlerSetPlayerApplicationSettingsRequest {
pub requested_settings: PlayerApplicationSettings,
}
impl fidl::Persistable for TargetHandlerSetPlayerApplicationSettingsRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct TargetHandlerWatchNotificationRequest {
pub event_id: NotificationEvent,
pub current: Notification,
pub pos_change_interval: u32,
}
impl fidl::Persistable for TargetHandlerWatchNotificationRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct TargetHandlerGetEventsSupportedResponse {
pub notification_ids: Vec<NotificationEvent>,
}
impl fidl::Persistable for TargetHandlerGetEventsSupportedResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct TargetHandlerGetMediaAttributesResponse {
pub attributes: MediaAttributes,
}
impl fidl::Persistable for TargetHandlerGetMediaAttributesResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct TargetHandlerGetMediaPlayerItemsResponse {
pub items: Vec<MediaPlayerItem>,
}
impl fidl::Persistable for TargetHandlerGetMediaPlayerItemsResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct TargetHandlerGetNotificationResponse {
pub current_value: Notification,
}
impl fidl::Persistable for TargetHandlerGetNotificationResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct TargetHandlerGetPlayStatusResponse {
pub play_status: PlayStatus,
}
impl fidl::Persistable for TargetHandlerGetPlayStatusResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct TargetHandlerGetPlayerApplicationSettingsResponse {
pub current_settings: PlayerApplicationSettings,
}
impl fidl::Persistable for TargetHandlerGetPlayerApplicationSettingsResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct TargetHandlerListPlayerApplicationSettingAttributesResponse {
pub attributes: Vec<PlayerApplicationSettingAttributeId>,
}
impl fidl::Persistable for TargetHandlerListPlayerApplicationSettingAttributesResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct TargetHandlerSetPlayerApplicationSettingsResponse {
pub set_settings: PlayerApplicationSettings,
}
impl fidl::Persistable for TargetHandlerSetPlayerApplicationSettingsResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct TargetHandlerWatchNotificationResponse {
pub new_value: Notification,
}
impl fidl::Persistable for TargetHandlerWatchNotificationResponse {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct CustomPlayerApplicationSetting {
pub attribute_id: Option<u8>,
pub attribute_name: Option<String>,
pub possible_values: Option<Vec<CustomAttributeValue>>,
pub current_value: Option<u8>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for CustomPlayerApplicationSetting {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct FolderItem {
pub folder_uid: Option<u64>,
pub folder_type: Option<FolderType>,
pub is_playable: Option<bool>,
pub displayable_name: Option<String>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for FolderItem {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct MediaAttributes {
pub title: Option<String>,
pub artist_name: Option<String>,
pub album_name: Option<String>,
pub track_number: Option<String>,
pub total_number_of_tracks: Option<String>,
pub genre: Option<String>,
pub playing_time: Option<String>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for MediaAttributes {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct MediaElementItem {
pub media_element_uid: Option<u64>,
pub media_type: Option<MediaType>,
pub displayable_name: Option<String>,
pub attributes: Option<MediaAttributes>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for MediaElementItem {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct MediaPlayerItem {
pub player_id: Option<u16>,
pub major_type: Option<MajorPlayerType>,
pub sub_type: Option<PlayerSubType>,
pub playback_status: Option<PlaybackStatus>,
pub displayable_name: Option<String>,
pub feature_bits: Option<PlayerFeatureBits>,
pub feature_bits_ext: Option<PlayerFeatureBitsExt>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for MediaPlayerItem {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct Notification {
pub status: Option<PlaybackStatus>,
pub track_id: Option<u64>,
pub pos: Option<u32>,
pub battery_status: Option<BatteryStatus>,
pub system_status: Option<SystemStatus>,
pub application_settings: Option<PlayerApplicationSettings>,
pub player_id: Option<u16>,
pub volume: Option<u8>,
pub device_connected: Option<bool>,
pub available_players_changed: Option<bool>,
pub addressed_player: Option<u16>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for Notification {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct PlayStatus {
pub song_length: Option<u32>,
pub song_position: Option<u32>,
pub playback_status: Option<PlaybackStatus>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for PlayStatus {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct PlayerApplicationSettings {
pub equalizer: Option<Equalizer>,
pub repeat_status_mode: Option<RepeatStatusMode>,
pub shuffle_mode: Option<ShuffleMode>,
pub scan_mode: Option<ScanMode>,
pub custom_settings: Option<Vec<CustomPlayerApplicationSetting>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for PlayerApplicationSettings {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum AttributeRequestOption {
GetAll(bool),
AttributeList(Vec<MediaAttributeId>),
}
impl AttributeRequestOption {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::GetAll(_) => 1,
Self::AttributeList(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for AttributeRequestOption {}
#[derive(Clone, Debug, PartialEq)]
pub enum FileSystemItem {
Folder(FolderItem),
MediaElement(MediaElementItem),
}
impl FileSystemItem {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Folder(_) => 1,
Self::MediaElement(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for FileSystemItem {}
#[derive(Clone, Debug)]
pub enum Path {
Parent(Parent),
ChildFolderUid(u64),
#[doc(hidden)]
__SourceBreaking {
unknown_ordinal: u64,
},
}
#[macro_export]
macro_rules! PathUnknown {
() => {
_
};
}
impl PartialEq for Path {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::Parent(x), Self::Parent(y)) => *x == *y,
(Self::ChildFolderUid(x), Self::ChildFolderUid(y)) => *x == *y,
_ => false,
}
}
}
impl Path {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::Parent(_) => 1,
Self::ChildFolderUid(_) => 2,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn unknown_variant_for_testing() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { .. } => true,
_ => false,
}
}
}
impl fidl::Persistable for Path {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct AbsoluteVolumeHandlerMarker;
impl fidl::endpoints::ProtocolMarker for AbsoluteVolumeHandlerMarker {
type Proxy = AbsoluteVolumeHandlerProxy;
type RequestStream = AbsoluteVolumeHandlerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = AbsoluteVolumeHandlerSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) AbsoluteVolumeHandler";
}
pub trait AbsoluteVolumeHandlerProxyInterface: Send + Sync {
type SetVolumeResponseFut: std::future::Future<Output = Result<u8, fidl::Error>> + Send;
fn r#set_volume(&self, requested_volume: u8) -> Self::SetVolumeResponseFut;
type OnVolumeChangedResponseFut: std::future::Future<Output = Result<u8, fidl::Error>> + Send;
fn r#on_volume_changed(&self) -> Self::OnVolumeChangedResponseFut;
type GetCurrentVolumeResponseFut: std::future::Future<Output = Result<u8, fidl::Error>> + Send;
fn r#get_current_volume(&self) -> Self::GetCurrentVolumeResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct AbsoluteVolumeHandlerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for AbsoluteVolumeHandlerSynchronousProxy {
type Proxy = AbsoluteVolumeHandlerProxy;
type Protocol = AbsoluteVolumeHandlerMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl AbsoluteVolumeHandlerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<AbsoluteVolumeHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<AbsoluteVolumeHandlerEvent, fidl::Error> {
AbsoluteVolumeHandlerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#set_volume(
&self,
mut requested_volume: u8,
___deadline: zx::MonotonicInstant,
) -> Result<u8, fidl::Error> {
let _response = self.client.send_query::<
AbsoluteVolumeHandlerSetVolumeRequest,
AbsoluteVolumeHandlerSetVolumeResponse,
>(
(requested_volume,),
0x2796843ecbdecc65,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.set_volume)
}
pub fn r#on_volume_changed(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<u8, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
AbsoluteVolumeHandlerOnVolumeChangedResponse,
>(
(),
0x1a1f9cffd4f2a74,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.new_volume)
}
pub fn r#get_current_volume(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<u8, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
AbsoluteVolumeHandlerGetCurrentVolumeResponse,
>(
(),
0x6ae76e0c77ac35ff,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.volume)
}
}
#[derive(Debug, Clone)]
pub struct AbsoluteVolumeHandlerProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for AbsoluteVolumeHandlerProxy {
type Protocol = AbsoluteVolumeHandlerMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl AbsoluteVolumeHandlerProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<AbsoluteVolumeHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> AbsoluteVolumeHandlerEventStream {
AbsoluteVolumeHandlerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#set_volume(
&self,
mut requested_volume: u8,
) -> fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect> {
AbsoluteVolumeHandlerProxyInterface::r#set_volume(self, requested_volume)
}
pub fn r#on_volume_changed(
&self,
) -> fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect> {
AbsoluteVolumeHandlerProxyInterface::r#on_volume_changed(self)
}
pub fn r#get_current_volume(
&self,
) -> fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect> {
AbsoluteVolumeHandlerProxyInterface::r#get_current_volume(self)
}
}
impl AbsoluteVolumeHandlerProxyInterface for AbsoluteVolumeHandlerProxy {
type SetVolumeResponseFut =
fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#set_volume(&self, mut requested_volume: u8) -> Self::SetVolumeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<u8, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
AbsoluteVolumeHandlerSetVolumeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2796843ecbdecc65,
>(_buf?)?;
Ok(_response.set_volume)
}
self.client.send_query_and_decode::<AbsoluteVolumeHandlerSetVolumeRequest, u8>(
(requested_volume,),
0x2796843ecbdecc65,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type OnVolumeChangedResponseFut =
fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#on_volume_changed(&self) -> Self::OnVolumeChangedResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<u8, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
AbsoluteVolumeHandlerOnVolumeChangedResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1a1f9cffd4f2a74,
>(_buf?)?;
Ok(_response.new_volume)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u8>(
(),
0x1a1f9cffd4f2a74,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetCurrentVolumeResponseFut =
fidl::client::QueryResponseFut<u8, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_current_volume(&self) -> Self::GetCurrentVolumeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<u8, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
AbsoluteVolumeHandlerGetCurrentVolumeResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6ae76e0c77ac35ff,
>(_buf?)?;
Ok(_response.volume)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, u8>(
(),
0x6ae76e0c77ac35ff,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct AbsoluteVolumeHandlerEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for AbsoluteVolumeHandlerEventStream {}
impl futures::stream::FusedStream for AbsoluteVolumeHandlerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for AbsoluteVolumeHandlerEventStream {
type Item = Result<AbsoluteVolumeHandlerEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(AbsoluteVolumeHandlerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum AbsoluteVolumeHandlerEvent {}
impl AbsoluteVolumeHandlerEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<AbsoluteVolumeHandlerEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<AbsoluteVolumeHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct AbsoluteVolumeHandlerRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for AbsoluteVolumeHandlerRequestStream {}
impl futures::stream::FusedStream for AbsoluteVolumeHandlerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for AbsoluteVolumeHandlerRequestStream {
type Protocol = AbsoluteVolumeHandlerMarker;
type ControlHandle = AbsoluteVolumeHandlerControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
AbsoluteVolumeHandlerControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for AbsoluteVolumeHandlerRequestStream {
type Item = Result<AbsoluteVolumeHandlerRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled AbsoluteVolumeHandlerRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x2796843ecbdecc65 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(AbsoluteVolumeHandlerSetVolumeRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<AbsoluteVolumeHandlerSetVolumeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = AbsoluteVolumeHandlerControlHandle {
inner: this.inner.clone(),
};
Ok(AbsoluteVolumeHandlerRequest::SetVolume {requested_volume: req.requested_volume,
responder: AbsoluteVolumeHandlerSetVolumeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1a1f9cffd4f2a74 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = AbsoluteVolumeHandlerControlHandle {
inner: this.inner.clone(),
};
Ok(AbsoluteVolumeHandlerRequest::OnVolumeChanged {
responder: AbsoluteVolumeHandlerOnVolumeChangedResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6ae76e0c77ac35ff => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = AbsoluteVolumeHandlerControlHandle {
inner: this.inner.clone(),
};
Ok(AbsoluteVolumeHandlerRequest::GetCurrentVolume {
responder: AbsoluteVolumeHandlerGetCurrentVolumeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <AbsoluteVolumeHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum AbsoluteVolumeHandlerRequest {
SetVolume { requested_volume: u8, responder: AbsoluteVolumeHandlerSetVolumeResponder },
OnVolumeChanged { responder: AbsoluteVolumeHandlerOnVolumeChangedResponder },
GetCurrentVolume { responder: AbsoluteVolumeHandlerGetCurrentVolumeResponder },
}
impl AbsoluteVolumeHandlerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_set_volume(self) -> Option<(u8, AbsoluteVolumeHandlerSetVolumeResponder)> {
if let AbsoluteVolumeHandlerRequest::SetVolume { requested_volume, responder } = self {
Some((requested_volume, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_on_volume_changed(self) -> Option<(AbsoluteVolumeHandlerOnVolumeChangedResponder)> {
if let AbsoluteVolumeHandlerRequest::OnVolumeChanged { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_current_volume(
self,
) -> Option<(AbsoluteVolumeHandlerGetCurrentVolumeResponder)> {
if let AbsoluteVolumeHandlerRequest::GetCurrentVolume { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
AbsoluteVolumeHandlerRequest::SetVolume { .. } => "set_volume",
AbsoluteVolumeHandlerRequest::OnVolumeChanged { .. } => "on_volume_changed",
AbsoluteVolumeHandlerRequest::GetCurrentVolume { .. } => "get_current_volume",
}
}
}
#[derive(Debug, Clone)]
pub struct AbsoluteVolumeHandlerControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for AbsoluteVolumeHandlerControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl AbsoluteVolumeHandlerControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct AbsoluteVolumeHandlerSetVolumeResponder {
control_handle: std::mem::ManuallyDrop<AbsoluteVolumeHandlerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for AbsoluteVolumeHandlerSetVolumeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for AbsoluteVolumeHandlerSetVolumeResponder {
type ControlHandle = AbsoluteVolumeHandlerControlHandle;
fn control_handle(&self) -> &AbsoluteVolumeHandlerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl AbsoluteVolumeHandlerSetVolumeResponder {
pub fn send(self, mut set_volume: u8) -> Result<(), fidl::Error> {
let _result = self.send_raw(set_volume);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut set_volume: u8) -> Result<(), fidl::Error> {
let _result = self.send_raw(set_volume);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut set_volume: u8) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<AbsoluteVolumeHandlerSetVolumeResponse>(
(set_volume,),
self.tx_id,
0x2796843ecbdecc65,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct AbsoluteVolumeHandlerOnVolumeChangedResponder {
control_handle: std::mem::ManuallyDrop<AbsoluteVolumeHandlerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for AbsoluteVolumeHandlerOnVolumeChangedResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for AbsoluteVolumeHandlerOnVolumeChangedResponder {
type ControlHandle = AbsoluteVolumeHandlerControlHandle;
fn control_handle(&self) -> &AbsoluteVolumeHandlerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl AbsoluteVolumeHandlerOnVolumeChangedResponder {
pub fn send(self, mut new_volume: u8) -> Result<(), fidl::Error> {
let _result = self.send_raw(new_volume);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut new_volume: u8) -> Result<(), fidl::Error> {
let _result = self.send_raw(new_volume);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut new_volume: u8) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<AbsoluteVolumeHandlerOnVolumeChangedResponse>(
(new_volume,),
self.tx_id,
0x1a1f9cffd4f2a74,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct AbsoluteVolumeHandlerGetCurrentVolumeResponder {
control_handle: std::mem::ManuallyDrop<AbsoluteVolumeHandlerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for AbsoluteVolumeHandlerGetCurrentVolumeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for AbsoluteVolumeHandlerGetCurrentVolumeResponder {
type ControlHandle = AbsoluteVolumeHandlerControlHandle;
fn control_handle(&self) -> &AbsoluteVolumeHandlerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl AbsoluteVolumeHandlerGetCurrentVolumeResponder {
pub fn send(self, mut volume: u8) -> Result<(), fidl::Error> {
let _result = self.send_raw(volume);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut volume: u8) -> Result<(), fidl::Error> {
let _result = self.send_raw(volume);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut volume: u8) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<AbsoluteVolumeHandlerGetCurrentVolumeResponse>(
(volume,),
self.tx_id,
0x6ae76e0c77ac35ff,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct BrowseControllerMarker;
impl fidl::endpoints::ProtocolMarker for BrowseControllerMarker {
type Proxy = BrowseControllerProxy;
type RequestStream = BrowseControllerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = BrowseControllerSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) BrowseController";
}
pub type BrowseControllerGetMediaPlayerItemsResult =
Result<Vec<MediaPlayerItem>, BrowseControllerError>;
pub type BrowseControllerGetNowPlayingItemsResult =
Result<Vec<MediaElementItem>, BrowseControllerError>;
pub type BrowseControllerGetFileSystemItemsResult =
Result<Vec<FileSystemItem>, BrowseControllerError>;
pub type BrowseControllerChangePathResult = Result<u32, BrowseControllerError>;
pub type BrowseControllerPlayFileSystemItemResult = Result<(), BrowseControllerError>;
pub type BrowseControllerPlayNowPlayingItemResult = Result<(), BrowseControllerError>;
pub type BrowseControllerSetBrowsedPlayerResult = Result<(), BrowseControllerError>;
pub trait BrowseControllerProxyInterface: Send + Sync {
type GetMediaPlayerItemsResponseFut: std::future::Future<Output = Result<BrowseControllerGetMediaPlayerItemsResult, fidl::Error>>
+ Send;
fn r#get_media_player_items(
&self,
start_index: u32,
end_index: u32,
) -> Self::GetMediaPlayerItemsResponseFut;
type GetNowPlayingItemsResponseFut: std::future::Future<Output = Result<BrowseControllerGetNowPlayingItemsResult, fidl::Error>>
+ Send;
fn r#get_now_playing_items(
&self,
start_index: u32,
end_index: u32,
attribute_option: &AttributeRequestOption,
) -> Self::GetNowPlayingItemsResponseFut;
type GetFileSystemItemsResponseFut: std::future::Future<Output = Result<BrowseControllerGetFileSystemItemsResult, fidl::Error>>
+ Send;
fn r#get_file_system_items(
&self,
start_index: u32,
end_index: u32,
attribute_option: &AttributeRequestOption,
) -> Self::GetFileSystemItemsResponseFut;
type ChangePathResponseFut: std::future::Future<Output = Result<BrowseControllerChangePathResult, fidl::Error>>
+ Send;
fn r#change_path(&self, path: &Path) -> Self::ChangePathResponseFut;
type PlayFileSystemItemResponseFut: std::future::Future<Output = Result<BrowseControllerPlayFileSystemItemResult, fidl::Error>>
+ Send;
fn r#play_file_system_item(&self, uid: u64) -> Self::PlayFileSystemItemResponseFut;
type PlayNowPlayingItemResponseFut: std::future::Future<Output = Result<BrowseControllerPlayNowPlayingItemResult, fidl::Error>>
+ Send;
fn r#play_now_playing_item(&self, uid: u64) -> Self::PlayNowPlayingItemResponseFut;
type SetBrowsedPlayerResponseFut: std::future::Future<Output = Result<BrowseControllerSetBrowsedPlayerResult, fidl::Error>>
+ Send;
fn r#set_browsed_player(&self, player_id: u16) -> Self::SetBrowsedPlayerResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct BrowseControllerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for BrowseControllerSynchronousProxy {
type Proxy = BrowseControllerProxy;
type Protocol = BrowseControllerMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl BrowseControllerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <BrowseControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<BrowseControllerEvent, fidl::Error> {
BrowseControllerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_media_player_items(
&self,
mut start_index: u32,
mut end_index: u32,
___deadline: zx::MonotonicInstant,
) -> Result<BrowseControllerGetMediaPlayerItemsResult, fidl::Error> {
let _response = self
.client
.send_query::<BrowseControllerGetMediaPlayerItemsRequest, fidl::encoding::ResultType<
BrowseControllerGetMediaPlayerItemsResponse,
BrowseControllerError,
>>(
(start_index, end_index),
0x49c06d30a9aa02ba,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.items))
}
pub fn r#get_now_playing_items(
&self,
mut start_index: u32,
mut end_index: u32,
mut attribute_option: &AttributeRequestOption,
___deadline: zx::MonotonicInstant,
) -> Result<BrowseControllerGetNowPlayingItemsResult, fidl::Error> {
let _response = self
.client
.send_query::<BrowseControllerGetNowPlayingItemsRequest, fidl::encoding::ResultType<
BrowseControllerGetNowPlayingItemsResponse,
BrowseControllerError,
>>(
(start_index, end_index, attribute_option),
0x35f5a88695b46cf7,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.items))
}
pub fn r#get_file_system_items(
&self,
mut start_index: u32,
mut end_index: u32,
mut attribute_option: &AttributeRequestOption,
___deadline: zx::MonotonicInstant,
) -> Result<BrowseControllerGetFileSystemItemsResult, fidl::Error> {
let _response = self
.client
.send_query::<BrowseControllerGetFileSystemItemsRequest, fidl::encoding::ResultType<
BrowseControllerGetFileSystemItemsResponse,
BrowseControllerError,
>>(
(start_index, end_index, attribute_option),
0x5d1415aecee72133,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.items))
}
pub fn r#change_path(
&self,
mut path: &Path,
___deadline: zx::MonotonicInstant,
) -> Result<BrowseControllerChangePathResult, fidl::Error> {
let _response =
self.client
.send_query::<BrowseControllerChangePathRequest, fidl::encoding::ResultType<
BrowseControllerChangePathResponse,
BrowseControllerError,
>>(
(path,),
0x2e0600579d43b51e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.num_items))
}
pub fn r#play_file_system_item(
&self,
mut uid: u64,
___deadline: zx::MonotonicInstant,
) -> Result<BrowseControllerPlayFileSystemItemResult, fidl::Error> {
let _response = self.client.send_query::<
BrowseControllerPlayFileSystemItemRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BrowseControllerError>,
>(
(uid,),
0x57075115ce25cf16,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#play_now_playing_item(
&self,
mut uid: u64,
___deadline: zx::MonotonicInstant,
) -> Result<BrowseControllerPlayNowPlayingItemResult, fidl::Error> {
let _response = self.client.send_query::<
BrowseControllerPlayNowPlayingItemRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BrowseControllerError>,
>(
(uid,),
0x116e151d547fd2d7,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#set_browsed_player(
&self,
mut player_id: u16,
___deadline: zx::MonotonicInstant,
) -> Result<BrowseControllerSetBrowsedPlayerResult, fidl::Error> {
let _response = self.client.send_query::<
BrowseControllerSetBrowsedPlayerRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BrowseControllerError>,
>(
(player_id,),
0x3e3256f57f8848da,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct BrowseControllerProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for BrowseControllerProxy {
type Protocol = BrowseControllerMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl BrowseControllerProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <BrowseControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> BrowseControllerEventStream {
BrowseControllerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_media_player_items(
&self,
mut start_index: u32,
mut end_index: u32,
) -> fidl::client::QueryResponseFut<
BrowseControllerGetMediaPlayerItemsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BrowseControllerProxyInterface::r#get_media_player_items(self, start_index, end_index)
}
pub fn r#get_now_playing_items(
&self,
mut start_index: u32,
mut end_index: u32,
mut attribute_option: &AttributeRequestOption,
) -> fidl::client::QueryResponseFut<
BrowseControllerGetNowPlayingItemsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BrowseControllerProxyInterface::r#get_now_playing_items(
self,
start_index,
end_index,
attribute_option,
)
}
pub fn r#get_file_system_items(
&self,
mut start_index: u32,
mut end_index: u32,
mut attribute_option: &AttributeRequestOption,
) -> fidl::client::QueryResponseFut<
BrowseControllerGetFileSystemItemsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BrowseControllerProxyInterface::r#get_file_system_items(
self,
start_index,
end_index,
attribute_option,
)
}
pub fn r#change_path(
&self,
mut path: &Path,
) -> fidl::client::QueryResponseFut<
BrowseControllerChangePathResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BrowseControllerProxyInterface::r#change_path(self, path)
}
pub fn r#play_file_system_item(
&self,
mut uid: u64,
) -> fidl::client::QueryResponseFut<
BrowseControllerPlayFileSystemItemResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BrowseControllerProxyInterface::r#play_file_system_item(self, uid)
}
pub fn r#play_now_playing_item(
&self,
mut uid: u64,
) -> fidl::client::QueryResponseFut<
BrowseControllerPlayNowPlayingItemResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BrowseControllerProxyInterface::r#play_now_playing_item(self, uid)
}
pub fn r#set_browsed_player(
&self,
mut player_id: u16,
) -> fidl::client::QueryResponseFut<
BrowseControllerSetBrowsedPlayerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
BrowseControllerProxyInterface::r#set_browsed_player(self, player_id)
}
}
impl BrowseControllerProxyInterface for BrowseControllerProxy {
type GetMediaPlayerItemsResponseFut = fidl::client::QueryResponseFut<
BrowseControllerGetMediaPlayerItemsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_media_player_items(
&self,
mut start_index: u32,
mut end_index: u32,
) -> Self::GetMediaPlayerItemsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<BrowseControllerGetMediaPlayerItemsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
BrowseControllerGetMediaPlayerItemsResponse,
BrowseControllerError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x49c06d30a9aa02ba,
>(_buf?)?;
Ok(_response.map(|x| x.items))
}
self.client.send_query_and_decode::<
BrowseControllerGetMediaPlayerItemsRequest,
BrowseControllerGetMediaPlayerItemsResult,
>(
(start_index, end_index,),
0x49c06d30a9aa02ba,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetNowPlayingItemsResponseFut = fidl::client::QueryResponseFut<
BrowseControllerGetNowPlayingItemsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_now_playing_items(
&self,
mut start_index: u32,
mut end_index: u32,
mut attribute_option: &AttributeRequestOption,
) -> Self::GetNowPlayingItemsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<BrowseControllerGetNowPlayingItemsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
BrowseControllerGetNowPlayingItemsResponse,
BrowseControllerError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x35f5a88695b46cf7,
>(_buf?)?;
Ok(_response.map(|x| x.items))
}
self.client.send_query_and_decode::<
BrowseControllerGetNowPlayingItemsRequest,
BrowseControllerGetNowPlayingItemsResult,
>(
(start_index, end_index, attribute_option,),
0x35f5a88695b46cf7,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetFileSystemItemsResponseFut = fidl::client::QueryResponseFut<
BrowseControllerGetFileSystemItemsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_file_system_items(
&self,
mut start_index: u32,
mut end_index: u32,
mut attribute_option: &AttributeRequestOption,
) -> Self::GetFileSystemItemsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<BrowseControllerGetFileSystemItemsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
BrowseControllerGetFileSystemItemsResponse,
BrowseControllerError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5d1415aecee72133,
>(_buf?)?;
Ok(_response.map(|x| x.items))
}
self.client.send_query_and_decode::<
BrowseControllerGetFileSystemItemsRequest,
BrowseControllerGetFileSystemItemsResult,
>(
(start_index, end_index, attribute_option,),
0x5d1415aecee72133,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ChangePathResponseFut = fidl::client::QueryResponseFut<
BrowseControllerChangePathResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#change_path(&self, mut path: &Path) -> Self::ChangePathResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<BrowseControllerChangePathResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
BrowseControllerChangePathResponse,
BrowseControllerError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2e0600579d43b51e,
>(_buf?)?;
Ok(_response.map(|x| x.num_items))
}
self.client.send_query_and_decode::<
BrowseControllerChangePathRequest,
BrowseControllerChangePathResult,
>(
(path,),
0x2e0600579d43b51e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type PlayFileSystemItemResponseFut = fidl::client::QueryResponseFut<
BrowseControllerPlayFileSystemItemResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#play_file_system_item(&self, mut uid: u64) -> Self::PlayFileSystemItemResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<BrowseControllerPlayFileSystemItemResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BrowseControllerError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x57075115ce25cf16,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
BrowseControllerPlayFileSystemItemRequest,
BrowseControllerPlayFileSystemItemResult,
>(
(uid,),
0x57075115ce25cf16,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type PlayNowPlayingItemResponseFut = fidl::client::QueryResponseFut<
BrowseControllerPlayNowPlayingItemResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#play_now_playing_item(&self, mut uid: u64) -> Self::PlayNowPlayingItemResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<BrowseControllerPlayNowPlayingItemResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BrowseControllerError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x116e151d547fd2d7,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
BrowseControllerPlayNowPlayingItemRequest,
BrowseControllerPlayNowPlayingItemResult,
>(
(uid,),
0x116e151d547fd2d7,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetBrowsedPlayerResponseFut = fidl::client::QueryResponseFut<
BrowseControllerSetBrowsedPlayerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_browsed_player(&self, mut player_id: u16) -> Self::SetBrowsedPlayerResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<BrowseControllerSetBrowsedPlayerResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, BrowseControllerError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3e3256f57f8848da,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
BrowseControllerSetBrowsedPlayerRequest,
BrowseControllerSetBrowsedPlayerResult,
>(
(player_id,),
0x3e3256f57f8848da,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct BrowseControllerEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for BrowseControllerEventStream {}
impl futures::stream::FusedStream for BrowseControllerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for BrowseControllerEventStream {
type Item = Result<BrowseControllerEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(BrowseControllerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum BrowseControllerEvent {}
impl BrowseControllerEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<BrowseControllerEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name:
<BrowseControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct BrowseControllerRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for BrowseControllerRequestStream {}
impl futures::stream::FusedStream for BrowseControllerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for BrowseControllerRequestStream {
type Protocol = BrowseControllerMarker;
type ControlHandle = BrowseControllerControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
BrowseControllerControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for BrowseControllerRequestStream {
type Item = Result<BrowseControllerRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled BrowseControllerRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x49c06d30a9aa02ba => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
BrowseControllerGetMediaPlayerItemsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerGetMediaPlayerItemsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
BrowseControllerControlHandle { inner: this.inner.clone() };
Ok(BrowseControllerRequest::GetMediaPlayerItems {
start_index: req.start_index,
end_index: req.end_index,
responder: BrowseControllerGetMediaPlayerItemsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x35f5a88695b46cf7 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
BrowseControllerGetNowPlayingItemsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerGetNowPlayingItemsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
BrowseControllerControlHandle { inner: this.inner.clone() };
Ok(BrowseControllerRequest::GetNowPlayingItems {
start_index: req.start_index,
end_index: req.end_index,
attribute_option: req.attribute_option,
responder: BrowseControllerGetNowPlayingItemsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5d1415aecee72133 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
BrowseControllerGetFileSystemItemsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerGetFileSystemItemsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
BrowseControllerControlHandle { inner: this.inner.clone() };
Ok(BrowseControllerRequest::GetFileSystemItems {
start_index: req.start_index,
end_index: req.end_index,
attribute_option: req.attribute_option,
responder: BrowseControllerGetFileSystemItemsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2e0600579d43b51e => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
BrowseControllerChangePathRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerChangePathRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
BrowseControllerControlHandle { inner: this.inner.clone() };
Ok(BrowseControllerRequest::ChangePath {
path: req.path,
responder: BrowseControllerChangePathResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x57075115ce25cf16 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
BrowseControllerPlayFileSystemItemRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerPlayFileSystemItemRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
BrowseControllerControlHandle { inner: this.inner.clone() };
Ok(BrowseControllerRequest::PlayFileSystemItem {
uid: req.uid,
responder: BrowseControllerPlayFileSystemItemResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x116e151d547fd2d7 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
BrowseControllerPlayNowPlayingItemRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerPlayNowPlayingItemRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
BrowseControllerControlHandle { inner: this.inner.clone() };
Ok(BrowseControllerRequest::PlayNowPlayingItem {
uid: req.uid,
responder: BrowseControllerPlayNowPlayingItemResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3e3256f57f8848da => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
BrowseControllerSetBrowsedPlayerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<BrowseControllerSetBrowsedPlayerRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
BrowseControllerControlHandle { inner: this.inner.clone() };
Ok(BrowseControllerRequest::SetBrowsedPlayer {
player_id: req.player_id,
responder: BrowseControllerSetBrowsedPlayerResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<BrowseControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum BrowseControllerRequest {
GetMediaPlayerItems {
start_index: u32,
end_index: u32,
responder: BrowseControllerGetMediaPlayerItemsResponder,
},
GetNowPlayingItems {
start_index: u32,
end_index: u32,
attribute_option: AttributeRequestOption,
responder: BrowseControllerGetNowPlayingItemsResponder,
},
GetFileSystemItems {
start_index: u32,
end_index: u32,
attribute_option: AttributeRequestOption,
responder: BrowseControllerGetFileSystemItemsResponder,
},
ChangePath { path: Path, responder: BrowseControllerChangePathResponder },
PlayFileSystemItem { uid: u64, responder: BrowseControllerPlayFileSystemItemResponder },
PlayNowPlayingItem { uid: u64, responder: BrowseControllerPlayNowPlayingItemResponder },
SetBrowsedPlayer { player_id: u16, responder: BrowseControllerSetBrowsedPlayerResponder },
}
impl BrowseControllerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_media_player_items(
self,
) -> Option<(u32, u32, BrowseControllerGetMediaPlayerItemsResponder)> {
if let BrowseControllerRequest::GetMediaPlayerItems { start_index, end_index, responder } =
self
{
Some((start_index, end_index, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_now_playing_items(
self,
) -> Option<(u32, u32, AttributeRequestOption, BrowseControllerGetNowPlayingItemsResponder)>
{
if let BrowseControllerRequest::GetNowPlayingItems {
start_index,
end_index,
attribute_option,
responder,
} = self
{
Some((start_index, end_index, attribute_option, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_file_system_items(
self,
) -> Option<(u32, u32, AttributeRequestOption, BrowseControllerGetFileSystemItemsResponder)>
{
if let BrowseControllerRequest::GetFileSystemItems {
start_index,
end_index,
attribute_option,
responder,
} = self
{
Some((start_index, end_index, attribute_option, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_change_path(self) -> Option<(Path, BrowseControllerChangePathResponder)> {
if let BrowseControllerRequest::ChangePath { path, responder } = self {
Some((path, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_play_file_system_item(
self,
) -> Option<(u64, BrowseControllerPlayFileSystemItemResponder)> {
if let BrowseControllerRequest::PlayFileSystemItem { uid, responder } = self {
Some((uid, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_play_now_playing_item(
self,
) -> Option<(u64, BrowseControllerPlayNowPlayingItemResponder)> {
if let BrowseControllerRequest::PlayNowPlayingItem { uid, responder } = self {
Some((uid, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_browsed_player(
self,
) -> Option<(u16, BrowseControllerSetBrowsedPlayerResponder)> {
if let BrowseControllerRequest::SetBrowsedPlayer { player_id, responder } = self {
Some((player_id, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
BrowseControllerRequest::GetMediaPlayerItems { .. } => "get_media_player_items",
BrowseControllerRequest::GetNowPlayingItems { .. } => "get_now_playing_items",
BrowseControllerRequest::GetFileSystemItems { .. } => "get_file_system_items",
BrowseControllerRequest::ChangePath { .. } => "change_path",
BrowseControllerRequest::PlayFileSystemItem { .. } => "play_file_system_item",
BrowseControllerRequest::PlayNowPlayingItem { .. } => "play_now_playing_item",
BrowseControllerRequest::SetBrowsedPlayer { .. } => "set_browsed_player",
}
}
}
#[derive(Debug, Clone)]
pub struct BrowseControllerControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for BrowseControllerControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl BrowseControllerControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BrowseControllerGetMediaPlayerItemsResponder {
control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BrowseControllerGetMediaPlayerItemsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BrowseControllerGetMediaPlayerItemsResponder {
type ControlHandle = BrowseControllerControlHandle;
fn control_handle(&self) -> &BrowseControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BrowseControllerGetMediaPlayerItemsResponder {
pub fn send(
self,
mut result: Result<&[MediaPlayerItem], BrowseControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&[MediaPlayerItem], BrowseControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&[MediaPlayerItem], BrowseControllerError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
BrowseControllerGetMediaPlayerItemsResponse,
BrowseControllerError,
>>(
result.map(|items| (items,)),
self.tx_id,
0x49c06d30a9aa02ba,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BrowseControllerGetNowPlayingItemsResponder {
control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BrowseControllerGetNowPlayingItemsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BrowseControllerGetNowPlayingItemsResponder {
type ControlHandle = BrowseControllerControlHandle;
fn control_handle(&self) -> &BrowseControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BrowseControllerGetNowPlayingItemsResponder {
pub fn send(
self,
mut result: Result<&[MediaElementItem], BrowseControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&[MediaElementItem], BrowseControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&[MediaElementItem], BrowseControllerError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
BrowseControllerGetNowPlayingItemsResponse,
BrowseControllerError,
>>(
result.map(|items| (items,)),
self.tx_id,
0x35f5a88695b46cf7,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BrowseControllerGetFileSystemItemsResponder {
control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BrowseControllerGetFileSystemItemsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BrowseControllerGetFileSystemItemsResponder {
type ControlHandle = BrowseControllerControlHandle;
fn control_handle(&self) -> &BrowseControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BrowseControllerGetFileSystemItemsResponder {
pub fn send(
self,
mut result: Result<&[FileSystemItem], BrowseControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&[FileSystemItem], BrowseControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&[FileSystemItem], BrowseControllerError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
BrowseControllerGetFileSystemItemsResponse,
BrowseControllerError,
>>(
result.map(|items| (items,)),
self.tx_id,
0x5d1415aecee72133,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BrowseControllerChangePathResponder {
control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BrowseControllerChangePathResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BrowseControllerChangePathResponder {
type ControlHandle = BrowseControllerControlHandle;
fn control_handle(&self) -> &BrowseControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BrowseControllerChangePathResponder {
pub fn send(self, mut result: Result<u32, BrowseControllerError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<u32, BrowseControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<u32, BrowseControllerError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
BrowseControllerChangePathResponse,
BrowseControllerError,
>>(
result.map(|num_items| (num_items,)),
self.tx_id,
0x2e0600579d43b51e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BrowseControllerPlayFileSystemItemResponder {
control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BrowseControllerPlayFileSystemItemResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BrowseControllerPlayFileSystemItemResponder {
type ControlHandle = BrowseControllerControlHandle;
fn control_handle(&self) -> &BrowseControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BrowseControllerPlayFileSystemItemResponder {
pub fn send(self, mut result: Result<(), BrowseControllerError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), BrowseControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), BrowseControllerError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
BrowseControllerError,
>>(
result,
self.tx_id,
0x57075115ce25cf16,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BrowseControllerPlayNowPlayingItemResponder {
control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BrowseControllerPlayNowPlayingItemResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BrowseControllerPlayNowPlayingItemResponder {
type ControlHandle = BrowseControllerControlHandle;
fn control_handle(&self) -> &BrowseControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BrowseControllerPlayNowPlayingItemResponder {
pub fn send(self, mut result: Result<(), BrowseControllerError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), BrowseControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), BrowseControllerError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
BrowseControllerError,
>>(
result,
self.tx_id,
0x116e151d547fd2d7,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct BrowseControllerSetBrowsedPlayerResponder {
control_handle: std::mem::ManuallyDrop<BrowseControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for BrowseControllerSetBrowsedPlayerResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for BrowseControllerSetBrowsedPlayerResponder {
type ControlHandle = BrowseControllerControlHandle;
fn control_handle(&self) -> &BrowseControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl BrowseControllerSetBrowsedPlayerResponder {
pub fn send(self, mut result: Result<(), BrowseControllerError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), BrowseControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), BrowseControllerError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
BrowseControllerError,
>>(
result,
self.tx_id,
0x3e3256f57f8848da,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct ControllerMarker;
impl fidl::endpoints::ProtocolMarker for ControllerMarker {
type Proxy = ControllerProxy;
type RequestStream = ControllerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = ControllerSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Controller";
}
pub type ControllerGetPlayerApplicationSettingsResult =
Result<PlayerApplicationSettings, ControllerError>;
pub type ControllerSetPlayerApplicationSettingsResult =
Result<PlayerApplicationSettings, ControllerError>;
pub type ControllerGetMediaAttributesResult = Result<MediaAttributes, ControllerError>;
pub type ControllerGetPlayStatusResult = Result<PlayStatus, ControllerError>;
pub type ControllerSetAbsoluteVolumeResult = Result<u8, ControllerError>;
pub type ControllerInformBatteryStatusResult = Result<(), ControllerError>;
pub type ControllerSetAddressedPlayerResult = Result<(), ControllerError>;
pub type ControllerSendCommandResult = Result<(), ControllerError>;
pub trait ControllerProxyInterface: Send + Sync {
type GetPlayerApplicationSettingsResponseFut: std::future::Future<
Output = Result<ControllerGetPlayerApplicationSettingsResult, fidl::Error>,
> + Send;
fn r#get_player_application_settings(
&self,
attribute_ids: &[PlayerApplicationSettingAttributeId],
) -> Self::GetPlayerApplicationSettingsResponseFut;
type SetPlayerApplicationSettingsResponseFut: std::future::Future<
Output = Result<ControllerSetPlayerApplicationSettingsResult, fidl::Error>,
> + Send;
fn r#set_player_application_settings(
&self,
requested_settings: &PlayerApplicationSettings,
) -> Self::SetPlayerApplicationSettingsResponseFut;
type GetMediaAttributesResponseFut: std::future::Future<Output = Result<ControllerGetMediaAttributesResult, fidl::Error>>
+ Send;
fn r#get_media_attributes(&self) -> Self::GetMediaAttributesResponseFut;
type GetPlayStatusResponseFut: std::future::Future<Output = Result<ControllerGetPlayStatusResult, fidl::Error>>
+ Send;
fn r#get_play_status(&self) -> Self::GetPlayStatusResponseFut;
type SetAbsoluteVolumeResponseFut: std::future::Future<Output = Result<ControllerSetAbsoluteVolumeResult, fidl::Error>>
+ Send;
fn r#set_absolute_volume(&self, requested_volume: u8) -> Self::SetAbsoluteVolumeResponseFut;
type InformBatteryStatusResponseFut: std::future::Future<Output = Result<ControllerInformBatteryStatusResult, fidl::Error>>
+ Send;
fn r#inform_battery_status(
&self,
battery_status: BatteryStatus,
) -> Self::InformBatteryStatusResponseFut;
fn r#set_notification_filter(
&self,
notifications: Notifications,
position_change_interval: u32,
) -> Result<(), fidl::Error>;
fn r#notify_notification_handled(&self) -> Result<(), fidl::Error>;
type SetAddressedPlayerResponseFut: std::future::Future<Output = Result<ControllerSetAddressedPlayerResult, fidl::Error>>
+ Send;
fn r#set_addressed_player(&self, player_id: u16) -> Self::SetAddressedPlayerResponseFut;
type SendCommandResponseFut: std::future::Future<Output = Result<ControllerSendCommandResult, fidl::Error>>
+ Send;
fn r#send_command(&self, command: AvcPanelCommand) -> Self::SendCommandResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct ControllerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for ControllerSynchronousProxy {
type Proxy = ControllerProxy;
type Protocol = ControllerMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl ControllerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<ControllerEvent, fidl::Error> {
ControllerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_player_application_settings(
&self,
mut attribute_ids: &[PlayerApplicationSettingAttributeId],
___deadline: zx::MonotonicInstant,
) -> Result<ControllerGetPlayerApplicationSettingsResult, fidl::Error> {
let _response = self
.client
.send_query::<ControllerGetPlayerApplicationSettingsRequest, fidl::encoding::ResultType<
ControllerGetPlayerApplicationSettingsResponse,
ControllerError,
>>(
(attribute_ids,),
0x681de2da50670120,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.current_settings))
}
pub fn r#set_player_application_settings(
&self,
mut requested_settings: &PlayerApplicationSettings,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerSetPlayerApplicationSettingsResult, fidl::Error> {
let _response = self
.client
.send_query::<ControllerSetPlayerApplicationSettingsRequest, fidl::encoding::ResultType<
ControllerSetPlayerApplicationSettingsResponse,
ControllerError,
>>(
(requested_settings,),
0x6a7c9689ea3a589a,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.set_settings))
}
pub fn r#get_media_attributes(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerGetMediaAttributesResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
ControllerGetMediaAttributesResponse,
ControllerError,
>>(
(),
0x18bd14308ee3173d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.attributes))
}
pub fn r#get_play_status(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerGetPlayStatusResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
ControllerGetPlayStatusResponse,
ControllerError,
>>(
(),
0x120735bec709fc6d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.play_status))
}
pub fn r#set_absolute_volume(
&self,
mut requested_volume: u8,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerSetAbsoluteVolumeResult, fidl::Error> {
let _response = self.client.send_query::<
ControllerSetAbsoluteVolumeRequest,
fidl::encoding::ResultType<ControllerSetAbsoluteVolumeResponse, ControllerError>,
>(
(requested_volume,),
0x1b8d010e11d05957,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.set_volume))
}
pub fn r#inform_battery_status(
&self,
mut battery_status: BatteryStatus,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerInformBatteryStatusResult, fidl::Error> {
let _response = self.client.send_query::<
ControllerInformBatteryStatusRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControllerError>,
>(
(battery_status,),
0x11d54fbe9d12c44d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#set_notification_filter(
&self,
mut notifications: Notifications,
mut position_change_interval: u32,
) -> Result<(), fidl::Error> {
self.client.send::<ControllerSetNotificationFilterRequest>(
(notifications, position_change_interval),
0x4d8a327745ccd73b,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#notify_notification_handled(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x43d3e556557f3bc2,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#set_addressed_player(
&self,
mut player_id: u16,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerSetAddressedPlayerResult, fidl::Error> {
let _response = self.client.send_query::<
ControllerSetAddressedPlayerRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControllerError>,
>(
(player_id,),
0x7ffc261f10ee1da5,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#send_command(
&self,
mut command: AvcPanelCommand,
___deadline: zx::MonotonicInstant,
) -> Result<ControllerSendCommandResult, fidl::Error> {
let _response = self.client.send_query::<
ControllerSendCommandRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControllerError>,
>(
(command,),
0x241324c56b5bc257,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct ControllerProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for ControllerProxy {
type Protocol = ControllerMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl ControllerProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> ControllerEventStream {
ControllerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_player_application_settings(
&self,
mut attribute_ids: &[PlayerApplicationSettingAttributeId],
) -> fidl::client::QueryResponseFut<
ControllerGetPlayerApplicationSettingsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ControllerProxyInterface::r#get_player_application_settings(self, attribute_ids)
}
pub fn r#set_player_application_settings(
&self,
mut requested_settings: &PlayerApplicationSettings,
) -> fidl::client::QueryResponseFut<
ControllerSetPlayerApplicationSettingsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ControllerProxyInterface::r#set_player_application_settings(self, requested_settings)
}
pub fn r#get_media_attributes(
&self,
) -> fidl::client::QueryResponseFut<
ControllerGetMediaAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ControllerProxyInterface::r#get_media_attributes(self)
}
pub fn r#get_play_status(
&self,
) -> fidl::client::QueryResponseFut<
ControllerGetPlayStatusResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ControllerProxyInterface::r#get_play_status(self)
}
pub fn r#set_absolute_volume(
&self,
mut requested_volume: u8,
) -> fidl::client::QueryResponseFut<
ControllerSetAbsoluteVolumeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ControllerProxyInterface::r#set_absolute_volume(self, requested_volume)
}
pub fn r#inform_battery_status(
&self,
mut battery_status: BatteryStatus,
) -> fidl::client::QueryResponseFut<
ControllerInformBatteryStatusResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ControllerProxyInterface::r#inform_battery_status(self, battery_status)
}
pub fn r#set_notification_filter(
&self,
mut notifications: Notifications,
mut position_change_interval: u32,
) -> Result<(), fidl::Error> {
ControllerProxyInterface::r#set_notification_filter(
self,
notifications,
position_change_interval,
)
}
pub fn r#notify_notification_handled(&self) -> Result<(), fidl::Error> {
ControllerProxyInterface::r#notify_notification_handled(self)
}
pub fn r#set_addressed_player(
&self,
mut player_id: u16,
) -> fidl::client::QueryResponseFut<
ControllerSetAddressedPlayerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ControllerProxyInterface::r#set_addressed_player(self, player_id)
}
pub fn r#send_command(
&self,
mut command: AvcPanelCommand,
) -> fidl::client::QueryResponseFut<
ControllerSendCommandResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
ControllerProxyInterface::r#send_command(self, command)
}
}
impl ControllerProxyInterface for ControllerProxy {
type GetPlayerApplicationSettingsResponseFut = fidl::client::QueryResponseFut<
ControllerGetPlayerApplicationSettingsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_player_application_settings(
&self,
mut attribute_ids: &[PlayerApplicationSettingAttributeId],
) -> Self::GetPlayerApplicationSettingsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ControllerGetPlayerApplicationSettingsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
ControllerGetPlayerApplicationSettingsResponse,
ControllerError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x681de2da50670120,
>(_buf?)?;
Ok(_response.map(|x| x.current_settings))
}
self.client.send_query_and_decode::<
ControllerGetPlayerApplicationSettingsRequest,
ControllerGetPlayerApplicationSettingsResult,
>(
(attribute_ids,),
0x681de2da50670120,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetPlayerApplicationSettingsResponseFut = fidl::client::QueryResponseFut<
ControllerSetPlayerApplicationSettingsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_player_application_settings(
&self,
mut requested_settings: &PlayerApplicationSettings,
) -> Self::SetPlayerApplicationSettingsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ControllerSetPlayerApplicationSettingsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
ControllerSetPlayerApplicationSettingsResponse,
ControllerError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6a7c9689ea3a589a,
>(_buf?)?;
Ok(_response.map(|x| x.set_settings))
}
self.client.send_query_and_decode::<
ControllerSetPlayerApplicationSettingsRequest,
ControllerSetPlayerApplicationSettingsResult,
>(
(requested_settings,),
0x6a7c9689ea3a589a,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetMediaAttributesResponseFut = fidl::client::QueryResponseFut<
ControllerGetMediaAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_media_attributes(&self) -> Self::GetMediaAttributesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ControllerGetMediaAttributesResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ControllerGetMediaAttributesResponse, ControllerError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x18bd14308ee3173d,
>(_buf?)?;
Ok(_response.map(|x| x.attributes))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
ControllerGetMediaAttributesResult,
>(
(),
0x18bd14308ee3173d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetPlayStatusResponseFut = fidl::client::QueryResponseFut<
ControllerGetPlayStatusResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_play_status(&self) -> Self::GetPlayStatusResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ControllerGetPlayStatusResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ControllerGetPlayStatusResponse, ControllerError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x120735bec709fc6d,
>(_buf?)?;
Ok(_response.map(|x| x.play_status))
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, ControllerGetPlayStatusResult>(
(),
0x120735bec709fc6d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetAbsoluteVolumeResponseFut = fidl::client::QueryResponseFut<
ControllerSetAbsoluteVolumeResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_absolute_volume(
&self,
mut requested_volume: u8,
) -> Self::SetAbsoluteVolumeResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ControllerSetAbsoluteVolumeResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<ControllerSetAbsoluteVolumeResponse, ControllerError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1b8d010e11d05957,
>(_buf?)?;
Ok(_response.map(|x| x.set_volume))
}
self.client.send_query_and_decode::<
ControllerSetAbsoluteVolumeRequest,
ControllerSetAbsoluteVolumeResult,
>(
(requested_volume,),
0x1b8d010e11d05957,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type InformBatteryStatusResponseFut = fidl::client::QueryResponseFut<
ControllerInformBatteryStatusResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#inform_battery_status(
&self,
mut battery_status: BatteryStatus,
) -> Self::InformBatteryStatusResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ControllerInformBatteryStatusResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControllerError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x11d54fbe9d12c44d,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
ControllerInformBatteryStatusRequest,
ControllerInformBatteryStatusResult,
>(
(battery_status,),
0x11d54fbe9d12c44d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#set_notification_filter(
&self,
mut notifications: Notifications,
mut position_change_interval: u32,
) -> Result<(), fidl::Error> {
self.client.send::<ControllerSetNotificationFilterRequest>(
(notifications, position_change_interval),
0x4d8a327745ccd73b,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#notify_notification_handled(&self) -> Result<(), fidl::Error> {
self.client.send::<fidl::encoding::EmptyPayload>(
(),
0x43d3e556557f3bc2,
fidl::encoding::DynamicFlags::empty(),
)
}
type SetAddressedPlayerResponseFut = fidl::client::QueryResponseFut<
ControllerSetAddressedPlayerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_addressed_player(&self, mut player_id: u16) -> Self::SetAddressedPlayerResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ControllerSetAddressedPlayerResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControllerError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7ffc261f10ee1da5,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
ControllerSetAddressedPlayerRequest,
ControllerSetAddressedPlayerResult,
>(
(player_id,),
0x7ffc261f10ee1da5,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SendCommandResponseFut = fidl::client::QueryResponseFut<
ControllerSendCommandResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#send_command(&self, mut command: AvcPanelCommand) -> Self::SendCommandResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<ControllerSendCommandResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, ControllerError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x241324c56b5bc257,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<ControllerSendCommandRequest, ControllerSendCommandResult>(
(command,),
0x241324c56b5bc257,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct ControllerEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for ControllerEventStream {}
impl futures::stream::FusedStream for ControllerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for ControllerEventStream {
type Item = Result<ControllerEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(ControllerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum ControllerEvent {
OnNotification { timestamp: i64, notification: Notification },
}
impl ControllerEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_on_notification(self) -> Option<(i64, Notification)> {
if let ControllerEvent::OnNotification { timestamp, notification } = self {
Some((timestamp, notification))
} else {
None
}
}
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<ControllerEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
0x796259451db67281 => {
let mut out = fidl::new_empty!(
ControllerOnNotificationRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerOnNotificationRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((ControllerEvent::OnNotification {
timestamp: out.timestamp,
notification: out.notification,
}))
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct ControllerRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for ControllerRequestStream {}
impl futures::stream::FusedStream for ControllerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for ControllerRequestStream {
type Protocol = ControllerMarker;
type ControlHandle = ControllerControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
ControllerControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for ControllerRequestStream {
type Item = Result<ControllerRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled ControllerRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x681de2da50670120 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ControllerGetPlayerApplicationSettingsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerGetPlayerApplicationSettingsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::GetPlayerApplicationSettings {
attribute_ids: req.attribute_ids,
responder: ControllerGetPlayerApplicationSettingsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6a7c9689ea3a589a => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ControllerSetPlayerApplicationSettingsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerSetPlayerApplicationSettingsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::SetPlayerApplicationSettings {
requested_settings: req.requested_settings,
responder: ControllerSetPlayerApplicationSettingsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x18bd14308ee3173d => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::GetMediaAttributes {
responder: ControllerGetMediaAttributesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x120735bec709fc6d => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::GetPlayStatus {
responder: ControllerGetPlayStatusResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1b8d010e11d05957 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ControllerSetAbsoluteVolumeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerSetAbsoluteVolumeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::SetAbsoluteVolume {
requested_volume: req.requested_volume,
responder: ControllerSetAbsoluteVolumeResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x11d54fbe9d12c44d => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ControllerInformBatteryStatusRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerInformBatteryStatusRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::InformBatteryStatus {
battery_status: req.battery_status,
responder: ControllerInformBatteryStatusResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4d8a327745ccd73b => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
ControllerSetNotificationFilterRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerSetNotificationFilterRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::SetNotificationFilter {
notifications: req.notifications,
position_change_interval: req.position_change_interval,
control_handle,
})
}
0x43d3e556557f3bc2 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::NotifyNotificationHandled { control_handle })
}
0x7ffc261f10ee1da5 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ControllerSetAddressedPlayerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerSetAddressedPlayerRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::SetAddressedPlayer {
player_id: req.player_id,
responder: ControllerSetAddressedPlayerResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x241324c56b5bc257 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
ControllerSendCommandRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<ControllerSendCommandRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = ControllerControlHandle { inner: this.inner.clone() };
Ok(ControllerRequest::SendCommand {
command: req.command,
responder: ControllerSendCommandResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<ControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum ControllerRequest {
GetPlayerApplicationSettings {
attribute_ids: Vec<PlayerApplicationSettingAttributeId>,
responder: ControllerGetPlayerApplicationSettingsResponder,
},
SetPlayerApplicationSettings {
requested_settings: PlayerApplicationSettings,
responder: ControllerSetPlayerApplicationSettingsResponder,
},
GetMediaAttributes { responder: ControllerGetMediaAttributesResponder },
GetPlayStatus { responder: ControllerGetPlayStatusResponder },
SetAbsoluteVolume { requested_volume: u8, responder: ControllerSetAbsoluteVolumeResponder },
InformBatteryStatus {
battery_status: BatteryStatus,
responder: ControllerInformBatteryStatusResponder,
},
SetNotificationFilter {
notifications: Notifications,
position_change_interval: u32,
control_handle: ControllerControlHandle,
},
NotifyNotificationHandled { control_handle: ControllerControlHandle },
SetAddressedPlayer { player_id: u16, responder: ControllerSetAddressedPlayerResponder },
SendCommand { command: AvcPanelCommand, responder: ControllerSendCommandResponder },
}
impl ControllerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_player_application_settings(
self,
) -> Option<(
Vec<PlayerApplicationSettingAttributeId>,
ControllerGetPlayerApplicationSettingsResponder,
)> {
if let ControllerRequest::GetPlayerApplicationSettings { attribute_ids, responder } = self {
Some((attribute_ids, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_player_application_settings(
self,
) -> Option<(PlayerApplicationSettings, ControllerSetPlayerApplicationSettingsResponder)> {
if let ControllerRequest::SetPlayerApplicationSettings { requested_settings, responder } =
self
{
Some((requested_settings, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_media_attributes(self) -> Option<(ControllerGetMediaAttributesResponder)> {
if let ControllerRequest::GetMediaAttributes { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_play_status(self) -> Option<(ControllerGetPlayStatusResponder)> {
if let ControllerRequest::GetPlayStatus { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_absolute_volume(self) -> Option<(u8, ControllerSetAbsoluteVolumeResponder)> {
if let ControllerRequest::SetAbsoluteVolume { requested_volume, responder } = self {
Some((requested_volume, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_inform_battery_status(
self,
) -> Option<(BatteryStatus, ControllerInformBatteryStatusResponder)> {
if let ControllerRequest::InformBatteryStatus { battery_status, responder } = self {
Some((battery_status, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_notification_filter(
self,
) -> Option<(Notifications, u32, ControllerControlHandle)> {
if let ControllerRequest::SetNotificationFilter {
notifications,
position_change_interval,
control_handle,
} = self
{
Some((notifications, position_change_interval, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_notify_notification_handled(self) -> Option<(ControllerControlHandle)> {
if let ControllerRequest::NotifyNotificationHandled { control_handle } = self {
Some((control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_addressed_player(self) -> Option<(u16, ControllerSetAddressedPlayerResponder)> {
if let ControllerRequest::SetAddressedPlayer { player_id, responder } = self {
Some((player_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_send_command(self) -> Option<(AvcPanelCommand, ControllerSendCommandResponder)> {
if let ControllerRequest::SendCommand { command, responder } = self {
Some((command, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
ControllerRequest::GetPlayerApplicationSettings { .. } => {
"get_player_application_settings"
}
ControllerRequest::SetPlayerApplicationSettings { .. } => {
"set_player_application_settings"
}
ControllerRequest::GetMediaAttributes { .. } => "get_media_attributes",
ControllerRequest::GetPlayStatus { .. } => "get_play_status",
ControllerRequest::SetAbsoluteVolume { .. } => "set_absolute_volume",
ControllerRequest::InformBatteryStatus { .. } => "inform_battery_status",
ControllerRequest::SetNotificationFilter { .. } => "set_notification_filter",
ControllerRequest::NotifyNotificationHandled { .. } => "notify_notification_handled",
ControllerRequest::SetAddressedPlayer { .. } => "set_addressed_player",
ControllerRequest::SendCommand { .. } => "send_command",
}
}
}
#[derive(Debug, Clone)]
pub struct ControllerControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for ControllerControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl ControllerControlHandle {
pub fn send_on_notification(
&self,
mut timestamp: i64,
mut notification: &Notification,
) -> Result<(), fidl::Error> {
self.inner.send::<ControllerOnNotificationRequest>(
(timestamp, notification),
0,
0x796259451db67281,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerGetPlayerApplicationSettingsResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerGetPlayerApplicationSettingsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerGetPlayerApplicationSettingsResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerGetPlayerApplicationSettingsResponder {
pub fn send(
self,
mut result: Result<&PlayerApplicationSettings, ControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&PlayerApplicationSettings, ControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&PlayerApplicationSettings, ControllerError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
ControllerGetPlayerApplicationSettingsResponse,
ControllerError,
>>(
result.map(|current_settings| (current_settings,)),
self.tx_id,
0x681de2da50670120,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerSetPlayerApplicationSettingsResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerSetPlayerApplicationSettingsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerSetPlayerApplicationSettingsResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerSetPlayerApplicationSettingsResponder {
pub fn send(
self,
mut result: Result<&PlayerApplicationSettings, ControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&PlayerApplicationSettings, ControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&PlayerApplicationSettings, ControllerError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
ControllerSetPlayerApplicationSettingsResponse,
ControllerError,
>>(
result.map(|set_settings| (set_settings,)),
self.tx_id,
0x6a7c9689ea3a589a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerGetMediaAttributesResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerGetMediaAttributesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerGetMediaAttributesResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerGetMediaAttributesResponder {
pub fn send(
self,
mut result: Result<&MediaAttributes, ControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&MediaAttributes, ControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&MediaAttributes, ControllerError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
ControllerGetMediaAttributesResponse,
ControllerError,
>>(
result.map(|attributes| (attributes,)),
self.tx_id,
0x18bd14308ee3173d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerGetPlayStatusResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerGetPlayStatusResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerGetPlayStatusResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerGetPlayStatusResponder {
pub fn send(self, mut result: Result<&PlayStatus, ControllerError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&PlayStatus, ControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&PlayStatus, ControllerError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
ControllerGetPlayStatusResponse,
ControllerError,
>>(
result.map(|play_status| (play_status,)),
self.tx_id,
0x120735bec709fc6d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerSetAbsoluteVolumeResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerSetAbsoluteVolumeResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerSetAbsoluteVolumeResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerSetAbsoluteVolumeResponder {
pub fn send(self, mut result: Result<u8, ControllerError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<u8, ControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<u8, ControllerError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
ControllerSetAbsoluteVolumeResponse,
ControllerError,
>>(
result.map(|set_volume| (set_volume,)),
self.tx_id,
0x1b8d010e11d05957,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerInformBatteryStatusResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerInformBatteryStatusResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerInformBatteryStatusResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerInformBatteryStatusResponder {
pub fn send(self, mut result: Result<(), ControllerError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), ControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), ControllerError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
ControllerError,
>>(
result,
self.tx_id,
0x11d54fbe9d12c44d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerSetAddressedPlayerResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerSetAddressedPlayerResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerSetAddressedPlayerResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerSetAddressedPlayerResponder {
pub fn send(self, mut result: Result<(), ControllerError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), ControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), ControllerError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
ControllerError,
>>(
result,
self.tx_id,
0x7ffc261f10ee1da5,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct ControllerSendCommandResponder {
control_handle: std::mem::ManuallyDrop<ControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for ControllerSendCommandResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for ControllerSendCommandResponder {
type ControlHandle = ControllerControlHandle;
fn control_handle(&self) -> &ControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl ControllerSendCommandResponder {
pub fn send(self, mut result: Result<(), ControllerError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), ControllerError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), ControllerError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
ControllerError,
>>(
result,
self.tx_id,
0x241324c56b5bc257,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct PeerManagerMarker;
impl fidl::endpoints::ProtocolMarker for PeerManagerMarker {
type Proxy = PeerManagerProxy;
type RequestStream = PeerManagerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = PeerManagerSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.bluetooth.avrcp.PeerManager";
}
impl fidl::endpoints::DiscoverableProtocolMarker for PeerManagerMarker {}
pub type PeerManagerGetBrowseControllerForTargetResult = Result<(), i32>;
pub type PeerManagerGetControllerForTargetResult = Result<(), i32>;
pub type PeerManagerSetAbsoluteVolumeHandlerResult = Result<(), i32>;
pub type PeerManagerRegisterTargetHandlerResult = Result<(), i32>;
pub trait PeerManagerProxyInterface: Send + Sync {
type GetBrowseControllerForTargetResponseFut: std::future::Future<
Output = Result<PeerManagerGetBrowseControllerForTargetResult, fidl::Error>,
> + Send;
fn r#get_browse_controller_for_target(
&self,
peer_id: &fidl_fuchsia_bluetooth::PeerId,
client: fidl::endpoints::ServerEnd<BrowseControllerMarker>,
) -> Self::GetBrowseControllerForTargetResponseFut;
type GetControllerForTargetResponseFut: std::future::Future<Output = Result<PeerManagerGetControllerForTargetResult, fidl::Error>>
+ Send;
fn r#get_controller_for_target(
&self,
peer_id: &fidl_fuchsia_bluetooth::PeerId,
client: fidl::endpoints::ServerEnd<ControllerMarker>,
) -> Self::GetControllerForTargetResponseFut;
type SetAbsoluteVolumeHandlerResponseFut: std::future::Future<Output = Result<PeerManagerSetAbsoluteVolumeHandlerResult, fidl::Error>>
+ Send;
fn r#set_absolute_volume_handler(
&self,
handler: fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
) -> Self::SetAbsoluteVolumeHandlerResponseFut;
type RegisterTargetHandlerResponseFut: std::future::Future<Output = Result<PeerManagerRegisterTargetHandlerResult, fidl::Error>>
+ Send;
fn r#register_target_handler(
&self,
handler: fidl::endpoints::ClientEnd<TargetHandlerMarker>,
) -> Self::RegisterTargetHandlerResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct PeerManagerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for PeerManagerSynchronousProxy {
type Proxy = PeerManagerProxy;
type Protocol = PeerManagerMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl PeerManagerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <PeerManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<PeerManagerEvent, fidl::Error> {
PeerManagerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_browse_controller_for_target(
&self,
mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
mut client: fidl::endpoints::ServerEnd<BrowseControllerMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<PeerManagerGetBrowseControllerForTargetResult, fidl::Error> {
let _response = self.client.send_query::<
PeerManagerGetBrowseControllerForTargetRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(peer_id, client,),
0x5b75bbb8d58a6d49,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_controller_for_target(
&self,
mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
mut client: fidl::endpoints::ServerEnd<ControllerMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<PeerManagerGetControllerForTargetResult, fidl::Error> {
let _response = self.client.send_query::<
PeerManagerGetControllerForTargetRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(peer_id, client,),
0x25d36e51516bc3b4,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#set_absolute_volume_handler(
&self,
mut handler: fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<PeerManagerSetAbsoluteVolumeHandlerResult, fidl::Error> {
let _response = self.client.send_query::<
PeerManagerSetAbsoluteVolumeHandlerRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(handler,),
0x39a465c63e9f918c,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#register_target_handler(
&self,
mut handler: fidl::endpoints::ClientEnd<TargetHandlerMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<PeerManagerRegisterTargetHandlerResult, fidl::Error> {
let _response = self.client.send_query::<
PeerManagerRegisterTargetHandlerRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
>(
(handler,),
0x4bc919acb791bdb3,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct PeerManagerProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for PeerManagerProxy {
type Protocol = PeerManagerMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl PeerManagerProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <PeerManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> PeerManagerEventStream {
PeerManagerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_browse_controller_for_target(
&self,
mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
mut client: fidl::endpoints::ServerEnd<BrowseControllerMarker>,
) -> fidl::client::QueryResponseFut<
PeerManagerGetBrowseControllerForTargetResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
PeerManagerProxyInterface::r#get_browse_controller_for_target(self, peer_id, client)
}
pub fn r#get_controller_for_target(
&self,
mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
mut client: fidl::endpoints::ServerEnd<ControllerMarker>,
) -> fidl::client::QueryResponseFut<
PeerManagerGetControllerForTargetResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
PeerManagerProxyInterface::r#get_controller_for_target(self, peer_id, client)
}
pub fn r#set_absolute_volume_handler(
&self,
mut handler: fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
) -> fidl::client::QueryResponseFut<
PeerManagerSetAbsoluteVolumeHandlerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
PeerManagerProxyInterface::r#set_absolute_volume_handler(self, handler)
}
pub fn r#register_target_handler(
&self,
mut handler: fidl::endpoints::ClientEnd<TargetHandlerMarker>,
) -> fidl::client::QueryResponseFut<
PeerManagerRegisterTargetHandlerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
PeerManagerProxyInterface::r#register_target_handler(self, handler)
}
}
impl PeerManagerProxyInterface for PeerManagerProxy {
type GetBrowseControllerForTargetResponseFut = fidl::client::QueryResponseFut<
PeerManagerGetBrowseControllerForTargetResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_browse_controller_for_target(
&self,
mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
mut client: fidl::endpoints::ServerEnd<BrowseControllerMarker>,
) -> Self::GetBrowseControllerForTargetResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<PeerManagerGetBrowseControllerForTargetResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5b75bbb8d58a6d49,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
PeerManagerGetBrowseControllerForTargetRequest,
PeerManagerGetBrowseControllerForTargetResult,
>(
(peer_id, client,),
0x5b75bbb8d58a6d49,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetControllerForTargetResponseFut = fidl::client::QueryResponseFut<
PeerManagerGetControllerForTargetResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_controller_for_target(
&self,
mut peer_id: &fidl_fuchsia_bluetooth::PeerId,
mut client: fidl::endpoints::ServerEnd<ControllerMarker>,
) -> Self::GetControllerForTargetResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<PeerManagerGetControllerForTargetResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x25d36e51516bc3b4,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
PeerManagerGetControllerForTargetRequest,
PeerManagerGetControllerForTargetResult,
>(
(peer_id, client,),
0x25d36e51516bc3b4,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetAbsoluteVolumeHandlerResponseFut = fidl::client::QueryResponseFut<
PeerManagerSetAbsoluteVolumeHandlerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_absolute_volume_handler(
&self,
mut handler: fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
) -> Self::SetAbsoluteVolumeHandlerResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<PeerManagerSetAbsoluteVolumeHandlerResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x39a465c63e9f918c,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
PeerManagerSetAbsoluteVolumeHandlerRequest,
PeerManagerSetAbsoluteVolumeHandlerResult,
>(
(handler,),
0x39a465c63e9f918c,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type RegisterTargetHandlerResponseFut = fidl::client::QueryResponseFut<
PeerManagerRegisterTargetHandlerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#register_target_handler(
&self,
mut handler: fidl::endpoints::ClientEnd<TargetHandlerMarker>,
) -> Self::RegisterTargetHandlerResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<PeerManagerRegisterTargetHandlerResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4bc919acb791bdb3,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
PeerManagerRegisterTargetHandlerRequest,
PeerManagerRegisterTargetHandlerResult,
>(
(handler,),
0x4bc919acb791bdb3,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct PeerManagerEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for PeerManagerEventStream {}
impl futures::stream::FusedStream for PeerManagerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for PeerManagerEventStream {
type Item = Result<PeerManagerEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(PeerManagerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum PeerManagerEvent {}
impl PeerManagerEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<PeerManagerEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <PeerManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct PeerManagerRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for PeerManagerRequestStream {}
impl futures::stream::FusedStream for PeerManagerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for PeerManagerRequestStream {
type Protocol = PeerManagerMarker;
type ControlHandle = PeerManagerControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
PeerManagerControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for PeerManagerRequestStream {
type Item = Result<PeerManagerRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled PeerManagerRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x5b75bbb8d58a6d49 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
PeerManagerGetBrowseControllerForTargetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PeerManagerGetBrowseControllerForTargetRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = PeerManagerControlHandle { inner: this.inner.clone() };
Ok(PeerManagerRequest::GetBrowseControllerForTarget {
peer_id: req.peer_id,
client: req.client,
responder: PeerManagerGetBrowseControllerForTargetResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x25d36e51516bc3b4 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
PeerManagerGetControllerForTargetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PeerManagerGetControllerForTargetRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = PeerManagerControlHandle { inner: this.inner.clone() };
Ok(PeerManagerRequest::GetControllerForTarget {
peer_id: req.peer_id,
client: req.client,
responder: PeerManagerGetControllerForTargetResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x39a465c63e9f918c => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
PeerManagerSetAbsoluteVolumeHandlerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PeerManagerSetAbsoluteVolumeHandlerRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = PeerManagerControlHandle { inner: this.inner.clone() };
Ok(PeerManagerRequest::SetAbsoluteVolumeHandler {
handler: req.handler,
responder: PeerManagerSetAbsoluteVolumeHandlerResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4bc919acb791bdb3 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
PeerManagerRegisterTargetHandlerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<PeerManagerRegisterTargetHandlerRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = PeerManagerControlHandle { inner: this.inner.clone() };
Ok(PeerManagerRequest::RegisterTargetHandler {
handler: req.handler,
responder: PeerManagerRegisterTargetHandlerResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<PeerManagerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum PeerManagerRequest {
GetBrowseControllerForTarget {
peer_id: fidl_fuchsia_bluetooth::PeerId,
client: fidl::endpoints::ServerEnd<BrowseControllerMarker>,
responder: PeerManagerGetBrowseControllerForTargetResponder,
},
GetControllerForTarget {
peer_id: fidl_fuchsia_bluetooth::PeerId,
client: fidl::endpoints::ServerEnd<ControllerMarker>,
responder: PeerManagerGetControllerForTargetResponder,
},
SetAbsoluteVolumeHandler {
handler: fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
responder: PeerManagerSetAbsoluteVolumeHandlerResponder,
},
RegisterTargetHandler {
handler: fidl::endpoints::ClientEnd<TargetHandlerMarker>,
responder: PeerManagerRegisterTargetHandlerResponder,
},
}
impl PeerManagerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_browse_controller_for_target(
self,
) -> Option<(
fidl_fuchsia_bluetooth::PeerId,
fidl::endpoints::ServerEnd<BrowseControllerMarker>,
PeerManagerGetBrowseControllerForTargetResponder,
)> {
if let PeerManagerRequest::GetBrowseControllerForTarget { peer_id, client, responder } =
self
{
Some((peer_id, client, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_controller_for_target(
self,
) -> Option<(
fidl_fuchsia_bluetooth::PeerId,
fidl::endpoints::ServerEnd<ControllerMarker>,
PeerManagerGetControllerForTargetResponder,
)> {
if let PeerManagerRequest::GetControllerForTarget { peer_id, client, responder } = self {
Some((peer_id, client, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_absolute_volume_handler(
self,
) -> Option<(
fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
PeerManagerSetAbsoluteVolumeHandlerResponder,
)> {
if let PeerManagerRequest::SetAbsoluteVolumeHandler { handler, responder } = self {
Some((handler, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_register_target_handler(
self,
) -> Option<(
fidl::endpoints::ClientEnd<TargetHandlerMarker>,
PeerManagerRegisterTargetHandlerResponder,
)> {
if let PeerManagerRequest::RegisterTargetHandler { handler, responder } = self {
Some((handler, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
PeerManagerRequest::GetBrowseControllerForTarget { .. } => {
"get_browse_controller_for_target"
}
PeerManagerRequest::GetControllerForTarget { .. } => "get_controller_for_target",
PeerManagerRequest::SetAbsoluteVolumeHandler { .. } => "set_absolute_volume_handler",
PeerManagerRequest::RegisterTargetHandler { .. } => "register_target_handler",
}
}
}
#[derive(Debug, Clone)]
pub struct PeerManagerControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for PeerManagerControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl PeerManagerControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PeerManagerGetBrowseControllerForTargetResponder {
control_handle: std::mem::ManuallyDrop<PeerManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PeerManagerGetBrowseControllerForTargetResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PeerManagerGetBrowseControllerForTargetResponder {
type ControlHandle = PeerManagerControlHandle;
fn control_handle(&self) -> &PeerManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PeerManagerGetBrowseControllerForTargetResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x5b75bbb8d58a6d49,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PeerManagerGetControllerForTargetResponder {
control_handle: std::mem::ManuallyDrop<PeerManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PeerManagerGetControllerForTargetResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PeerManagerGetControllerForTargetResponder {
type ControlHandle = PeerManagerControlHandle;
fn control_handle(&self) -> &PeerManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PeerManagerGetControllerForTargetResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x25d36e51516bc3b4,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PeerManagerSetAbsoluteVolumeHandlerResponder {
control_handle: std::mem::ManuallyDrop<PeerManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PeerManagerSetAbsoluteVolumeHandlerResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PeerManagerSetAbsoluteVolumeHandlerResponder {
type ControlHandle = PeerManagerControlHandle;
fn control_handle(&self) -> &PeerManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PeerManagerSetAbsoluteVolumeHandlerResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x39a465c63e9f918c,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct PeerManagerRegisterTargetHandlerResponder {
control_handle: std::mem::ManuallyDrop<PeerManagerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for PeerManagerRegisterTargetHandlerResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for PeerManagerRegisterTargetHandlerResponder {
type ControlHandle = PeerManagerControlHandle;
fn control_handle(&self) -> &PeerManagerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl PeerManagerRegisterTargetHandlerResponder {
pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
result,
self.tx_id,
0x4bc919acb791bdb3,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct TargetHandlerMarker;
impl fidl::endpoints::ProtocolMarker for TargetHandlerMarker {
type Proxy = TargetHandlerProxy;
type RequestStream = TargetHandlerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = TargetHandlerSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) TargetHandler";
}
pub type TargetHandlerGetEventsSupportedResult = Result<Vec<NotificationEvent>, TargetAvcError>;
pub type TargetHandlerGetMediaAttributesResult = Result<MediaAttributes, TargetAvcError>;
pub type TargetHandlerGetPlayStatusResult = Result<PlayStatus, TargetAvcError>;
pub type TargetHandlerSendCommandResult = Result<(), TargetPassthroughError>;
pub type TargetHandlerListPlayerApplicationSettingAttributesResult =
Result<Vec<PlayerApplicationSettingAttributeId>, TargetAvcError>;
pub type TargetHandlerGetPlayerApplicationSettingsResult =
Result<PlayerApplicationSettings, TargetAvcError>;
pub type TargetHandlerSetPlayerApplicationSettingsResult =
Result<PlayerApplicationSettings, TargetAvcError>;
pub type TargetHandlerGetNotificationResult = Result<Notification, TargetAvcError>;
pub type TargetHandlerWatchNotificationResult = Result<Notification, TargetAvcError>;
pub type TargetHandlerSetAddressedPlayerResult = Result<(), TargetAvcError>;
pub type TargetHandlerGetMediaPlayerItemsResult = Result<Vec<MediaPlayerItem>, TargetAvcError>;
pub trait TargetHandlerProxyInterface: Send + Sync {
type GetEventsSupportedResponseFut: std::future::Future<Output = Result<TargetHandlerGetEventsSupportedResult, fidl::Error>>
+ Send;
fn r#get_events_supported(&self) -> Self::GetEventsSupportedResponseFut;
type GetMediaAttributesResponseFut: std::future::Future<Output = Result<TargetHandlerGetMediaAttributesResult, fidl::Error>>
+ Send;
fn r#get_media_attributes(&self) -> Self::GetMediaAttributesResponseFut;
type GetPlayStatusResponseFut: std::future::Future<Output = Result<TargetHandlerGetPlayStatusResult, fidl::Error>>
+ Send;
fn r#get_play_status(&self) -> Self::GetPlayStatusResponseFut;
type SendCommandResponseFut: std::future::Future<Output = Result<TargetHandlerSendCommandResult, fidl::Error>>
+ Send;
fn r#send_command(
&self,
command: AvcPanelCommand,
pressed: bool,
) -> Self::SendCommandResponseFut;
type ListPlayerApplicationSettingAttributesResponseFut: std::future::Future<
Output = Result<TargetHandlerListPlayerApplicationSettingAttributesResult, fidl::Error>,
> + Send;
fn r#list_player_application_setting_attributes(
&self,
) -> Self::ListPlayerApplicationSettingAttributesResponseFut;
type GetPlayerApplicationSettingsResponseFut: std::future::Future<
Output = Result<TargetHandlerGetPlayerApplicationSettingsResult, fidl::Error>,
> + Send;
fn r#get_player_application_settings(
&self,
attribute_ids: &[PlayerApplicationSettingAttributeId],
) -> Self::GetPlayerApplicationSettingsResponseFut;
type SetPlayerApplicationSettingsResponseFut: std::future::Future<
Output = Result<TargetHandlerSetPlayerApplicationSettingsResult, fidl::Error>,
> + Send;
fn r#set_player_application_settings(
&self,
requested_settings: &PlayerApplicationSettings,
) -> Self::SetPlayerApplicationSettingsResponseFut;
type GetNotificationResponseFut: std::future::Future<Output = Result<TargetHandlerGetNotificationResult, fidl::Error>>
+ Send;
fn r#get_notification(&self, event_id: NotificationEvent) -> Self::GetNotificationResponseFut;
type WatchNotificationResponseFut: std::future::Future<Output = Result<TargetHandlerWatchNotificationResult, fidl::Error>>
+ Send;
fn r#watch_notification(
&self,
event_id: NotificationEvent,
current: &Notification,
pos_change_interval: u32,
) -> Self::WatchNotificationResponseFut;
type SetAddressedPlayerResponseFut: std::future::Future<Output = Result<TargetHandlerSetAddressedPlayerResult, fidl::Error>>
+ Send;
fn r#set_addressed_player(
&self,
player_id: &AddressedPlayerId,
) -> Self::SetAddressedPlayerResponseFut;
type GetMediaPlayerItemsResponseFut: std::future::Future<Output = Result<TargetHandlerGetMediaPlayerItemsResult, fidl::Error>>
+ Send;
fn r#get_media_player_items(&self) -> Self::GetMediaPlayerItemsResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct TargetHandlerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for TargetHandlerSynchronousProxy {
type Proxy = TargetHandlerProxy;
type Protocol = TargetHandlerMarker;
fn from_channel(inner: fidl::Channel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
fn as_channel(&self) -> &fidl::Channel {
self.client.as_channel()
}
}
#[cfg(target_os = "fuchsia")]
impl TargetHandlerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <TargetHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
}
pub fn into_channel(self) -> fidl::Channel {
self.client.into_channel()
}
pub fn wait_for_event(
&self,
deadline: zx::MonotonicInstant,
) -> Result<TargetHandlerEvent, fidl::Error> {
TargetHandlerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_events_supported(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<TargetHandlerGetEventsSupportedResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
TargetHandlerGetEventsSupportedResponse,
TargetAvcError,
>>(
(),
0x54bb8d817d5e1257,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.notification_ids))
}
pub fn r#get_media_attributes(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<TargetHandlerGetMediaAttributesResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
TargetHandlerGetMediaAttributesResponse,
TargetAvcError,
>>(
(),
0x629f354d2805daf5,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.attributes))
}
pub fn r#get_play_status(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<TargetHandlerGetPlayStatusResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
TargetHandlerGetPlayStatusResponse,
TargetAvcError,
>>(
(),
0x24a4816300e14d89,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.play_status))
}
pub fn r#send_command(
&self,
mut command: AvcPanelCommand,
mut pressed: bool,
___deadline: zx::MonotonicInstant,
) -> Result<TargetHandlerSendCommandResult, fidl::Error> {
let _response =
self.client.send_query::<TargetHandlerSendCommandRequest, fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
TargetPassthroughError,
>>(
(command, pressed),
0x69e063a8f6ab7b87,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#list_player_application_setting_attributes(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<TargetHandlerListPlayerApplicationSettingAttributesResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
TargetHandlerListPlayerApplicationSettingAttributesResponse,
TargetAvcError,
>>(
(), 0xdfa38da6a60b2, fidl::encoding::DynamicFlags::empty(), ___deadline
)?;
Ok(_response.map(|x| x.attributes))
}
pub fn r#get_player_application_settings(
&self,
mut attribute_ids: &[PlayerApplicationSettingAttributeId],
___deadline: zx::MonotonicInstant,
) -> Result<TargetHandlerGetPlayerApplicationSettingsResult, fidl::Error> {
let _response = self.client.send_query::<
TargetHandlerGetPlayerApplicationSettingsRequest,
fidl::encoding::ResultType<TargetHandlerGetPlayerApplicationSettingsResponse, TargetAvcError>,
>(
(attribute_ids,),
0x4273f96bdb752751,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.current_settings))
}
pub fn r#set_player_application_settings(
&self,
mut requested_settings: &PlayerApplicationSettings,
___deadline: zx::MonotonicInstant,
) -> Result<TargetHandlerSetPlayerApplicationSettingsResult, fidl::Error> {
let _response = self.client.send_query::<
TargetHandlerSetPlayerApplicationSettingsRequest,
fidl::encoding::ResultType<TargetHandlerSetPlayerApplicationSettingsResponse, TargetAvcError>,
>(
(requested_settings,),
0x636dd18255e01998,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.set_settings))
}
pub fn r#get_notification(
&self,
mut event_id: NotificationEvent,
___deadline: zx::MonotonicInstant,
) -> Result<TargetHandlerGetNotificationResult, fidl::Error> {
let _response = self.client.send_query::<
TargetHandlerGetNotificationRequest,
fidl::encoding::ResultType<TargetHandlerGetNotificationResponse, TargetAvcError>,
>(
(event_id,),
0x60c7792539a032f1,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.current_value))
}
pub fn r#watch_notification(
&self,
mut event_id: NotificationEvent,
mut current: &Notification,
mut pos_change_interval: u32,
___deadline: zx::MonotonicInstant,
) -> Result<TargetHandlerWatchNotificationResult, fidl::Error> {
let _response =
self.client
.send_query::<TargetHandlerWatchNotificationRequest, fidl::encoding::ResultType<
TargetHandlerWatchNotificationResponse,
TargetAvcError,
>>(
(event_id, current, pos_change_interval),
0x2a513434cf256e5f,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.new_value))
}
pub fn r#set_addressed_player(
&self,
mut player_id: &AddressedPlayerId,
___deadline: zx::MonotonicInstant,
) -> Result<TargetHandlerSetAddressedPlayerResult, fidl::Error> {
let _response = self.client.send_query::<
TargetHandlerSetAddressedPlayerRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, TargetAvcError>,
>(
(player_id,),
0x6724ae8288c34d2f,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_media_player_items(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<TargetHandlerGetMediaPlayerItemsResult, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
TargetHandlerGetMediaPlayerItemsResponse,
TargetAvcError,
>>(
(),
0x736668f5aa3a8246,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.items))
}
}
#[derive(Debug, Clone)]
pub struct TargetHandlerProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for TargetHandlerProxy {
type Protocol = TargetHandlerMarker;
fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
Self::new(inner)
}
fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
self.client.into_channel().map_err(|client| Self { client })
}
fn as_channel(&self) -> &::fidl::AsyncChannel {
self.client.as_channel()
}
}
impl TargetHandlerProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <TargetHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> TargetHandlerEventStream {
TargetHandlerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_events_supported(
&self,
) -> fidl::client::QueryResponseFut<
TargetHandlerGetEventsSupportedResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
TargetHandlerProxyInterface::r#get_events_supported(self)
}
pub fn r#get_media_attributes(
&self,
) -> fidl::client::QueryResponseFut<
TargetHandlerGetMediaAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
TargetHandlerProxyInterface::r#get_media_attributes(self)
}
pub fn r#get_play_status(
&self,
) -> fidl::client::QueryResponseFut<
TargetHandlerGetPlayStatusResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
TargetHandlerProxyInterface::r#get_play_status(self)
}
pub fn r#send_command(
&self,
mut command: AvcPanelCommand,
mut pressed: bool,
) -> fidl::client::QueryResponseFut<
TargetHandlerSendCommandResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
TargetHandlerProxyInterface::r#send_command(self, command, pressed)
}
pub fn r#list_player_application_setting_attributes(
&self,
) -> fidl::client::QueryResponseFut<
TargetHandlerListPlayerApplicationSettingAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
TargetHandlerProxyInterface::r#list_player_application_setting_attributes(self)
}
pub fn r#get_player_application_settings(
&self,
mut attribute_ids: &[PlayerApplicationSettingAttributeId],
) -> fidl::client::QueryResponseFut<
TargetHandlerGetPlayerApplicationSettingsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
TargetHandlerProxyInterface::r#get_player_application_settings(self, attribute_ids)
}
pub fn r#set_player_application_settings(
&self,
mut requested_settings: &PlayerApplicationSettings,
) -> fidl::client::QueryResponseFut<
TargetHandlerSetPlayerApplicationSettingsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
TargetHandlerProxyInterface::r#set_player_application_settings(self, requested_settings)
}
pub fn r#get_notification(
&self,
mut event_id: NotificationEvent,
) -> fidl::client::QueryResponseFut<
TargetHandlerGetNotificationResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
TargetHandlerProxyInterface::r#get_notification(self, event_id)
}
pub fn r#watch_notification(
&self,
mut event_id: NotificationEvent,
mut current: &Notification,
mut pos_change_interval: u32,
) -> fidl::client::QueryResponseFut<
TargetHandlerWatchNotificationResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
TargetHandlerProxyInterface::r#watch_notification(
self,
event_id,
current,
pos_change_interval,
)
}
pub fn r#set_addressed_player(
&self,
mut player_id: &AddressedPlayerId,
) -> fidl::client::QueryResponseFut<
TargetHandlerSetAddressedPlayerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
TargetHandlerProxyInterface::r#set_addressed_player(self, player_id)
}
pub fn r#get_media_player_items(
&self,
) -> fidl::client::QueryResponseFut<
TargetHandlerGetMediaPlayerItemsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
TargetHandlerProxyInterface::r#get_media_player_items(self)
}
}
impl TargetHandlerProxyInterface for TargetHandlerProxy {
type GetEventsSupportedResponseFut = fidl::client::QueryResponseFut<
TargetHandlerGetEventsSupportedResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_events_supported(&self) -> Self::GetEventsSupportedResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<TargetHandlerGetEventsSupportedResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<TargetHandlerGetEventsSupportedResponse, TargetAvcError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x54bb8d817d5e1257,
>(_buf?)?;
Ok(_response.map(|x| x.notification_ids))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
TargetHandlerGetEventsSupportedResult,
>(
(),
0x54bb8d817d5e1257,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetMediaAttributesResponseFut = fidl::client::QueryResponseFut<
TargetHandlerGetMediaAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_media_attributes(&self) -> Self::GetMediaAttributesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<TargetHandlerGetMediaAttributesResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<TargetHandlerGetMediaAttributesResponse, TargetAvcError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x629f354d2805daf5,
>(_buf?)?;
Ok(_response.map(|x| x.attributes))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
TargetHandlerGetMediaAttributesResult,
>(
(),
0x629f354d2805daf5,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetPlayStatusResponseFut = fidl::client::QueryResponseFut<
TargetHandlerGetPlayStatusResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_play_status(&self) -> Self::GetPlayStatusResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<TargetHandlerGetPlayStatusResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<TargetHandlerGetPlayStatusResponse, TargetAvcError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x24a4816300e14d89,
>(_buf?)?;
Ok(_response.map(|x| x.play_status))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
TargetHandlerGetPlayStatusResult,
>(
(),
0x24a4816300e14d89,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SendCommandResponseFut = fidl::client::QueryResponseFut<
TargetHandlerSendCommandResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#send_command(
&self,
mut command: AvcPanelCommand,
mut pressed: bool,
) -> Self::SendCommandResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<TargetHandlerSendCommandResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, TargetPassthroughError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x69e063a8f6ab7b87,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
TargetHandlerSendCommandRequest,
TargetHandlerSendCommandResult,
>(
(command, pressed,),
0x69e063a8f6ab7b87,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type ListPlayerApplicationSettingAttributesResponseFut = fidl::client::QueryResponseFut<
TargetHandlerListPlayerApplicationSettingAttributesResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#list_player_application_setting_attributes(
&self,
) -> Self::ListPlayerApplicationSettingAttributesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<TargetHandlerListPlayerApplicationSettingAttributesResult, fidl::Error>
{
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
TargetHandlerListPlayerApplicationSettingAttributesResponse,
TargetAvcError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xdfa38da6a60b2,
>(_buf?)?;
Ok(_response.map(|x| x.attributes))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
TargetHandlerListPlayerApplicationSettingAttributesResult,
>(
(),
0xdfa38da6a60b2,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetPlayerApplicationSettingsResponseFut = fidl::client::QueryResponseFut<
TargetHandlerGetPlayerApplicationSettingsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_player_application_settings(
&self,
mut attribute_ids: &[PlayerApplicationSettingAttributeId],
) -> Self::GetPlayerApplicationSettingsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<TargetHandlerGetPlayerApplicationSettingsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
TargetHandlerGetPlayerApplicationSettingsResponse,
TargetAvcError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4273f96bdb752751,
>(_buf?)?;
Ok(_response.map(|x| x.current_settings))
}
self.client.send_query_and_decode::<
TargetHandlerGetPlayerApplicationSettingsRequest,
TargetHandlerGetPlayerApplicationSettingsResult,
>(
(attribute_ids,),
0x4273f96bdb752751,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetPlayerApplicationSettingsResponseFut = fidl::client::QueryResponseFut<
TargetHandlerSetPlayerApplicationSettingsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_player_application_settings(
&self,
mut requested_settings: &PlayerApplicationSettings,
) -> Self::SetPlayerApplicationSettingsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<TargetHandlerSetPlayerApplicationSettingsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
TargetHandlerSetPlayerApplicationSettingsResponse,
TargetAvcError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x636dd18255e01998,
>(_buf?)?;
Ok(_response.map(|x| x.set_settings))
}
self.client.send_query_and_decode::<
TargetHandlerSetPlayerApplicationSettingsRequest,
TargetHandlerSetPlayerApplicationSettingsResult,
>(
(requested_settings,),
0x636dd18255e01998,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetNotificationResponseFut = fidl::client::QueryResponseFut<
TargetHandlerGetNotificationResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_notification(
&self,
mut event_id: NotificationEvent,
) -> Self::GetNotificationResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<TargetHandlerGetNotificationResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<TargetHandlerGetNotificationResponse, TargetAvcError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x60c7792539a032f1,
>(_buf?)?;
Ok(_response.map(|x| x.current_value))
}
self.client.send_query_and_decode::<
TargetHandlerGetNotificationRequest,
TargetHandlerGetNotificationResult,
>(
(event_id,),
0x60c7792539a032f1,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WatchNotificationResponseFut = fidl::client::QueryResponseFut<
TargetHandlerWatchNotificationResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#watch_notification(
&self,
mut event_id: NotificationEvent,
mut current: &Notification,
mut pos_change_interval: u32,
) -> Self::WatchNotificationResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<TargetHandlerWatchNotificationResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<TargetHandlerWatchNotificationResponse, TargetAvcError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2a513434cf256e5f,
>(_buf?)?;
Ok(_response.map(|x| x.new_value))
}
self.client.send_query_and_decode::<
TargetHandlerWatchNotificationRequest,
TargetHandlerWatchNotificationResult,
>(
(event_id, current, pos_change_interval,),
0x2a513434cf256e5f,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetAddressedPlayerResponseFut = fidl::client::QueryResponseFut<
TargetHandlerSetAddressedPlayerResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_addressed_player(
&self,
mut player_id: &AddressedPlayerId,
) -> Self::SetAddressedPlayerResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<TargetHandlerSetAddressedPlayerResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, TargetAvcError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6724ae8288c34d2f,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
TargetHandlerSetAddressedPlayerRequest,
TargetHandlerSetAddressedPlayerResult,
>(
(player_id,),
0x6724ae8288c34d2f,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetMediaPlayerItemsResponseFut = fidl::client::QueryResponseFut<
TargetHandlerGetMediaPlayerItemsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_media_player_items(&self) -> Self::GetMediaPlayerItemsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<TargetHandlerGetMediaPlayerItemsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<
TargetHandlerGetMediaPlayerItemsResponse,
TargetAvcError,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x736668f5aa3a8246,
>(_buf?)?;
Ok(_response.map(|x| x.items))
}
self.client.send_query_and_decode::<
fidl::encoding::EmptyPayload,
TargetHandlerGetMediaPlayerItemsResult,
>(
(),
0x736668f5aa3a8246,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct TargetHandlerEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for TargetHandlerEventStream {}
impl futures::stream::FusedStream for TargetHandlerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for TargetHandlerEventStream {
type Item = Result<TargetHandlerEvent, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
&mut self.event_receiver,
cx
)?) {
Some(buf) => std::task::Poll::Ready(Some(TargetHandlerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum TargetHandlerEvent {}
impl TargetHandlerEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<TargetHandlerEvent, fidl::Error> {
let (bytes, _handles) = buf.split_mut();
let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
debug_assert_eq!(tx_header.tx_id, 0);
match tx_header.ordinal {
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <TargetHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct TargetHandlerRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for TargetHandlerRequestStream {}
impl futures::stream::FusedStream for TargetHandlerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for TargetHandlerRequestStream {
type Protocol = TargetHandlerMarker;
type ControlHandle = TargetHandlerControlHandle;
fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
}
fn control_handle(&self) -> Self::ControlHandle {
TargetHandlerControlHandle { inner: self.inner.clone() }
}
fn into_inner(
self,
) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
{
(self.inner, self.is_terminated)
}
fn from_inner(
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
) -> Self {
Self { inner, is_terminated }
}
}
impl futures::Stream for TargetHandlerRequestStream {
type Item = Result<TargetHandlerRequest, fidl::Error>;
fn poll_next(
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> std::task::Poll<Option<Self::Item>> {
let this = &mut *self;
if this.inner.check_shutdown(cx) {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
if this.is_terminated {
panic!("polled TargetHandlerRequestStream after completion");
}
fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
|bytes, handles| {
match this.inner.channel().read_etc(cx, bytes, handles) {
std::task::Poll::Ready(Ok(())) => {}
std::task::Poll::Pending => return std::task::Poll::Pending,
std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
this.is_terminated = true;
return std::task::Poll::Ready(None);
}
std::task::Poll::Ready(Err(e)) => {
return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
e.into(),
))))
}
}
let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
std::task::Poll::Ready(Some(match header.ordinal {
0x54bb8d817d5e1257 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
TargetHandlerControlHandle { inner: this.inner.clone() };
Ok(TargetHandlerRequest::GetEventsSupported {
responder: TargetHandlerGetEventsSupportedResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x629f354d2805daf5 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
TargetHandlerControlHandle { inner: this.inner.clone() };
Ok(TargetHandlerRequest::GetMediaAttributes {
responder: TargetHandlerGetMediaAttributesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x24a4816300e14d89 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
TargetHandlerControlHandle { inner: this.inner.clone() };
Ok(TargetHandlerRequest::GetPlayStatus {
responder: TargetHandlerGetPlayStatusResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x69e063a8f6ab7b87 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
TargetHandlerSendCommandRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TargetHandlerSendCommandRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
TargetHandlerControlHandle { inner: this.inner.clone() };
Ok(TargetHandlerRequest::SendCommand {
command: req.command,
pressed: req.pressed,
responder: TargetHandlerSendCommandResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xdfa38da6a60b2 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
TargetHandlerControlHandle { inner: this.inner.clone() };
Ok(TargetHandlerRequest::ListPlayerApplicationSettingAttributes {
responder:
TargetHandlerListPlayerApplicationSettingAttributesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x4273f96bdb752751 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
TargetHandlerGetPlayerApplicationSettingsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TargetHandlerGetPlayerApplicationSettingsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
TargetHandlerControlHandle { inner: this.inner.clone() };
Ok(TargetHandlerRequest::GetPlayerApplicationSettings {
attribute_ids: req.attribute_ids,
responder: TargetHandlerGetPlayerApplicationSettingsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x636dd18255e01998 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
TargetHandlerSetPlayerApplicationSettingsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TargetHandlerSetPlayerApplicationSettingsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
TargetHandlerControlHandle { inner: this.inner.clone() };
Ok(TargetHandlerRequest::SetPlayerApplicationSettings {
requested_settings: req.requested_settings,
responder: TargetHandlerSetPlayerApplicationSettingsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x60c7792539a032f1 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
TargetHandlerGetNotificationRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TargetHandlerGetNotificationRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
TargetHandlerControlHandle { inner: this.inner.clone() };
Ok(TargetHandlerRequest::GetNotification {
event_id: req.event_id,
responder: TargetHandlerGetNotificationResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2a513434cf256e5f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
TargetHandlerWatchNotificationRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TargetHandlerWatchNotificationRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
TargetHandlerControlHandle { inner: this.inner.clone() };
Ok(TargetHandlerRequest::WatchNotification {
event_id: req.event_id,
current: req.current,
pos_change_interval: req.pos_change_interval,
responder: TargetHandlerWatchNotificationResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6724ae8288c34d2f => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
TargetHandlerSetAddressedPlayerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<TargetHandlerSetAddressedPlayerRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
TargetHandlerControlHandle { inner: this.inner.clone() };
Ok(TargetHandlerRequest::SetAddressedPlayer {
player_id: req.player_id,
responder: TargetHandlerSetAddressedPlayerResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x736668f5aa3a8246 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
TargetHandlerControlHandle { inner: this.inner.clone() };
Ok(TargetHandlerRequest::GetMediaPlayerItems {
responder: TargetHandlerGetMediaPlayerItemsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<TargetHandlerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum TargetHandlerRequest {
GetEventsSupported { responder: TargetHandlerGetEventsSupportedResponder },
GetMediaAttributes { responder: TargetHandlerGetMediaAttributesResponder },
GetPlayStatus { responder: TargetHandlerGetPlayStatusResponder },
SendCommand {
command: AvcPanelCommand,
pressed: bool,
responder: TargetHandlerSendCommandResponder,
},
ListPlayerApplicationSettingAttributes {
responder: TargetHandlerListPlayerApplicationSettingAttributesResponder,
},
GetPlayerApplicationSettings {
attribute_ids: Vec<PlayerApplicationSettingAttributeId>,
responder: TargetHandlerGetPlayerApplicationSettingsResponder,
},
SetPlayerApplicationSettings {
requested_settings: PlayerApplicationSettings,
responder: TargetHandlerSetPlayerApplicationSettingsResponder,
},
GetNotification {
event_id: NotificationEvent,
responder: TargetHandlerGetNotificationResponder,
},
WatchNotification {
event_id: NotificationEvent,
current: Notification,
pos_change_interval: u32,
responder: TargetHandlerWatchNotificationResponder,
},
SetAddressedPlayer {
player_id: AddressedPlayerId,
responder: TargetHandlerSetAddressedPlayerResponder,
},
GetMediaPlayerItems { responder: TargetHandlerGetMediaPlayerItemsResponder },
}
impl TargetHandlerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_events_supported(self) -> Option<(TargetHandlerGetEventsSupportedResponder)> {
if let TargetHandlerRequest::GetEventsSupported { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_media_attributes(self) -> Option<(TargetHandlerGetMediaAttributesResponder)> {
if let TargetHandlerRequest::GetMediaAttributes { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_play_status(self) -> Option<(TargetHandlerGetPlayStatusResponder)> {
if let TargetHandlerRequest::GetPlayStatus { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_send_command(
self,
) -> Option<(AvcPanelCommand, bool, TargetHandlerSendCommandResponder)> {
if let TargetHandlerRequest::SendCommand { command, pressed, responder } = self {
Some((command, pressed, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_list_player_application_setting_attributes(
self,
) -> Option<(TargetHandlerListPlayerApplicationSettingAttributesResponder)> {
if let TargetHandlerRequest::ListPlayerApplicationSettingAttributes { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_player_application_settings(
self,
) -> Option<(
Vec<PlayerApplicationSettingAttributeId>,
TargetHandlerGetPlayerApplicationSettingsResponder,
)> {
if let TargetHandlerRequest::GetPlayerApplicationSettings { attribute_ids, responder } =
self
{
Some((attribute_ids, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_player_application_settings(
self,
) -> Option<(PlayerApplicationSettings, TargetHandlerSetPlayerApplicationSettingsResponder)>
{
if let TargetHandlerRequest::SetPlayerApplicationSettings {
requested_settings,
responder,
} = self
{
Some((requested_settings, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_notification(
self,
) -> Option<(NotificationEvent, TargetHandlerGetNotificationResponder)> {
if let TargetHandlerRequest::GetNotification { event_id, responder } = self {
Some((event_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_watch_notification(
self,
) -> Option<(NotificationEvent, Notification, u32, TargetHandlerWatchNotificationResponder)>
{
if let TargetHandlerRequest::WatchNotification {
event_id,
current,
pos_change_interval,
responder,
} = self
{
Some((event_id, current, pos_change_interval, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_addressed_player(
self,
) -> Option<(AddressedPlayerId, TargetHandlerSetAddressedPlayerResponder)> {
if let TargetHandlerRequest::SetAddressedPlayer { player_id, responder } = self {
Some((player_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_media_player_items(
self,
) -> Option<(TargetHandlerGetMediaPlayerItemsResponder)> {
if let TargetHandlerRequest::GetMediaPlayerItems { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
TargetHandlerRequest::GetEventsSupported { .. } => "get_events_supported",
TargetHandlerRequest::GetMediaAttributes { .. } => "get_media_attributes",
TargetHandlerRequest::GetPlayStatus { .. } => "get_play_status",
TargetHandlerRequest::SendCommand { .. } => "send_command",
TargetHandlerRequest::ListPlayerApplicationSettingAttributes { .. } => {
"list_player_application_setting_attributes"
}
TargetHandlerRequest::GetPlayerApplicationSettings { .. } => {
"get_player_application_settings"
}
TargetHandlerRequest::SetPlayerApplicationSettings { .. } => {
"set_player_application_settings"
}
TargetHandlerRequest::GetNotification { .. } => "get_notification",
TargetHandlerRequest::WatchNotification { .. } => "watch_notification",
TargetHandlerRequest::SetAddressedPlayer { .. } => "set_addressed_player",
TargetHandlerRequest::GetMediaPlayerItems { .. } => "get_media_player_items",
}
}
}
#[derive(Debug, Clone)]
pub struct TargetHandlerControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for TargetHandlerControlHandle {
fn shutdown(&self) {
self.inner.shutdown()
}
fn shutdown_with_epitaph(&self, status: zx_status::Status) {
self.inner.shutdown_with_epitaph(status)
}
fn is_closed(&self) -> bool {
self.inner.channel().is_closed()
}
fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
self.inner.channel().on_closed()
}
#[cfg(target_os = "fuchsia")]
fn signal_peer(
&self,
clear_mask: zx::Signals,
set_mask: zx::Signals,
) -> Result<(), zx_status::Status> {
use fidl::Peered;
self.inner.channel().signal_peer(clear_mask, set_mask)
}
}
impl TargetHandlerControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct TargetHandlerGetEventsSupportedResponder {
control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for TargetHandlerGetEventsSupportedResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for TargetHandlerGetEventsSupportedResponder {
type ControlHandle = TargetHandlerControlHandle;
fn control_handle(&self) -> &TargetHandlerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl TargetHandlerGetEventsSupportedResponder {
pub fn send(
self,
mut result: Result<&[NotificationEvent], TargetAvcError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&[NotificationEvent], TargetAvcError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&[NotificationEvent], TargetAvcError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
TargetHandlerGetEventsSupportedResponse,
TargetAvcError,
>>(
result.map(|notification_ids| (notification_ids,)),
self.tx_id,
0x54bb8d817d5e1257,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct TargetHandlerGetMediaAttributesResponder {
control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for TargetHandlerGetMediaAttributesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for TargetHandlerGetMediaAttributesResponder {
type ControlHandle = TargetHandlerControlHandle;
fn control_handle(&self) -> &TargetHandlerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl TargetHandlerGetMediaAttributesResponder {
pub fn send(
self,
mut result: Result<&MediaAttributes, TargetAvcError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&MediaAttributes, TargetAvcError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&MediaAttributes, TargetAvcError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
TargetHandlerGetMediaAttributesResponse,
TargetAvcError,
>>(
result.map(|attributes| (attributes,)),
self.tx_id,
0x629f354d2805daf5,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct TargetHandlerGetPlayStatusResponder {
control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for TargetHandlerGetPlayStatusResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for TargetHandlerGetPlayStatusResponder {
type ControlHandle = TargetHandlerControlHandle;
fn control_handle(&self) -> &TargetHandlerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl TargetHandlerGetPlayStatusResponder {
pub fn send(self, mut result: Result<&PlayStatus, TargetAvcError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&PlayStatus, TargetAvcError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&PlayStatus, TargetAvcError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
TargetHandlerGetPlayStatusResponse,
TargetAvcError,
>>(
result.map(|play_status| (play_status,)),
self.tx_id,
0x24a4816300e14d89,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct TargetHandlerSendCommandResponder {
control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for TargetHandlerSendCommandResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for TargetHandlerSendCommandResponder {
type ControlHandle = TargetHandlerControlHandle;
fn control_handle(&self) -> &TargetHandlerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl TargetHandlerSendCommandResponder {
pub fn send(self, mut result: Result<(), TargetPassthroughError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), TargetPassthroughError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), TargetPassthroughError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
TargetPassthroughError,
>>(
result,
self.tx_id,
0x69e063a8f6ab7b87,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct TargetHandlerListPlayerApplicationSettingAttributesResponder {
control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for TargetHandlerListPlayerApplicationSettingAttributesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for TargetHandlerListPlayerApplicationSettingAttributesResponder {
type ControlHandle = TargetHandlerControlHandle;
fn control_handle(&self) -> &TargetHandlerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl TargetHandlerListPlayerApplicationSettingAttributesResponder {
pub fn send(
self,
mut result: Result<&[PlayerApplicationSettingAttributeId], TargetAvcError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&[PlayerApplicationSettingAttributeId], TargetAvcError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&[PlayerApplicationSettingAttributeId], TargetAvcError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
TargetHandlerListPlayerApplicationSettingAttributesResponse,
TargetAvcError,
>>(
result.map(|attributes| (attributes,)),
self.tx_id,
0xdfa38da6a60b2,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct TargetHandlerGetPlayerApplicationSettingsResponder {
control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for TargetHandlerGetPlayerApplicationSettingsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for TargetHandlerGetPlayerApplicationSettingsResponder {
type ControlHandle = TargetHandlerControlHandle;
fn control_handle(&self) -> &TargetHandlerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl TargetHandlerGetPlayerApplicationSettingsResponder {
pub fn send(
self,
mut result: Result<&PlayerApplicationSettings, TargetAvcError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&PlayerApplicationSettings, TargetAvcError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&PlayerApplicationSettings, TargetAvcError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
TargetHandlerGetPlayerApplicationSettingsResponse,
TargetAvcError,
>>(
result.map(|current_settings| (current_settings,)),
self.tx_id,
0x4273f96bdb752751,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct TargetHandlerSetPlayerApplicationSettingsResponder {
control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for TargetHandlerSetPlayerApplicationSettingsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for TargetHandlerSetPlayerApplicationSettingsResponder {
type ControlHandle = TargetHandlerControlHandle;
fn control_handle(&self) -> &TargetHandlerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl TargetHandlerSetPlayerApplicationSettingsResponder {
pub fn send(
self,
mut result: Result<&PlayerApplicationSettings, TargetAvcError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&PlayerApplicationSettings, TargetAvcError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&PlayerApplicationSettings, TargetAvcError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
TargetHandlerSetPlayerApplicationSettingsResponse,
TargetAvcError,
>>(
result.map(|set_settings| (set_settings,)),
self.tx_id,
0x636dd18255e01998,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct TargetHandlerGetNotificationResponder {
control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for TargetHandlerGetNotificationResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for TargetHandlerGetNotificationResponder {
type ControlHandle = TargetHandlerControlHandle;
fn control_handle(&self) -> &TargetHandlerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl TargetHandlerGetNotificationResponder {
pub fn send(
self,
mut result: Result<&Notification, TargetAvcError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&Notification, TargetAvcError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&Notification, TargetAvcError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
TargetHandlerGetNotificationResponse,
TargetAvcError,
>>(
result.map(|current_value| (current_value,)),
self.tx_id,
0x60c7792539a032f1,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct TargetHandlerWatchNotificationResponder {
control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for TargetHandlerWatchNotificationResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for TargetHandlerWatchNotificationResponder {
type ControlHandle = TargetHandlerControlHandle;
fn control_handle(&self) -> &TargetHandlerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl TargetHandlerWatchNotificationResponder {
pub fn send(
self,
mut result: Result<&Notification, TargetAvcError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&Notification, TargetAvcError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&Notification, TargetAvcError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
TargetHandlerWatchNotificationResponse,
TargetAvcError,
>>(
result.map(|new_value| (new_value,)),
self.tx_id,
0x2a513434cf256e5f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct TargetHandlerSetAddressedPlayerResponder {
control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for TargetHandlerSetAddressedPlayerResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for TargetHandlerSetAddressedPlayerResponder {
type ControlHandle = TargetHandlerControlHandle;
fn control_handle(&self) -> &TargetHandlerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl TargetHandlerSetAddressedPlayerResponder {
pub fn send(self, mut result: Result<(), TargetAvcError>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<(), TargetAvcError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), TargetAvcError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
TargetAvcError,
>>(
result,
self.tx_id,
0x6724ae8288c34d2f,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct TargetHandlerGetMediaPlayerItemsResponder {
control_handle: std::mem::ManuallyDrop<TargetHandlerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for TargetHandlerGetMediaPlayerItemsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for TargetHandlerGetMediaPlayerItemsResponder {
type ControlHandle = TargetHandlerControlHandle;
fn control_handle(&self) -> &TargetHandlerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl TargetHandlerGetMediaPlayerItemsResponder {
pub fn send(
self,
mut result: Result<&[MediaPlayerItem], TargetAvcError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut result: Result<&[MediaPlayerItem], TargetAvcError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&[MediaPlayerItem], TargetAvcError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
TargetHandlerGetMediaPlayerItemsResponse,
TargetAvcError,
>>(
result.map(|items| (items,)),
self.tx_id,
0x736668f5aa3a8246,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for MajorPlayerType {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
impl fidl::encoding::ValueTypeMarker for MajorPlayerType {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for MajorPlayerType
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MajorPlayerType {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for Notifications {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
impl fidl::encoding::ValueTypeMarker for Notifications {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Notifications {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Notifications {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for PlayerFeatureBits {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
impl fidl::encoding::ValueTypeMarker for PlayerFeatureBits {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for PlayerFeatureBits
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PlayerFeatureBits {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u64>(offset);
*self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for PlayerFeatureBitsExt {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
impl fidl::encoding::ValueTypeMarker for PlayerFeatureBitsExt {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for PlayerFeatureBitsExt
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PlayerFeatureBitsExt {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u64>(offset);
*self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for PlayerSubType {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
impl fidl::encoding::ValueTypeMarker for PlayerSubType {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for PlayerSubType {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
if self.bits() & Self::all().bits() != self.bits() {
return Err(fidl::Error::InvalidBitsValue);
}
encoder.write_num(self.bits(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PlayerSubType {
#[inline(always)]
fn new_empty() -> Self {
Self::empty()
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_bits(prim).ok_or(fidl::Error::InvalidBitsValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for AvcPanelCommand {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for AvcPanelCommand {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for AvcPanelCommand
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AvcPanelCommand {
#[inline(always)]
fn new_empty() -> Self {
Self::Select
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for BatteryStatus {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for BatteryStatus {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for BatteryStatus {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BatteryStatus {
#[inline(always)]
fn new_empty() -> Self {
Self::Normal
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for BrowseControllerError {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for BrowseControllerError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for BrowseControllerError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BrowseControllerError {
#[inline(always)]
fn new_empty() -> Self {
Self::UnknownFailure
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerError {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ControllerError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for ControllerError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ControllerError {
#[inline(always)]
fn new_empty() -> Self {
Self::UnknownFailure
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for Equalizer {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for Equalizer {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for Equalizer {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Equalizer {
#[inline(always)]
fn new_empty() -> Self {
Self::Off
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for FolderType {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for FolderType {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for FolderType {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FolderType {
#[inline(always)]
fn new_empty() -> Self {
Self::Mixed
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for MediaAttributeId {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for MediaAttributeId {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for MediaAttributeId
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MediaAttributeId {
#[inline(always)]
fn new_empty() -> Self {
Self::Title
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for MediaType {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for MediaType {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for MediaType {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MediaType {
#[inline(always)]
fn new_empty() -> Self {
Self::Audio
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for NotificationEvent {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for NotificationEvent {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for NotificationEvent
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for NotificationEvent {
#[inline(always)]
fn new_empty() -> Self {
Self::PlaybackStatusChanged
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for PlaybackStatus {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for PlaybackStatus {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for PlaybackStatus {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PlaybackStatus {
#[inline(always)]
fn new_empty() -> Self {
Self::Stopped
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for PlayerApplicationSettingAttributeId {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for PlayerApplicationSettingAttributeId {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for PlayerApplicationSettingAttributeId
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for PlayerApplicationSettingAttributeId
{
#[inline(always)]
fn new_empty() -> Self {
Self::Equalizer
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for RepeatStatusMode {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for RepeatStatusMode {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for RepeatStatusMode
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for RepeatStatusMode {
#[inline(always)]
fn new_empty() -> Self {
Self::Off
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ScanMode {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ScanMode {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ScanMode {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ScanMode {
#[inline(always)]
fn new_empty() -> Self {
Self::Off
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for ShuffleMode {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for ShuffleMode {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ShuffleMode {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ShuffleMode {
#[inline(always)]
fn new_empty() -> Self {
Self::Off
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for SystemStatus {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u8>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u8>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for SystemStatus {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for SystemStatus {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SystemStatus {
#[inline(always)]
fn new_empty() -> Self {
Self::PowerOn
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u8>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for TargetAvcError {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for TargetAvcError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for TargetAvcError {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TargetAvcError {
#[inline(always)]
fn new_empty() -> Self {
Self::RejectedInvalidCommand
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for TargetPassthroughError {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u32>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u32>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for TargetPassthroughError {
type Borrowed<'a> = Self;
#[inline(always)]
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
*value
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
for TargetPassthroughError
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Self>(offset);
encoder.write_num(self.into_primitive(), offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for TargetPassthroughError
{
#[inline(always)]
fn new_empty() -> Self {
Self::CommandNotImplemented
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let prim = decoder.read_num::<u32>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for AbsoluteVolumeHandlerGetCurrentVolumeResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AbsoluteVolumeHandlerGetCurrentVolumeResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<AbsoluteVolumeHandlerGetCurrentVolumeResponse, D>
for &AbsoluteVolumeHandlerGetCurrentVolumeResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AbsoluteVolumeHandlerGetCurrentVolumeResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut AbsoluteVolumeHandlerGetCurrentVolumeResponse).write_unaligned(
(self as *const AbsoluteVolumeHandlerGetCurrentVolumeResponse).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
fidl::encoding::Encode<AbsoluteVolumeHandlerGetCurrentVolumeResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AbsoluteVolumeHandlerGetCurrentVolumeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for AbsoluteVolumeHandlerGetCurrentVolumeResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { volume: fidl::new_empty!(u8, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for AbsoluteVolumeHandlerOnVolumeChangedResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AbsoluteVolumeHandlerOnVolumeChangedResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<AbsoluteVolumeHandlerOnVolumeChangedResponse, D>
for &AbsoluteVolumeHandlerOnVolumeChangedResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AbsoluteVolumeHandlerOnVolumeChangedResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut AbsoluteVolumeHandlerOnVolumeChangedResponse).write_unaligned(
(self as *const AbsoluteVolumeHandlerOnVolumeChangedResponse).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
fidl::encoding::Encode<AbsoluteVolumeHandlerOnVolumeChangedResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AbsoluteVolumeHandlerOnVolumeChangedResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for AbsoluteVolumeHandlerOnVolumeChangedResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { new_volume: fidl::new_empty!(u8, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for AbsoluteVolumeHandlerSetVolumeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AbsoluteVolumeHandlerSetVolumeRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<AbsoluteVolumeHandlerSetVolumeRequest, D>
for &AbsoluteVolumeHandlerSetVolumeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AbsoluteVolumeHandlerSetVolumeRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut AbsoluteVolumeHandlerSetVolumeRequest)
.write_unaligned((self as *const AbsoluteVolumeHandlerSetVolumeRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
fidl::encoding::Encode<AbsoluteVolumeHandlerSetVolumeRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AbsoluteVolumeHandlerSetVolumeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for AbsoluteVolumeHandlerSetVolumeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { requested_volume: fidl::new_empty!(u8, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for AbsoluteVolumeHandlerSetVolumeResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AbsoluteVolumeHandlerSetVolumeResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<AbsoluteVolumeHandlerSetVolumeResponse, D>
for &AbsoluteVolumeHandlerSetVolumeResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AbsoluteVolumeHandlerSetVolumeResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut AbsoluteVolumeHandlerSetVolumeResponse).write_unaligned(
(self as *const AbsoluteVolumeHandlerSetVolumeResponse).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
fidl::encoding::Encode<AbsoluteVolumeHandlerSetVolumeResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AbsoluteVolumeHandlerSetVolumeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for AbsoluteVolumeHandlerSetVolumeResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { set_volume: fidl::new_empty!(u8, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for AddressedPlayerId {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AddressedPlayerId {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<AddressedPlayerId, D>
for &AddressedPlayerId
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddressedPlayerId>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut AddressedPlayerId)
.write_unaligned((self as *const AddressedPlayerId).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
fidl::encoding::Encode<AddressedPlayerId, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AddressedPlayerId>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for AddressedPlayerId {
#[inline(always)]
fn new_empty() -> Self {
Self { id: fidl::new_empty!(u16, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BrowseControllerChangePathRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BrowseControllerChangePathRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BrowseControllerChangePathRequest, D>
for &BrowseControllerChangePathRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerChangePathRequest>(offset);
fidl::encoding::Encode::<BrowseControllerChangePathRequest, D>::encode(
(<Path as fidl::encoding::ValueTypeMarker>::borrow(&self.path),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Path, D>>
fidl::encoding::Encode<BrowseControllerChangePathRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerChangePathRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BrowseControllerChangePathRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { path: fidl::new_empty!(Path, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Path, D, &mut self.path, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BrowseControllerGetFileSystemItemsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BrowseControllerGetFileSystemItemsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BrowseControllerGetFileSystemItemsRequest, D>
for &BrowseControllerGetFileSystemItemsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerGetFileSystemItemsRequest>(offset);
fidl::encoding::Encode::<BrowseControllerGetFileSystemItemsRequest, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.start_index),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_index),
<AttributeRequestOption as fidl::encoding::ValueTypeMarker>::borrow(
&self.attribute_option,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<AttributeRequestOption, D>,
> fidl::encoding::Encode<BrowseControllerGetFileSystemItemsRequest, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerGetFileSystemItemsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BrowseControllerGetFileSystemItemsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
start_index: fidl::new_empty!(u32, D),
end_index: fidl::new_empty!(u32, D),
attribute_option: fidl::new_empty!(AttributeRequestOption, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.start_index, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.end_index, decoder, offset + 4, _depth)?;
fidl::decode!(
AttributeRequestOption,
D,
&mut self.attribute_option,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BrowseControllerGetMediaPlayerItemsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BrowseControllerGetMediaPlayerItemsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BrowseControllerGetMediaPlayerItemsRequest, D>
for &BrowseControllerGetMediaPlayerItemsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerGetMediaPlayerItemsRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BrowseControllerGetMediaPlayerItemsRequest).write_unaligned(
(self as *const BrowseControllerGetMediaPlayerItemsRequest).read(),
);
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<BrowseControllerGetMediaPlayerItemsRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerGetMediaPlayerItemsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BrowseControllerGetMediaPlayerItemsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { start_index: fidl::new_empty!(u32, D), end_index: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BrowseControllerGetNowPlayingItemsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BrowseControllerGetNowPlayingItemsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BrowseControllerGetNowPlayingItemsRequest, D>
for &BrowseControllerGetNowPlayingItemsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerGetNowPlayingItemsRequest>(offset);
fidl::encoding::Encode::<BrowseControllerGetNowPlayingItemsRequest, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.start_index),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.end_index),
<AttributeRequestOption as fidl::encoding::ValueTypeMarker>::borrow(
&self.attribute_option,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
T2: fidl::encoding::Encode<AttributeRequestOption, D>,
> fidl::encoding::Encode<BrowseControllerGetNowPlayingItemsRequest, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerGetNowPlayingItemsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
self.2.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BrowseControllerGetNowPlayingItemsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
start_index: fidl::new_empty!(u32, D),
end_index: fidl::new_empty!(u32, D),
attribute_option: fidl::new_empty!(AttributeRequestOption, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(u32, D, &mut self.start_index, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.end_index, decoder, offset + 4, _depth)?;
fidl::decode!(
AttributeRequestOption,
D,
&mut self.attribute_option,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BrowseControllerPlayFileSystemItemRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BrowseControllerPlayFileSystemItemRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BrowseControllerPlayFileSystemItemRequest, D>
for &BrowseControllerPlayFileSystemItemRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerPlayFileSystemItemRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BrowseControllerPlayFileSystemItemRequest).write_unaligned(
(self as *const BrowseControllerPlayFileSystemItemRequest).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<BrowseControllerPlayFileSystemItemRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerPlayFileSystemItemRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BrowseControllerPlayFileSystemItemRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { uid: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BrowseControllerPlayNowPlayingItemRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BrowseControllerPlayNowPlayingItemRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BrowseControllerPlayNowPlayingItemRequest, D>
for &BrowseControllerPlayNowPlayingItemRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerPlayNowPlayingItemRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BrowseControllerPlayNowPlayingItemRequest).write_unaligned(
(self as *const BrowseControllerPlayNowPlayingItemRequest).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<BrowseControllerPlayNowPlayingItemRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerPlayNowPlayingItemRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BrowseControllerPlayNowPlayingItemRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { uid: fidl::new_empty!(u64, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 8);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BrowseControllerSetBrowsedPlayerRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BrowseControllerSetBrowsedPlayerRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BrowseControllerSetBrowsedPlayerRequest, D>
for &BrowseControllerSetBrowsedPlayerRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerSetBrowsedPlayerRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BrowseControllerSetBrowsedPlayerRequest).write_unaligned(
(self as *const BrowseControllerSetBrowsedPlayerRequest).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
fidl::encoding::Encode<BrowseControllerSetBrowsedPlayerRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerSetBrowsedPlayerRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BrowseControllerSetBrowsedPlayerRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { player_id: fidl::new_empty!(u16, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BrowseControllerChangePathResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BrowseControllerChangePathResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BrowseControllerChangePathResponse, D>
for &BrowseControllerChangePathResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerChangePathResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut BrowseControllerChangePathResponse)
.write_unaligned((self as *const BrowseControllerChangePathResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
fidl::encoding::Encode<BrowseControllerChangePathResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerChangePathResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BrowseControllerChangePathResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { num_items: fidl::new_empty!(u32, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BrowseControllerGetFileSystemItemsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BrowseControllerGetFileSystemItemsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BrowseControllerGetFileSystemItemsResponse, D>
for &BrowseControllerGetFileSystemItemsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerGetFileSystemItemsResponse>(offset);
fidl::encoding::Encode::<BrowseControllerGetFileSystemItemsResponse, D>::encode(
(
<fidl::encoding::Vector<FileSystemItem, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<FileSystemItem, 16>, D>,
> fidl::encoding::Encode<BrowseControllerGetFileSystemItemsResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerGetFileSystemItemsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BrowseControllerGetFileSystemItemsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { items: fidl::new_empty!(fidl::encoding::Vector<FileSystemItem, 16>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<FileSystemItem, 16>, D, &mut self.items, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BrowseControllerGetMediaPlayerItemsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BrowseControllerGetMediaPlayerItemsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BrowseControllerGetMediaPlayerItemsResponse, D>
for &BrowseControllerGetMediaPlayerItemsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerGetMediaPlayerItemsResponse>(offset);
fidl::encoding::Encode::<BrowseControllerGetMediaPlayerItemsResponse, D>::encode(
(
<fidl::encoding::Vector<MediaPlayerItem, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<MediaPlayerItem, 16>, D>,
> fidl::encoding::Encode<BrowseControllerGetMediaPlayerItemsResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerGetMediaPlayerItemsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BrowseControllerGetMediaPlayerItemsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { items: fidl::new_empty!(fidl::encoding::Vector<MediaPlayerItem, 16>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<MediaPlayerItem, 16>, D, &mut self.items, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for BrowseControllerGetNowPlayingItemsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for BrowseControllerGetNowPlayingItemsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<BrowseControllerGetNowPlayingItemsResponse, D>
for &BrowseControllerGetNowPlayingItemsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerGetNowPlayingItemsResponse>(offset);
fidl::encoding::Encode::<BrowseControllerGetNowPlayingItemsResponse, D>::encode(
(
<fidl::encoding::Vector<MediaElementItem, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<MediaElementItem, 16>, D>,
> fidl::encoding::Encode<BrowseControllerGetNowPlayingItemsResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<BrowseControllerGetNowPlayingItemsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for BrowseControllerGetNowPlayingItemsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { items: fidl::new_empty!(fidl::encoding::Vector<MediaElementItem, 16>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<MediaElementItem, 16>, D, &mut self.items, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerGetPlayerApplicationSettingsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerGetPlayerApplicationSettingsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControllerGetPlayerApplicationSettingsRequest, D>
for &ControllerGetPlayerApplicationSettingsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerGetPlayerApplicationSettingsRequest>(offset);
fidl::encoding::Encode::<ControllerGetPlayerApplicationSettingsRequest, D>::encode(
(
<fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131> as fidl::encoding::ValueTypeMarker>::borrow(&self.attribute_ids),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<
fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>,
D,
>,
> fidl::encoding::Encode<ControllerGetPlayerApplicationSettingsRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerGetPlayerApplicationSettingsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerGetPlayerApplicationSettingsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
attribute_ids: fidl::new_empty!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D, &mut self.attribute_ids, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerInformBatteryStatusRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerInformBatteryStatusRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControllerInformBatteryStatusRequest, D>
for &ControllerInformBatteryStatusRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerInformBatteryStatusRequest>(offset);
fidl::encoding::Encode::<ControllerInformBatteryStatusRequest, D>::encode(
(<BatteryStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.battery_status),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<BatteryStatus, D>>
fidl::encoding::Encode<ControllerInformBatteryStatusRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerInformBatteryStatusRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerInformBatteryStatusRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { battery_status: fidl::new_empty!(BatteryStatus, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(BatteryStatus, D, &mut self.battery_status, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerOnNotificationRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerOnNotificationRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControllerOnNotificationRequest, D>
for &ControllerOnNotificationRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerOnNotificationRequest>(offset);
fidl::encoding::Encode::<ControllerOnNotificationRequest, D>::encode(
(
<i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.timestamp),
<Notification as fidl::encoding::ValueTypeMarker>::borrow(&self.notification),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<i64, D>,
T1: fidl::encoding::Encode<Notification, D>,
> fidl::encoding::Encode<ControllerOnNotificationRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerOnNotificationRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerOnNotificationRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
timestamp: fidl::new_empty!(i64, D),
notification: fidl::new_empty!(Notification, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(i64, D, &mut self.timestamp, decoder, offset + 0, _depth)?;
fidl::decode!(Notification, D, &mut self.notification, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerSendCommandRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerSendCommandRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControllerSendCommandRequest, D> for &ControllerSendCommandRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerSendCommandRequest>(offset);
fidl::encoding::Encode::<ControllerSendCommandRequest, D>::encode(
(<AvcPanelCommand as fidl::encoding::ValueTypeMarker>::borrow(&self.command),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AvcPanelCommand, D>>
fidl::encoding::Encode<ControllerSendCommandRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerSendCommandRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerSendCommandRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { command: fidl::new_empty!(AvcPanelCommand, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(AvcPanelCommand, D, &mut self.command, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerSetAbsoluteVolumeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerSetAbsoluteVolumeRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControllerSetAbsoluteVolumeRequest, D>
for &ControllerSetAbsoluteVolumeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerSetAbsoluteVolumeRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ControllerSetAbsoluteVolumeRequest)
.write_unaligned((self as *const ControllerSetAbsoluteVolumeRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
fidl::encoding::Encode<ControllerSetAbsoluteVolumeRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerSetAbsoluteVolumeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerSetAbsoluteVolumeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { requested_volume: fidl::new_empty!(u8, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerSetAddressedPlayerRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerSetAddressedPlayerRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControllerSetAddressedPlayerRequest, D>
for &ControllerSetAddressedPlayerRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerSetAddressedPlayerRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ControllerSetAddressedPlayerRequest)
.write_unaligned((self as *const ControllerSetAddressedPlayerRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u16, D>>
fidl::encoding::Encode<ControllerSetAddressedPlayerRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerSetAddressedPlayerRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerSetAddressedPlayerRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { player_id: fidl::new_empty!(u16, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerSetNotificationFilterRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerSetNotificationFilterRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
8
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControllerSetNotificationFilterRequest, D>
for &ControllerSetNotificationFilterRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerSetNotificationFilterRequest>(offset);
fidl::encoding::Encode::<ControllerSetNotificationFilterRequest, D>::encode(
(
<Notifications as fidl::encoding::ValueTypeMarker>::borrow(&self.notifications),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(
&self.position_change_interval,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<Notifications, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<ControllerSetNotificationFilterRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerSetNotificationFilterRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerSetNotificationFilterRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
notifications: fidl::new_empty!(Notifications, D),
position_change_interval: fidl::new_empty!(u32, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Notifications, D, &mut self.notifications, decoder, offset + 0, _depth)?;
fidl::decode!(u32, D, &mut self.position_change_interval, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerSetPlayerApplicationSettingsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerSetPlayerApplicationSettingsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControllerSetPlayerApplicationSettingsRequest, D>
for &ControllerSetPlayerApplicationSettingsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerSetPlayerApplicationSettingsRequest>(offset);
fidl::encoding::Encode::<ControllerSetPlayerApplicationSettingsRequest, D>::encode(
(<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
&self.requested_settings,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
> fidl::encoding::Encode<ControllerSetPlayerApplicationSettingsRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerSetPlayerApplicationSettingsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerSetPlayerApplicationSettingsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { requested_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
PlayerApplicationSettings,
D,
&mut self.requested_settings,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerGetMediaAttributesResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerGetMediaAttributesResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControllerGetMediaAttributesResponse, D>
for &ControllerGetMediaAttributesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerGetMediaAttributesResponse>(offset);
fidl::encoding::Encode::<ControllerGetMediaAttributesResponse, D>::encode(
(<MediaAttributes as fidl::encoding::ValueTypeMarker>::borrow(&self.attributes),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<MediaAttributes, D>>
fidl::encoding::Encode<ControllerGetMediaAttributesResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerGetMediaAttributesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerGetMediaAttributesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { attributes: fidl::new_empty!(MediaAttributes, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(MediaAttributes, D, &mut self.attributes, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerGetPlayStatusResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerGetPlayStatusResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControllerGetPlayStatusResponse, D>
for &ControllerGetPlayStatusResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerGetPlayStatusResponse>(offset);
fidl::encoding::Encode::<ControllerGetPlayStatusResponse, D>::encode(
(<PlayStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.play_status),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PlayStatus, D>>
fidl::encoding::Encode<ControllerGetPlayStatusResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerGetPlayStatusResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerGetPlayStatusResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { play_status: fidl::new_empty!(PlayStatus, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(PlayStatus, D, &mut self.play_status, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerGetPlayerApplicationSettingsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerGetPlayerApplicationSettingsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControllerGetPlayerApplicationSettingsResponse, D>
for &ControllerGetPlayerApplicationSettingsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerGetPlayerApplicationSettingsResponse>(offset);
fidl::encoding::Encode::<ControllerGetPlayerApplicationSettingsResponse, D>::encode(
(<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
&self.current_settings,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
> fidl::encoding::Encode<ControllerGetPlayerApplicationSettingsResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerGetPlayerApplicationSettingsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerGetPlayerApplicationSettingsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { current_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
PlayerApplicationSettings,
D,
&mut self.current_settings,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerSetAbsoluteVolumeResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerSetAbsoluteVolumeResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControllerSetAbsoluteVolumeResponse, D>
for &ControllerSetAbsoluteVolumeResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerSetAbsoluteVolumeResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut ControllerSetAbsoluteVolumeResponse)
.write_unaligned((self as *const ControllerSetAbsoluteVolumeResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u8, D>>
fidl::encoding::Encode<ControllerSetAbsoluteVolumeResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerSetAbsoluteVolumeResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerSetAbsoluteVolumeResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { set_volume: fidl::new_empty!(u8, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 1);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for ControllerSetPlayerApplicationSettingsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ControllerSetPlayerApplicationSettingsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<ControllerSetPlayerApplicationSettingsResponse, D>
for &ControllerSetPlayerApplicationSettingsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerSetPlayerApplicationSettingsResponse>(offset);
fidl::encoding::Encode::<ControllerSetPlayerApplicationSettingsResponse, D>::encode(
(<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
&self.set_settings,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
> fidl::encoding::Encode<ControllerSetPlayerApplicationSettingsResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ControllerSetPlayerApplicationSettingsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for ControllerSetPlayerApplicationSettingsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { set_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
PlayerApplicationSettings,
D,
&mut self.set_settings,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CustomAttributeValue {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CustomAttributeValue {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
24
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<CustomAttributeValue, D>
for &CustomAttributeValue
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CustomAttributeValue>(offset);
fidl::encoding::Encode::<CustomAttributeValue, D>::encode(
(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow(
&self.description,
),
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.value),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<255>, D>,
T1: fidl::encoding::Encode<u8, D>,
> fidl::encoding::Encode<CustomAttributeValue, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CustomAttributeValue>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CustomAttributeValue {
#[inline(always)]
fn new_empty() -> Self {
Self {
description: fidl::new_empty!(fidl::encoding::BoundedString<255>, D),
value: fidl::new_empty!(u8, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
&mut self.description,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(u8, D, &mut self.value, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Parent {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Parent {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Parent, D> for &Parent {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Parent>(offset);
encoder.write_num(0u8, offset);
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Parent {
#[inline(always)]
fn new_empty() -> Self {
Self
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
match decoder.read_num::<u8>(offset) {
0 => Ok(()),
_ => Err(fidl::Error::Invalid),
}
}
}
impl fidl::encoding::ResourceTypeMarker for PeerManagerGetBrowseControllerForTargetRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PeerManagerGetBrowseControllerForTargetRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
PeerManagerGetBrowseControllerForTargetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut PeerManagerGetBrowseControllerForTargetRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PeerManagerGetBrowseControllerForTargetRequest>(offset);
fidl::encoding::Encode::<PeerManagerGetBrowseControllerForTargetRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl_fuchsia_bluetooth::PeerId as fidl::encoding::ValueTypeMarker>::borrow(&self.peer_id),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BrowseControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.client),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl_fuchsia_bluetooth::PeerId,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BrowseControllerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
PeerManagerGetBrowseControllerForTargetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PeerManagerGetBrowseControllerForTargetRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for PeerManagerGetBrowseControllerForTargetRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
peer_id: fidl::new_empty!(
fidl_fuchsia_bluetooth::PeerId,
fidl::encoding::DefaultFuchsiaResourceDialect
),
client: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BrowseControllerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl_fuchsia_bluetooth::PeerId,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.peer_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<BrowseControllerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.client,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for PeerManagerGetControllerForTargetRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PeerManagerGetControllerForTargetRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl
fidl::encoding::Encode<
PeerManagerGetControllerForTargetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut PeerManagerGetControllerForTargetRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PeerManagerGetControllerForTargetRequest>(offset);
fidl::encoding::Encode::<PeerManagerGetControllerForTargetRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl_fuchsia_bluetooth::PeerId as fidl::encoding::ValueTypeMarker>::borrow(&self.peer_id),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.client),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl_fuchsia_bluetooth::PeerId,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
PeerManagerGetControllerForTargetRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PeerManagerGetControllerForTargetRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for PeerManagerGetControllerForTargetRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
peer_id: fidl::new_empty!(
fidl_fuchsia_bluetooth::PeerId,
fidl::encoding::DefaultFuchsiaResourceDialect
),
client: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
fidl_fuchsia_bluetooth::PeerId,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.peer_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<ControllerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.client,
decoder,
offset + 8,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for PeerManagerRegisterTargetHandlerRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PeerManagerRegisterTargetHandlerRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
PeerManagerRegisterTargetHandlerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut PeerManagerRegisterTargetHandlerRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PeerManagerRegisterTargetHandlerRequest>(offset);
fidl::encoding::Encode::<PeerManagerRegisterTargetHandlerRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<TargetHandlerMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.handler),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<TargetHandlerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
PeerManagerRegisterTargetHandlerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PeerManagerRegisterTargetHandlerRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for PeerManagerRegisterTargetHandlerRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
handler: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<TargetHandlerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<TargetHandlerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.handler,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for PeerManagerSetAbsoluteVolumeHandlerRequest {
type Borrowed<'a> = &'a mut Self;
fn take_or_borrow<'a>(
value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
) -> Self::Borrowed<'a> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PeerManagerSetAbsoluteVolumeHandlerRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
4
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl
fidl::encoding::Encode<
PeerManagerSetAbsoluteVolumeHandlerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut PeerManagerSetAbsoluteVolumeHandlerRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PeerManagerSetAbsoluteVolumeHandlerRequest>(offset);
fidl::encoding::Encode::<
PeerManagerSetAbsoluteVolumeHandlerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.handler
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
PeerManagerSetAbsoluteVolumeHandlerRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PeerManagerSetAbsoluteVolumeHandlerRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for PeerManagerSetAbsoluteVolumeHandlerRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
handler: fidl::new_empty!(
fidl::encoding::Endpoint<
fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>,
>,
fidl::encoding::DefaultFuchsiaResourceDialect
),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<
'_,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<AbsoluteVolumeHandlerMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.handler,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for TargetHandlerGetNotificationRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetNotificationRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
1
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<TargetHandlerGetNotificationRequest, D>
for &TargetHandlerGetNotificationRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerGetNotificationRequest>(offset);
fidl::encoding::Encode::<TargetHandlerGetNotificationRequest, D>::encode(
(<NotificationEvent as fidl::encoding::ValueTypeMarker>::borrow(&self.event_id),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<NotificationEvent, D>>
fidl::encoding::Encode<TargetHandlerGetNotificationRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerGetNotificationRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for TargetHandlerGetNotificationRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { event_id: fidl::new_empty!(NotificationEvent, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(NotificationEvent, D, &mut self.event_id, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for TargetHandlerGetPlayerApplicationSettingsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetPlayerApplicationSettingsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<TargetHandlerGetPlayerApplicationSettingsRequest, D>
for &TargetHandlerGetPlayerApplicationSettingsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerGetPlayerApplicationSettingsRequest>(offset);
fidl::encoding::Encode::<TargetHandlerGetPlayerApplicationSettingsRequest, D>::encode(
(
<fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131> as fidl::encoding::ValueTypeMarker>::borrow(&self.attribute_ids),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<
fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>,
D,
>,
> fidl::encoding::Encode<TargetHandlerGetPlayerApplicationSettingsRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerGetPlayerApplicationSettingsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for TargetHandlerGetPlayerApplicationSettingsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
attribute_ids: fidl::new_empty!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D, &mut self.attribute_ids, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for TargetHandlerSendCommandRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for TargetHandlerSendCommandRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<TargetHandlerSendCommandRequest, D>
for &TargetHandlerSendCommandRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerSendCommandRequest>(offset);
fidl::encoding::Encode::<TargetHandlerSendCommandRequest, D>::encode(
(
<AvcPanelCommand as fidl::encoding::ValueTypeMarker>::borrow(&self.command),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.pressed),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<AvcPanelCommand, D>,
T1: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<TargetHandlerSendCommandRequest, D> for (T0, T1)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerSendCommandRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 1, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for TargetHandlerSendCommandRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
command: fidl::new_empty!(AvcPanelCommand, D),
pressed: fidl::new_empty!(bool, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(AvcPanelCommand, D, &mut self.command, decoder, offset + 0, _depth)?;
fidl::decode!(bool, D, &mut self.pressed, decoder, offset + 1, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for TargetHandlerSetAddressedPlayerRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for TargetHandlerSetAddressedPlayerRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
2
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
true
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<TargetHandlerSetAddressedPlayerRequest, D>
for &TargetHandlerSetAddressedPlayerRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerSetAddressedPlayerRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut TargetHandlerSetAddressedPlayerRequest).write_unaligned(
(self as *const TargetHandlerSetAddressedPlayerRequest).read(),
);
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<AddressedPlayerId, D>>
fidl::encoding::Encode<TargetHandlerSetAddressedPlayerRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerSetAddressedPlayerRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for TargetHandlerSetAddressedPlayerRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { player_id: fidl::new_empty!(AddressedPlayerId, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for TargetHandlerSetPlayerApplicationSettingsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for TargetHandlerSetPlayerApplicationSettingsRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<TargetHandlerSetPlayerApplicationSettingsRequest, D>
for &TargetHandlerSetPlayerApplicationSettingsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerSetPlayerApplicationSettingsRequest>(offset);
fidl::encoding::Encode::<TargetHandlerSetPlayerApplicationSettingsRequest, D>::encode(
(<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
&self.requested_settings,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
> fidl::encoding::Encode<TargetHandlerSetPlayerApplicationSettingsRequest, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerSetPlayerApplicationSettingsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for TargetHandlerSetPlayerApplicationSettingsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { requested_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
PlayerApplicationSettings,
D,
&mut self.requested_settings,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for TargetHandlerWatchNotificationRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for TargetHandlerWatchNotificationRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
32
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<TargetHandlerWatchNotificationRequest, D>
for &TargetHandlerWatchNotificationRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerWatchNotificationRequest>(offset);
fidl::encoding::Encode::<TargetHandlerWatchNotificationRequest, D>::encode(
(
<NotificationEvent as fidl::encoding::ValueTypeMarker>::borrow(&self.event_id),
<Notification as fidl::encoding::ValueTypeMarker>::borrow(&self.current),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.pos_change_interval),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<NotificationEvent, D>,
T1: fidl::encoding::Encode<Notification, D>,
T2: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<TargetHandlerWatchNotificationRequest, D> for (T0, T1, T2)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerWatchNotificationRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
(ptr as *mut u64).write_unaligned(0);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(24);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 8, depth)?;
self.2.encode(encoder, offset + 24, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for TargetHandlerWatchNotificationRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
event_id: fidl::new_empty!(NotificationEvent, D),
current: fidl::new_empty!(Notification, D),
pos_change_interval: fidl::new_empty!(u32, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffffff00u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(24) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffff00000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 24 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(NotificationEvent, D, &mut self.event_id, decoder, offset + 0, _depth)?;
fidl::decode!(Notification, D, &mut self.current, decoder, offset + 8, _depth)?;
fidl::decode!(u32, D, &mut self.pos_change_interval, decoder, offset + 24, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for TargetHandlerGetEventsSupportedResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetEventsSupportedResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<TargetHandlerGetEventsSupportedResponse, D>
for &TargetHandlerGetEventsSupportedResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerGetEventsSupportedResponse>(offset);
fidl::encoding::Encode::<TargetHandlerGetEventsSupportedResponse, D>::encode(
(
<fidl::encoding::Vector<NotificationEvent, 255> as fidl::encoding::ValueTypeMarker>::borrow(&self.notification_ids),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<NotificationEvent, 255>, D>,
> fidl::encoding::Encode<TargetHandlerGetEventsSupportedResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerGetEventsSupportedResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for TargetHandlerGetEventsSupportedResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
notification_ids: fidl::new_empty!(fidl::encoding::Vector<NotificationEvent, 255>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<NotificationEvent, 255>, D, &mut self.notification_ids, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for TargetHandlerGetMediaAttributesResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetMediaAttributesResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<TargetHandlerGetMediaAttributesResponse, D>
for &TargetHandlerGetMediaAttributesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerGetMediaAttributesResponse>(offset);
fidl::encoding::Encode::<TargetHandlerGetMediaAttributesResponse, D>::encode(
(<MediaAttributes as fidl::encoding::ValueTypeMarker>::borrow(&self.attributes),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<MediaAttributes, D>>
fidl::encoding::Encode<TargetHandlerGetMediaAttributesResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerGetMediaAttributesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for TargetHandlerGetMediaAttributesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { attributes: fidl::new_empty!(MediaAttributes, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(MediaAttributes, D, &mut self.attributes, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for TargetHandlerGetMediaPlayerItemsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetMediaPlayerItemsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<TargetHandlerGetMediaPlayerItemsResponse, D>
for &TargetHandlerGetMediaPlayerItemsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerGetMediaPlayerItemsResponse>(offset);
fidl::encoding::Encode::<TargetHandlerGetMediaPlayerItemsResponse, D>::encode(
(
<fidl::encoding::Vector<MediaPlayerItem, 16> as fidl::encoding::ValueTypeMarker>::borrow(&self.items),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<MediaPlayerItem, 16>, D>,
> fidl::encoding::Encode<TargetHandlerGetMediaPlayerItemsResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerGetMediaPlayerItemsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for TargetHandlerGetMediaPlayerItemsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { items: fidl::new_empty!(fidl::encoding::Vector<MediaPlayerItem, 16>, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<MediaPlayerItem, 16>, D, &mut self.items, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for TargetHandlerGetNotificationResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetNotificationResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<TargetHandlerGetNotificationResponse, D>
for &TargetHandlerGetNotificationResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerGetNotificationResponse>(offset);
fidl::encoding::Encode::<TargetHandlerGetNotificationResponse, D>::encode(
(<Notification as fidl::encoding::ValueTypeMarker>::borrow(&self.current_value),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Notification, D>>
fidl::encoding::Encode<TargetHandlerGetNotificationResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerGetNotificationResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for TargetHandlerGetNotificationResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { current_value: fidl::new_empty!(Notification, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Notification, D, &mut self.current_value, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for TargetHandlerGetPlayStatusResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetPlayStatusResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<TargetHandlerGetPlayStatusResponse, D>
for &TargetHandlerGetPlayStatusResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerGetPlayStatusResponse>(offset);
fidl::encoding::Encode::<TargetHandlerGetPlayStatusResponse, D>::encode(
(<PlayStatus as fidl::encoding::ValueTypeMarker>::borrow(&self.play_status),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PlayStatus, D>>
fidl::encoding::Encode<TargetHandlerGetPlayStatusResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerGetPlayStatusResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for TargetHandlerGetPlayStatusResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { play_status: fidl::new_empty!(PlayStatus, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(PlayStatus, D, &mut self.play_status, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for TargetHandlerGetPlayerApplicationSettingsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for TargetHandlerGetPlayerApplicationSettingsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<TargetHandlerGetPlayerApplicationSettingsResponse, D>
for &TargetHandlerGetPlayerApplicationSettingsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerGetPlayerApplicationSettingsResponse>(offset);
fidl::encoding::Encode::<TargetHandlerGetPlayerApplicationSettingsResponse, D>::encode(
(<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
&self.current_settings,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
> fidl::encoding::Encode<TargetHandlerGetPlayerApplicationSettingsResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerGetPlayerApplicationSettingsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for TargetHandlerGetPlayerApplicationSettingsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { current_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
PlayerApplicationSettings,
D,
&mut self.current_settings,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker
for TargetHandlerListPlayerApplicationSettingAttributesResponse
{
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker
for TargetHandlerListPlayerApplicationSettingAttributesResponse
{
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<TargetHandlerListPlayerApplicationSettingAttributesResponse, D>
for &TargetHandlerListPlayerApplicationSettingAttributesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder
.debug_check_bounds::<TargetHandlerListPlayerApplicationSettingAttributesResponse>(
offset,
);
fidl::encoding::Encode::<TargetHandlerListPlayerApplicationSettingAttributesResponse, D>::encode(
(
<fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131> as fidl::encoding::ValueTypeMarker>::borrow(&self.attributes),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<
fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>,
D,
>,
> fidl::encoding::Encode<TargetHandlerListPlayerApplicationSettingAttributesResponse, D>
for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder
.debug_check_bounds::<TargetHandlerListPlayerApplicationSettingAttributesResponse>(
offset,
);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for TargetHandlerListPlayerApplicationSettingAttributesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
attributes: fidl::new_empty!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D),
}
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(fidl::encoding::Vector<PlayerApplicationSettingAttributeId, 131>, D, &mut self.attributes, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for TargetHandlerSetPlayerApplicationSettingsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for TargetHandlerSetPlayerApplicationSettingsResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<TargetHandlerSetPlayerApplicationSettingsResponse, D>
for &TargetHandlerSetPlayerApplicationSettingsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerSetPlayerApplicationSettingsResponse>(offset);
fidl::encoding::Encode::<TargetHandlerSetPlayerApplicationSettingsResponse, D>::encode(
(<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow(
&self.set_settings,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<PlayerApplicationSettings, D>,
> fidl::encoding::Encode<TargetHandlerSetPlayerApplicationSettingsResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerSetPlayerApplicationSettingsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for TargetHandlerSetPlayerApplicationSettingsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { set_settings: fidl::new_empty!(PlayerApplicationSettings, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(
PlayerApplicationSettings,
D,
&mut self.set_settings,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for TargetHandlerWatchNotificationResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for TargetHandlerWatchNotificationResponse {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<TargetHandlerWatchNotificationResponse, D>
for &TargetHandlerWatchNotificationResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerWatchNotificationResponse>(offset);
fidl::encoding::Encode::<TargetHandlerWatchNotificationResponse, D>::encode(
(<Notification as fidl::encoding::ValueTypeMarker>::borrow(&self.new_value),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<Notification, D>>
fidl::encoding::Encode<TargetHandlerWatchNotificationResponse, D> for (T0,)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<TargetHandlerWatchNotificationResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for TargetHandlerWatchNotificationResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { new_value: fidl::new_empty!(Notification, D) }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
fidl::decode!(Notification, D, &mut self.new_value, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl CustomPlayerApplicationSetting {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.current_value {
return 4;
}
if let Some(_) = self.possible_values {
return 3;
}
if let Some(_) = self.attribute_name {
return 2;
}
if let Some(_) = self.attribute_id {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for CustomPlayerApplicationSetting {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CustomPlayerApplicationSetting {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CustomPlayerApplicationSetting, D>
for &CustomPlayerApplicationSetting
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CustomPlayerApplicationSetting>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u8, D>(
self.attribute_id.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
self.attribute_name.as_ref().map(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<CustomAttributeValue, 255>, D>(
self.possible_values.as_ref().map(<fidl::encoding::Vector<CustomAttributeValue, 255> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u8, D>(
self.current_value.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CustomPlayerApplicationSetting
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.attribute_id.get_or_insert_with(|| fidl::new_empty!(u8, D));
fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.attribute_name
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::Vector<CustomAttributeValue, 255> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.possible_values.get_or_insert_with(
|| fidl::new_empty!(fidl::encoding::Vector<CustomAttributeValue, 255>, D),
);
fidl::decode!(fidl::encoding::Vector<CustomAttributeValue, 255>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.current_value.get_or_insert_with(|| fidl::new_empty!(u8, D));
fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl FolderItem {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.displayable_name {
return 4;
}
if let Some(_) = self.is_playable {
return 3;
}
if let Some(_) = self.folder_type {
return 2;
}
if let Some(_) = self.folder_uid {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for FolderItem {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FolderItem {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FolderItem, D>
for &FolderItem
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FolderItem>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.folder_uid.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<FolderType, D>(
self.folder_type
.as_ref()
.map(<FolderType as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.is_playable.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
self.displayable_name.as_ref().map(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FolderItem {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.folder_uid.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<FolderType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.folder_type.get_or_insert_with(|| fidl::new_empty!(FolderType, D));
fidl::decode!(FolderType, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.is_playable.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.displayable_name
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl MediaAttributes {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.playing_time {
return 7;
}
if let Some(_) = self.genre {
return 6;
}
if let Some(_) = self.total_number_of_tracks {
return 5;
}
if let Some(_) = self.track_number {
return 4;
}
if let Some(_) = self.album_name {
return 3;
}
if let Some(_) = self.artist_name {
return 2;
}
if let Some(_) = self.title {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for MediaAttributes {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for MediaAttributes {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MediaAttributes, D>
for &MediaAttributes
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MediaAttributes>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
self.title.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
self.artist_name.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
self.album_name.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
self.track_number.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
self.total_number_of_tracks.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 6 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (6 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
self.genre.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
if 7 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (7 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<65535>, D>(
self.playing_time.as_ref().map(<fidl::encoding::BoundedString<65535> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MediaAttributes {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.title.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
});
fidl::decode!(
fidl::encoding::BoundedString<65535>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.artist_name.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
});
fidl::decode!(
fidl::encoding::BoundedString<65535>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.album_name.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
});
fidl::decode!(
fidl::encoding::BoundedString<65535>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.track_number.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
});
fidl::decode!(
fidl::encoding::BoundedString<65535>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.total_number_of_tracks.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
});
fidl::decode!(
fidl::encoding::BoundedString<65535>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 6 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.genre.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
});
fidl::decode!(
fidl::encoding::BoundedString<65535>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 7 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::BoundedString<65535> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.playing_time.get_or_insert_with(|| {
fidl::new_empty!(fidl::encoding::BoundedString<65535>, D)
});
fidl::decode!(
fidl::encoding::BoundedString<65535>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl MediaElementItem {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.attributes {
return 4;
}
if let Some(_) = self.displayable_name {
return 3;
}
if let Some(_) = self.media_type {
return 2;
}
if let Some(_) = self.media_element_uid {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for MediaElementItem {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for MediaElementItem {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MediaElementItem, D>
for &MediaElementItem
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MediaElementItem>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.media_element_uid
.as_ref()
.map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<MediaType, D>(
self.media_type
.as_ref()
.map(<MediaType as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
self.displayable_name.as_ref().map(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<MediaAttributes, D>(
self.attributes
.as_ref()
.map(<MediaAttributes as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MediaElementItem {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.media_element_uid.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<MediaType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.media_type.get_or_insert_with(|| fidl::new_empty!(MediaType, D));
fidl::decode!(MediaType, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.displayable_name
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<MediaAttributes as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.attributes.get_or_insert_with(|| fidl::new_empty!(MediaAttributes, D));
fidl::decode!(MediaAttributes, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl MediaPlayerItem {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.feature_bits_ext {
return 7;
}
if let Some(_) = self.feature_bits {
return 6;
}
if let Some(_) = self.displayable_name {
return 5;
}
if let Some(_) = self.playback_status {
return 4;
}
if let Some(_) = self.sub_type {
return 3;
}
if let Some(_) = self.major_type {
return 2;
}
if let Some(_) = self.player_id {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for MediaPlayerItem {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for MediaPlayerItem {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MediaPlayerItem, D>
for &MediaPlayerItem
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<MediaPlayerItem>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u16, D>(
self.player_id.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<MajorPlayerType, D>(
self.major_type
.as_ref()
.map(<MajorPlayerType as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<PlayerSubType, D>(
self.sub_type
.as_ref()
.map(<PlayerSubType as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<PlaybackStatus, D>(
self.playback_status
.as_ref()
.map(<PlaybackStatus as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::BoundedString<255>, D>(
self.displayable_name.as_ref().map(
<fidl::encoding::BoundedString<255> as fidl::encoding::ValueTypeMarker>::borrow,
),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 6 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (6 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<PlayerFeatureBits, D>(
self.feature_bits
.as_ref()
.map(<PlayerFeatureBits as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 7 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (7 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<PlayerFeatureBitsExt, D>(
self.feature_bits_ext
.as_ref()
.map(<PlayerFeatureBitsExt as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MediaPlayerItem {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.player_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<MajorPlayerType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.major_type.get_or_insert_with(|| fidl::new_empty!(MajorPlayerType, D));
fidl::decode!(MajorPlayerType, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<PlayerSubType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.sub_type.get_or_insert_with(|| fidl::new_empty!(PlayerSubType, D));
fidl::decode!(PlayerSubType, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<PlaybackStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.playback_status.get_or_insert_with(|| fidl::new_empty!(PlaybackStatus, D));
fidl::decode!(PlaybackStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<fidl::encoding::BoundedString<255> as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.displayable_name
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<255>, D));
fidl::decode!(
fidl::encoding::BoundedString<255>,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 6 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<PlayerFeatureBits as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.feature_bits.get_or_insert_with(|| fidl::new_empty!(PlayerFeatureBits, D));
fidl::decode!(PlayerFeatureBits, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 7 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<PlayerFeatureBitsExt as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.feature_bits_ext
.get_or_insert_with(|| fidl::new_empty!(PlayerFeatureBitsExt, D));
fidl::decode!(
PlayerFeatureBitsExt,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl Notification {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.addressed_player {
return 11;
}
if let Some(_) = self.available_players_changed {
return 10;
}
if let Some(_) = self.device_connected {
return 9;
}
if let Some(_) = self.volume {
return 8;
}
if let Some(_) = self.player_id {
return 7;
}
if let Some(_) = self.application_settings {
return 6;
}
if let Some(_) = self.system_status {
return 5;
}
if let Some(_) = self.battery_status {
return 4;
}
if let Some(_) = self.pos {
return 3;
}
if let Some(_) = self.track_id {
return 2;
}
if let Some(_) = self.status {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for Notification {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Notification {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Notification, D>
for &Notification
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Notification>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<PlaybackStatus, D>(
self.status
.as_ref()
.map(<PlaybackStatus as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u64, D>(
self.track_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u32, D>(
self.pos.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<BatteryStatus, D>(
self.battery_status
.as_ref()
.map(<BatteryStatus as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<SystemStatus, D>(
self.system_status
.as_ref()
.map(<SystemStatus as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 6 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (6 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<PlayerApplicationSettings, D>(
self.application_settings
.as_ref()
.map(<PlayerApplicationSettings as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 7 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (7 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u16, D>(
self.player_id.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 8 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (8 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u8, D>(
self.volume.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 9 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (9 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.device_connected
.as_ref()
.map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 10 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (10 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<bool, D>(
self.available_players_changed
.as_ref()
.map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 11 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (11 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u16, D>(
self.addressed_player
.as_ref()
.map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Notification {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<PlaybackStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.status.get_or_insert_with(|| fidl::new_empty!(PlaybackStatus, D));
fidl::decode!(PlaybackStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.track_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.pos.get_or_insert_with(|| fidl::new_empty!(u32, D));
fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<BatteryStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.battery_status.get_or_insert_with(|| fidl::new_empty!(BatteryStatus, D));
fidl::decode!(BatteryStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<SystemStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.system_status.get_or_insert_with(|| fidl::new_empty!(SystemStatus, D));
fidl::decode!(SystemStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 6 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<PlayerApplicationSettings as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.application_settings
.get_or_insert_with(|| fidl::new_empty!(PlayerApplicationSettings, D));
fidl::decode!(
PlayerApplicationSettings,
D,
val_ref,
decoder,
inner_offset,
inner_depth
)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 7 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.player_id.get_or_insert_with(|| fidl::new_empty!(u16, D));
fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 8 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.volume.get_or_insert_with(|| fidl::new_empty!(u8, D));
fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 9 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.device_connected.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 10 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.available_players_changed.get_or_insert_with(|| fidl::new_empty!(bool, D));
fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 11 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.addressed_player.get_or_insert_with(|| fidl::new_empty!(u16, D));
fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl PlayStatus {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.playback_status {
return 3;
}
if let Some(_) = self.song_position {
return 2;
}
if let Some(_) = self.song_length {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for PlayStatus {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PlayStatus {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<PlayStatus, D>
for &PlayStatus
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PlayStatus>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u32, D>(
self.song_length.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<u32, D>(
self.song_position.as_ref().map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<PlaybackStatus, D>(
self.playback_status
.as_ref()
.map(<PlaybackStatus as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PlayStatus {
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.song_length.get_or_insert_with(|| fidl::new_empty!(u32, D));
fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.song_position.get_or_insert_with(|| fidl::new_empty!(u32, D));
fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<PlaybackStatus as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.playback_status.get_or_insert_with(|| fidl::new_empty!(PlaybackStatus, D));
fidl::decode!(PlaybackStatus, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl PlayerApplicationSettings {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.custom_settings {
return 5;
}
if let Some(_) = self.scan_mode {
return 4;
}
if let Some(_) = self.shuffle_mode {
return 3;
}
if let Some(_) = self.repeat_status_mode {
return 2;
}
if let Some(_) = self.equalizer {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for PlayerApplicationSettings {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PlayerApplicationSettings {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<PlayerApplicationSettings, D> for &PlayerApplicationSettings
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PlayerApplicationSettings>(offset);
let max_ordinal: u64 = self.max_ordinal_present();
encoder.write_num(max_ordinal, offset);
encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
if max_ordinal == 0 {
return Ok(());
}
depth.increment()?;
let envelope_size = 8;
let bytes_len = max_ordinal as usize * envelope_size;
#[allow(unused_variables)]
let offset = encoder.out_of_line_offset(bytes_len);
let mut _prev_end_offset: usize = 0;
if 1 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (1 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<Equalizer, D>(
self.equalizer.as_ref().map(<Equalizer as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 2 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (2 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<RepeatStatusMode, D>(
self.repeat_status_mode
.as_ref()
.map(<RepeatStatusMode as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 3 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (3 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<ShuffleMode, D>(
self.shuffle_mode
.as_ref()
.map(<ShuffleMode as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 4 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (4 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<ScanMode, D>(
self.scan_mode.as_ref().map(<ScanMode as fidl::encoding::ValueTypeMarker>::borrow),
encoder,
offset + cur_offset,
depth,
)?;
_prev_end_offset = cur_offset + envelope_size;
if 5 > max_ordinal {
return Ok(());
}
let cur_offset: usize = (5 - 1) * envelope_size;
encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<CustomPlayerApplicationSetting, 127>, D>(
self.custom_settings.as_ref().map(<fidl::encoding::Vector<CustomPlayerApplicationSetting, 127> as fidl::encoding::ValueTypeMarker>::borrow),
encoder, offset + cur_offset, depth
)?;
_prev_end_offset = cur_offset + envelope_size;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for PlayerApplicationSettings
{
#[inline(always)]
fn new_empty() -> Self {
Self::default()
}
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
None => return Err(fidl::Error::NotNullable),
Some(len) => len,
};
if len == 0 {
return Ok(());
};
depth.increment()?;
let envelope_size = 8;
let bytes_len = len * envelope_size;
let offset = decoder.out_of_line_offset(bytes_len)?;
let mut _next_ordinal_to_read = 0;
let mut next_offset = offset;
let end_offset = offset + bytes_len;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 1 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<Equalizer as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.equalizer.get_or_insert_with(|| fidl::new_empty!(Equalizer, D));
fidl::decode!(Equalizer, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 2 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<RepeatStatusMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self
.repeat_status_mode
.get_or_insert_with(|| fidl::new_empty!(RepeatStatusMode, D));
fidl::decode!(RepeatStatusMode, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 3 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<ShuffleMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.shuffle_mode.get_or_insert_with(|| fidl::new_empty!(ShuffleMode, D));
fidl::decode!(ShuffleMode, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 4 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size =
<ScanMode as fidl::encoding::TypeMarker>::inline_size(decoder.context);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref = self.scan_mode.get_or_insert_with(|| fidl::new_empty!(ScanMode, D));
fidl::decode!(ScanMode, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
_next_ordinal_to_read += 1;
if next_offset >= end_offset {
return Ok(());
}
while _next_ordinal_to_read < 5 {
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
_next_ordinal_to_read += 1;
next_offset += envelope_size;
}
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
if let Some((inlined, num_bytes, num_handles)) =
fidl::encoding::decode_envelope_header(decoder, next_offset)?
{
let member_inline_size = <fidl::encoding::Vector<
CustomPlayerApplicationSetting,
127,
> as fidl::encoding::TypeMarker>::inline_size(
decoder.context
);
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let inner_offset;
let mut inner_depth = depth.clone();
if inlined {
decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
inner_offset = next_offset;
} else {
inner_offset = decoder.out_of_line_offset(member_inline_size)?;
inner_depth.increment()?;
}
let val_ref =
self.custom_settings.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<CustomPlayerApplicationSetting, 127>, D));
fidl::decode!(fidl::encoding::Vector<CustomPlayerApplicationSetting, 127>, D, val_ref, decoder, inner_offset, inner_depth)?;
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
{
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
}
next_offset += envelope_size;
while next_offset < end_offset {
_next_ordinal_to_read += 1;
fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
next_offset += envelope_size;
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for AttributeRequestOption {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for AttributeRequestOption {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<AttributeRequestOption, D> for &AttributeRequestOption
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<AttributeRequestOption>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
AttributeRequestOption::GetAll(ref val) => {
fidl::encoding::encode_in_envelope::<bool, D>(
<bool as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
AttributeRequestOption::AttributeList(ref val) => {
fidl::encoding::encode_in_envelope::<fidl::encoding::Vector<MediaAttributeId, 8>, D>(
<fidl::encoding::Vector<MediaAttributeId, 8> as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder, offset + 8, _depth
)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for AttributeRequestOption
{
#[inline(always)]
fn new_empty() -> Self {
Self::GetAll(fidl::new_empty!(bool, D))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <fidl::encoding::Vector<MediaAttributeId, 8> as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let AttributeRequestOption::GetAll(_) = self {
} else {
*self = AttributeRequestOption::GetAll(fidl::new_empty!(bool, D));
}
#[allow(irrefutable_let_patterns)]
if let AttributeRequestOption::GetAll(ref mut val) = self {
fidl::decode!(bool, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let AttributeRequestOption::AttributeList(_) = self {
} else {
*self = AttributeRequestOption::AttributeList(
fidl::new_empty!(fidl::encoding::Vector<MediaAttributeId, 8>, D),
);
}
#[allow(irrefutable_let_patterns)]
if let AttributeRequestOption::AttributeList(ref mut val) = self {
fidl::decode!(fidl::encoding::Vector<MediaAttributeId, 8>, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for FileSystemItem {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for FileSystemItem {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<FileSystemItem, D>
for &FileSystemItem
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<FileSystemItem>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
FileSystemItem::Folder(ref val) => {
fidl::encoding::encode_in_envelope::<FolderItem, D>(
<FolderItem as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
FileSystemItem::MediaElement(ref val) => {
fidl::encoding::encode_in_envelope::<MediaElementItem, D>(
<MediaElementItem as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for FileSystemItem {
#[inline(always)]
fn new_empty() -> Self {
Self::Folder(fidl::new_empty!(FolderItem, D))
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <FolderItem as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <MediaElementItem as fidl::encoding::TypeMarker>::inline_size(decoder.context),
_ => return Err(fidl::Error::UnknownUnionTag),
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let FileSystemItem::Folder(_) = self {
} else {
*self = FileSystemItem::Folder(fidl::new_empty!(FolderItem, D));
}
#[allow(irrefutable_let_patterns)]
if let FileSystemItem::Folder(ref mut val) = self {
fidl::decode!(FolderItem, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let FileSystemItem::MediaElement(_) = self {
} else {
*self = FileSystemItem::MediaElement(fidl::new_empty!(MediaElementItem, D));
}
#[allow(irrefutable_let_patterns)]
if let FileSystemItem::MediaElement(ref mut val) = self {
fidl::decode!(MediaElementItem, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
ordinal => panic!("unexpected ordinal {:?}", ordinal),
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for Path {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Path {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
16
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Path, D> for &Path {
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Path>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
Path::Parent(ref val) => fidl::encoding::encode_in_envelope::<Parent, D>(
<Parent as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Path::ChildFolderUid(ref val) => fidl::encoding::encode_in_envelope::<u64, D>(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
),
Path::__SourceBreaking { .. } => Err(fidl::Error::UnknownUnionTag),
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for Path {
#[inline(always)]
fn new_empty() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0 }
}
#[inline]
unsafe fn decode(
&mut self,
decoder: &mut fidl::encoding::Decoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
decoder.debug_check_bounds::<Self>(offset);
#[allow(unused_variables)]
let next_out_of_line = decoder.next_out_of_line();
let handles_before = decoder.remaining_handles();
let (ordinal, inlined, num_bytes, num_handles) =
fidl::encoding::decode_union_inline_portion(decoder, offset)?;
let member_inline_size = match ordinal {
1 => <Parent as fidl::encoding::TypeMarker>::inline_size(decoder.context),
2 => <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context),
0 => return Err(fidl::Error::UnknownUnionTag),
_ => num_bytes as usize,
};
if inlined != (member_inline_size <= 4) {
return Err(fidl::Error::InvalidInlineBitInEnvelope);
}
let _inner_offset;
if inlined {
decoder.check_inline_envelope_padding(offset + 8, member_inline_size)?;
_inner_offset = offset + 8;
} else {
depth.increment()?;
_inner_offset = decoder.out_of_line_offset(member_inline_size)?;
}
match ordinal {
1 => {
#[allow(irrefutable_let_patterns)]
if let Path::Parent(_) = self {
} else {
*self = Path::Parent(fidl::new_empty!(Parent, D));
}
#[allow(irrefutable_let_patterns)]
if let Path::Parent(ref mut val) = self {
fidl::decode!(Parent, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let Path::ChildFolderUid(_) = self {
} else {
*self = Path::ChildFolderUid(fidl::new_empty!(u64, D));
}
#[allow(irrefutable_let_patterns)]
if let Path::ChildFolderUid(ref mut val) = self {
fidl::decode!(u64, D, val, decoder, _inner_offset, depth)?;
} else {
unreachable!()
}
}
#[allow(deprecated)]
ordinal => {
for _ in 0..num_handles {
decoder.drop_next_handle()?;
}
*self = Path::__SourceBreaking { unknown_ordinal: ordinal };
}
}
if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize) {
return Err(fidl::Error::InvalidNumBytesInEnvelope);
}
if handles_before != decoder.remaining_handles() + (num_handles as usize) {
return Err(fidl::Error::InvalidNumHandlesInEnvelope);
}
Ok(())
}
}
}