#![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_EFFECT_NAME_LENGTH: u32 = 128;
pub const MAX_GAIN_DB: f32 = 24.0;
pub const MAX_VOLUME: f32 = 1.0;
pub const MIN_VOLUME: f32 = 0.0;
pub const MUTED_GAIN_DB: f32 = -160.0;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u16)]
pub enum RampType {
ScaleLinear = 1,
}
impl RampType {
#[inline]
pub fn from_primitive(prim: u16) -> Option<Self> {
match prim {
1 => Some(Self::ScaleLinear),
_ => None,
}
}
#[inline]
pub const fn into_primitive(self) -> u16 {
self as u16
}
#[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 UpdateEffectError {
InvalidConfig = 1,
NotFound = 2,
}
impl UpdateEffectError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::InvalidConfig),
2 => Some(Self::NotFound),
_ => 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, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct EffectsControllerUpdateEffectRequest {
pub effect_name: String,
pub config: String,
}
impl fidl::Persistable for EffectsControllerUpdateEffectRequest {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct GainControlOnGainMuteChangedRequest {
pub gain_db: f32,
pub muted: bool,
}
impl fidl::Persistable for GainControlOnGainMuteChangedRequest {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct GainControlSetGainRequest {
pub gain_db: f32,
}
impl fidl::Persistable for GainControlSetGainRequest {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct GainControlSetGainWithRampRequest {
pub gain_db: f32,
pub duration: i64,
pub ramp_type: RampType,
}
impl fidl::Persistable for GainControlSetGainWithRampRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct GainControlSetMuteRequest {
pub muted: bool,
}
impl fidl::Persistable for GainControlSetMuteRequest {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct VolumeControlOnVolumeMuteChangedRequest {
pub new_volume: f32,
pub new_muted: bool,
}
impl fidl::Persistable for VolumeControlOnVolumeMuteChangedRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct VolumeControlSetMuteRequest {
pub mute: bool,
}
impl fidl::Persistable for VolumeControlSetMuteRequest {}
#[derive(Clone, Copy, Debug, PartialEq, PartialOrd)]
pub struct VolumeControlSetVolumeRequest {
pub volume: f32,
}
impl fidl::Persistable for VolumeControlSetVolumeRequest {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct EffectsControllerMarker;
impl fidl::endpoints::ProtocolMarker for EffectsControllerMarker {
type Proxy = EffectsControllerProxy;
type RequestStream = EffectsControllerRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = EffectsControllerSynchronousProxy;
const DEBUG_NAME: &'static str = "fuchsia.media.audio.EffectsController";
}
impl fidl::endpoints::DiscoverableProtocolMarker for EffectsControllerMarker {}
pub type EffectsControllerUpdateEffectResult = Result<(), UpdateEffectError>;
pub trait EffectsControllerProxyInterface: Send + Sync {
type UpdateEffectResponseFut: std::future::Future<Output = Result<EffectsControllerUpdateEffectResult, fidl::Error>>
+ Send;
fn r#update_effect(&self, effect_name: &str, config: &str) -> Self::UpdateEffectResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct EffectsControllerSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for EffectsControllerSynchronousProxy {
type Proxy = EffectsControllerProxy;
type Protocol = EffectsControllerMarker;
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 EffectsControllerSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<EffectsControllerMarker 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<EffectsControllerEvent, fidl::Error> {
EffectsControllerEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#update_effect(
&self,
mut effect_name: &str,
mut config: &str,
___deadline: zx::MonotonicInstant,
) -> Result<EffectsControllerUpdateEffectResult, fidl::Error> {
let _response = self.client.send_query::<
EffectsControllerUpdateEffectRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, UpdateEffectError>,
>(
(effect_name, config,),
0x4e39e4b5e6279125,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct EffectsControllerProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for EffectsControllerProxy {
type Protocol = EffectsControllerMarker;
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 EffectsControllerProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<EffectsControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> EffectsControllerEventStream {
EffectsControllerEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#update_effect(
&self,
mut effect_name: &str,
mut config: &str,
) -> fidl::client::QueryResponseFut<
EffectsControllerUpdateEffectResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
EffectsControllerProxyInterface::r#update_effect(self, effect_name, config)
}
}
impl EffectsControllerProxyInterface for EffectsControllerProxy {
type UpdateEffectResponseFut = fidl::client::QueryResponseFut<
EffectsControllerUpdateEffectResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#update_effect(
&self,
mut effect_name: &str,
mut config: &str,
) -> Self::UpdateEffectResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<EffectsControllerUpdateEffectResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, UpdateEffectError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4e39e4b5e6279125,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
EffectsControllerUpdateEffectRequest,
EffectsControllerUpdateEffectResult,
>(
(effect_name, config,),
0x4e39e4b5e6279125,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct EffectsControllerEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for EffectsControllerEventStream {}
impl futures::stream::FusedStream for EffectsControllerEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for EffectsControllerEventStream {
type Item = Result<EffectsControllerEvent, 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(EffectsControllerEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum EffectsControllerEvent {}
impl EffectsControllerEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<EffectsControllerEvent, 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:
<EffectsControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct EffectsControllerRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for EffectsControllerRequestStream {}
impl futures::stream::FusedStream for EffectsControllerRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for EffectsControllerRequestStream {
type Protocol = EffectsControllerMarker;
type ControlHandle = EffectsControllerControlHandle;
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 {
EffectsControllerControlHandle { 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 EffectsControllerRequestStream {
type Item = Result<EffectsControllerRequest, 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 EffectsControllerRequestStream 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 {
0x4e39e4b5e6279125 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
EffectsControllerUpdateEffectRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EffectsControllerUpdateEffectRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
EffectsControllerControlHandle { inner: this.inner.clone() };
Ok(EffectsControllerRequest::UpdateEffect {
effect_name: req.effect_name,
config: req.config,
responder: EffectsControllerUpdateEffectResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<EffectsControllerMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum EffectsControllerRequest {
UpdateEffect {
effect_name: String,
config: String,
responder: EffectsControllerUpdateEffectResponder,
},
}
impl EffectsControllerRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_update_effect(
self,
) -> Option<(String, String, EffectsControllerUpdateEffectResponder)> {
if let EffectsControllerRequest::UpdateEffect { effect_name, config, responder } = self {
Some((effect_name, config, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
EffectsControllerRequest::UpdateEffect { .. } => "update_effect",
}
}
}
#[derive(Debug, Clone)]
pub struct EffectsControllerControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for EffectsControllerControlHandle {
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 EffectsControllerControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct EffectsControllerUpdateEffectResponder {
control_handle: std::mem::ManuallyDrop<EffectsControllerControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for EffectsControllerUpdateEffectResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for EffectsControllerUpdateEffectResponder {
type ControlHandle = EffectsControllerControlHandle;
fn control_handle(&self) -> &EffectsControllerControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl EffectsControllerUpdateEffectResponder {
pub fn send(self, mut result: Result<(), UpdateEffectError>) -> 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<(), UpdateEffectError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), UpdateEffectError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
UpdateEffectError,
>>(
result,
self.tx_id,
0x4e39e4b5e6279125,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct GainControlMarker;
impl fidl::endpoints::ProtocolMarker for GainControlMarker {
type Proxy = GainControlProxy;
type RequestStream = GainControlRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = GainControlSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) GainControl";
}
pub trait GainControlProxyInterface: Send + Sync {
fn r#set_gain(&self, gain_db: f32) -> Result<(), fidl::Error>;
fn r#set_gain_with_ramp(
&self,
gain_db: f32,
duration: i64,
ramp_type: RampType,
) -> Result<(), fidl::Error>;
fn r#set_mute(&self, muted: bool) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct GainControlSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for GainControlSynchronousProxy {
type Proxy = GainControlProxy;
type Protocol = GainControlMarker;
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 GainControlSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <GainControlMarker 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<GainControlEvent, fidl::Error> {
GainControlEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#set_gain(&self, mut gain_db: f32) -> Result<(), fidl::Error> {
self.client.send::<GainControlSetGainRequest>(
(gain_db,),
0x2fc070871d033f64,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#set_gain_with_ramp(
&self,
mut gain_db: f32,
mut duration: i64,
mut ramp_type: RampType,
) -> Result<(), fidl::Error> {
self.client.send::<GainControlSetGainWithRampRequest>(
(gain_db, duration, ramp_type),
0x3a175b2d6979e8ea,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#set_mute(&self, mut muted: bool) -> Result<(), fidl::Error> {
self.client.send::<GainControlSetMuteRequest>(
(muted,),
0x5415723c1e31448,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct GainControlProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for GainControlProxy {
type Protocol = GainControlMarker;
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 GainControlProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <GainControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> GainControlEventStream {
GainControlEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#set_gain(&self, mut gain_db: f32) -> Result<(), fidl::Error> {
GainControlProxyInterface::r#set_gain(self, gain_db)
}
pub fn r#set_gain_with_ramp(
&self,
mut gain_db: f32,
mut duration: i64,
mut ramp_type: RampType,
) -> Result<(), fidl::Error> {
GainControlProxyInterface::r#set_gain_with_ramp(self, gain_db, duration, ramp_type)
}
pub fn r#set_mute(&self, mut muted: bool) -> Result<(), fidl::Error> {
GainControlProxyInterface::r#set_mute(self, muted)
}
}
impl GainControlProxyInterface for GainControlProxy {
fn r#set_gain(&self, mut gain_db: f32) -> Result<(), fidl::Error> {
self.client.send::<GainControlSetGainRequest>(
(gain_db,),
0x2fc070871d033f64,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#set_gain_with_ramp(
&self,
mut gain_db: f32,
mut duration: i64,
mut ramp_type: RampType,
) -> Result<(), fidl::Error> {
self.client.send::<GainControlSetGainWithRampRequest>(
(gain_db, duration, ramp_type),
0x3a175b2d6979e8ea,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#set_mute(&self, mut muted: bool) -> Result<(), fidl::Error> {
self.client.send::<GainControlSetMuteRequest>(
(muted,),
0x5415723c1e31448,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct GainControlEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for GainControlEventStream {}
impl futures::stream::FusedStream for GainControlEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for GainControlEventStream {
type Item = Result<GainControlEvent, 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(GainControlEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum GainControlEvent {
OnGainMuteChanged { gain_db: f32, muted: bool },
}
impl GainControlEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_on_gain_mute_changed(self) -> Option<(f32, bool)> {
if let GainControlEvent::OnGainMuteChanged { gain_db, muted } = self {
Some((gain_db, muted))
} else {
None
}
}
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<GainControlEvent, 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 {
0x66d528cad4e0d753 => {
let mut out = fidl::new_empty!(
GainControlOnGainMuteChangedRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GainControlOnGainMuteChangedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((GainControlEvent::OnGainMuteChanged { gain_db: out.gain_db, muted: out.muted }))
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <GainControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct GainControlRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for GainControlRequestStream {}
impl futures::stream::FusedStream for GainControlRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for GainControlRequestStream {
type Protocol = GainControlMarker;
type ControlHandle = GainControlControlHandle;
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 {
GainControlControlHandle { 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 GainControlRequestStream {
type Item = Result<GainControlRequest, 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 GainControlRequestStream 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 {
0x2fc070871d033f64 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
GainControlSetGainRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GainControlSetGainRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = GainControlControlHandle { inner: this.inner.clone() };
Ok(GainControlRequest::SetGain { gain_db: req.gain_db, control_handle })
}
0x3a175b2d6979e8ea => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
GainControlSetGainWithRampRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GainControlSetGainWithRampRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = GainControlControlHandle { inner: this.inner.clone() };
Ok(GainControlRequest::SetGainWithRamp {
gain_db: req.gain_db,
duration: req.duration,
ramp_type: req.ramp_type,
control_handle,
})
}
0x5415723c1e31448 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
GainControlSetMuteRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<GainControlSetMuteRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = GainControlControlHandle { inner: this.inner.clone() };
Ok(GainControlRequest::SetMute { muted: req.muted, control_handle })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<GainControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum GainControlRequest {
SetGain { gain_db: f32, control_handle: GainControlControlHandle },
SetGainWithRamp {
gain_db: f32,
duration: i64,
ramp_type: RampType,
control_handle: GainControlControlHandle,
},
SetMute { muted: bool, control_handle: GainControlControlHandle },
}
impl GainControlRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_set_gain(self) -> Option<(f32, GainControlControlHandle)> {
if let GainControlRequest::SetGain { gain_db, control_handle } = self {
Some((gain_db, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_gain_with_ramp(self) -> Option<(f32, i64, RampType, GainControlControlHandle)> {
if let GainControlRequest::SetGainWithRamp {
gain_db,
duration,
ramp_type,
control_handle,
} = self
{
Some((gain_db, duration, ramp_type, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_mute(self) -> Option<(bool, GainControlControlHandle)> {
if let GainControlRequest::SetMute { muted, control_handle } = self {
Some((muted, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
GainControlRequest::SetGain { .. } => "set_gain",
GainControlRequest::SetGainWithRamp { .. } => "set_gain_with_ramp",
GainControlRequest::SetMute { .. } => "set_mute",
}
}
}
#[derive(Debug, Clone)]
pub struct GainControlControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for GainControlControlHandle {
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 GainControlControlHandle {
pub fn send_on_gain_mute_changed(
&self,
mut gain_db: f32,
mut muted: bool,
) -> Result<(), fidl::Error> {
self.inner.send::<GainControlOnGainMuteChangedRequest>(
(gain_db, muted),
0,
0x66d528cad4e0d753,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct VolumeControlMarker;
impl fidl::endpoints::ProtocolMarker for VolumeControlMarker {
type Proxy = VolumeControlProxy;
type RequestStream = VolumeControlRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = VolumeControlSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) VolumeControl";
}
pub trait VolumeControlProxyInterface: Send + Sync {
fn r#set_volume(&self, volume: f32) -> Result<(), fidl::Error>;
fn r#set_mute(&self, mute: bool) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct VolumeControlSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for VolumeControlSynchronousProxy {
type Proxy = VolumeControlProxy;
type Protocol = VolumeControlMarker;
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 VolumeControlSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <VolumeControlMarker 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<VolumeControlEvent, fidl::Error> {
VolumeControlEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#set_volume(&self, mut volume: f32) -> Result<(), fidl::Error> {
self.client.send::<VolumeControlSetVolumeRequest>(
(volume,),
0x6ff4231809a697da,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#set_mute(&self, mut mute: bool) -> Result<(), fidl::Error> {
self.client.send::<VolumeControlSetMuteRequest>(
(mute,),
0x50c10c28bba46425,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct VolumeControlProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for VolumeControlProxy {
type Protocol = VolumeControlMarker;
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 VolumeControlProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <VolumeControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> VolumeControlEventStream {
VolumeControlEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#set_volume(&self, mut volume: f32) -> Result<(), fidl::Error> {
VolumeControlProxyInterface::r#set_volume(self, volume)
}
pub fn r#set_mute(&self, mut mute: bool) -> Result<(), fidl::Error> {
VolumeControlProxyInterface::r#set_mute(self, mute)
}
}
impl VolumeControlProxyInterface for VolumeControlProxy {
fn r#set_volume(&self, mut volume: f32) -> Result<(), fidl::Error> {
self.client.send::<VolumeControlSetVolumeRequest>(
(volume,),
0x6ff4231809a697da,
fidl::encoding::DynamicFlags::empty(),
)
}
fn r#set_mute(&self, mut mute: bool) -> Result<(), fidl::Error> {
self.client.send::<VolumeControlSetMuteRequest>(
(mute,),
0x50c10c28bba46425,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct VolumeControlEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for VolumeControlEventStream {}
impl futures::stream::FusedStream for VolumeControlEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for VolumeControlEventStream {
type Item = Result<VolumeControlEvent, 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(VolumeControlEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum VolumeControlEvent {
OnVolumeMuteChanged { new_volume: f32, new_muted: bool },
}
impl VolumeControlEvent {
#[allow(irrefutable_let_patterns)]
pub fn into_on_volume_mute_changed(self) -> Option<(f32, bool)> {
if let VolumeControlEvent::OnVolumeMuteChanged { new_volume, new_muted } = self {
Some((new_volume, new_muted))
} else {
None
}
}
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<VolumeControlEvent, 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 {
0x9cea352bd86c171 => {
let mut out = fidl::new_empty!(
VolumeControlOnVolumeMuteChangedRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeControlOnVolumeMuteChangedRequest>(&tx_header, _body_bytes, _handles, &mut out)?;
Ok((VolumeControlEvent::OnVolumeMuteChanged {
new_volume: out.new_volume,
new_muted: out.new_muted,
}))
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <VolumeControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct VolumeControlRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for VolumeControlRequestStream {}
impl futures::stream::FusedStream for VolumeControlRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for VolumeControlRequestStream {
type Protocol = VolumeControlMarker;
type ControlHandle = VolumeControlControlHandle;
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 {
VolumeControlControlHandle { 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 VolumeControlRequestStream {
type Item = Result<VolumeControlRequest, 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 VolumeControlRequestStream 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 {
0x6ff4231809a697da => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
VolumeControlSetVolumeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeControlSetVolumeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
VolumeControlControlHandle { inner: this.inner.clone() };
Ok(VolumeControlRequest::SetVolume { volume: req.volume, control_handle })
}
0x50c10c28bba46425 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
VolumeControlSetMuteRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<VolumeControlSetMuteRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
VolumeControlControlHandle { inner: this.inner.clone() };
Ok(VolumeControlRequest::SetMute { mute: req.mute, control_handle })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<VolumeControlMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum VolumeControlRequest {
SetVolume { volume: f32, control_handle: VolumeControlControlHandle },
SetMute { mute: bool, control_handle: VolumeControlControlHandle },
}
impl VolumeControlRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_set_volume(self) -> Option<(f32, VolumeControlControlHandle)> {
if let VolumeControlRequest::SetVolume { volume, control_handle } = self {
Some((volume, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_mute(self) -> Option<(bool, VolumeControlControlHandle)> {
if let VolumeControlRequest::SetMute { mute, control_handle } = self {
Some((mute, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
VolumeControlRequest::SetVolume { .. } => "set_volume",
VolumeControlRequest::SetMute { .. } => "set_mute",
}
}
}
#[derive(Debug, Clone)]
pub struct VolumeControlControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for VolumeControlControlHandle {
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 VolumeControlControlHandle {
pub fn send_on_volume_mute_changed(
&self,
mut new_volume: f32,
mut new_muted: bool,
) -> Result<(), fidl::Error> {
self.inner.send::<VolumeControlOnVolumeMuteChangedRequest>(
(new_volume, new_muted),
0,
0x9cea352bd86c171,
fidl::encoding::DynamicFlags::empty(),
)
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for RampType {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
std::mem::align_of::<u16>()
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
std::mem::size_of::<u16>()
}
#[inline(always)]
fn encode_is_copy() -> bool {
true
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for RampType {
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 RampType {
#[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 RampType {
#[inline(always)]
fn new_empty() -> Self {
Self::ScaleLinear
}
#[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::<u16>(offset);
*self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for UpdateEffectError {
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 UpdateEffectError {
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 UpdateEffectError
{
#[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 UpdateEffectError {
#[inline(always)]
fn new_empty() -> Self {
Self::InvalidConfig
}
#[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 EffectsControllerUpdateEffectRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for EffectsControllerUpdateEffectRequest {
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<EffectsControllerUpdateEffectRequest, D>
for &EffectsControllerUpdateEffectRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<EffectsControllerUpdateEffectRequest>(offset);
fidl::encoding::Encode::<EffectsControllerUpdateEffectRequest, D>::encode(
(
<fidl::encoding::BoundedString<128> as fidl::encoding::ValueTypeMarker>::borrow(
&self.effect_name,
),
<fidl::encoding::UnboundedString as fidl::encoding::ValueTypeMarker>::borrow(
&self.config,
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::BoundedString<128>, D>,
T1: fidl::encoding::Encode<fidl::encoding::UnboundedString, D>,
> fidl::encoding::Encode<EffectsControllerUpdateEffectRequest, 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::<EffectsControllerUpdateEffectRequest>(offset);
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 EffectsControllerUpdateEffectRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
effect_name: fidl::new_empty!(fidl::encoding::BoundedString<128>, D),
config: fidl::new_empty!(fidl::encoding::UnboundedString, 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::BoundedString<128>,
D,
&mut self.effect_name,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::UnboundedString,
D,
&mut self.config,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for GainControlOnGainMuteChangedRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for GainControlOnGainMuteChangedRequest {
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<GainControlOnGainMuteChangedRequest, D>
for &GainControlOnGainMuteChangedRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<GainControlOnGainMuteChangedRequest>(offset);
fidl::encoding::Encode::<GainControlOnGainMuteChangedRequest, D>::encode(
(
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.muted),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<f32, D>,
T1: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<GainControlOnGainMuteChangedRequest, 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::<GainControlOnGainMuteChangedRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
(ptr as *mut u32).write_unaligned(0);
}
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 GainControlOnGainMuteChangedRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { gain_db: fidl::new_empty!(f32, D), muted: 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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
let padval = unsafe { (ptr as *const u32).read_unaligned() };
let mask = 0xffffff00u32;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(f32, D, &mut self.gain_db, decoder, offset + 0, _depth)?;
fidl::decode!(bool, D, &mut self.muted, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for GainControlSetGainRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for GainControlSetGainRequest {
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<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<GainControlSetGainRequest, D> for &GainControlSetGainRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<GainControlSetGainRequest>(offset);
fidl::encoding::Encode::<GainControlSetGainRequest, D>::encode(
(<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
fidl::encoding::Encode<GainControlSetGainRequest, 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::<GainControlSetGainRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for GainControlSetGainRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { gain_db: fidl::new_empty!(f32, 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!(f32, D, &mut self.gain_db, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for GainControlSetGainWithRampRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for GainControlSetGainWithRampRequest {
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<GainControlSetGainWithRampRequest, D>
for &GainControlSetGainWithRampRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<GainControlSetGainWithRampRequest>(offset);
fidl::encoding::Encode::<GainControlSetGainWithRampRequest, D>::encode(
(
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_db),
<i64 as fidl::encoding::ValueTypeMarker>::borrow(&self.duration),
<RampType as fidl::encoding::ValueTypeMarker>::borrow(&self.ramp_type),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<f32, D>,
T1: fidl::encoding::Encode<i64, D>,
T2: fidl::encoding::Encode<RampType, D>,
> fidl::encoding::Encode<GainControlSetGainWithRampRequest, 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::<GainControlSetGainWithRampRequest>(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(16);
(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 + 16, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for GainControlSetGainWithRampRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
gain_db: fidl::new_empty!(f32, D),
duration: fidl::new_empty!(i64, D),
ramp_type: fidl::new_empty!(RampType, 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 = 0xffffffff00000000u64;
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(16) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffffffffffff0000u64;
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!(f32, D, &mut self.gain_db, decoder, offset + 0, _depth)?;
fidl::decode!(i64, D, &mut self.duration, decoder, offset + 8, _depth)?;
fidl::decode!(RampType, D, &mut self.ramp_type, decoder, offset + 16, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for GainControlSetMuteRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for GainControlSetMuteRequest {
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<GainControlSetMuteRequest, D> for &GainControlSetMuteRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<GainControlSetMuteRequest>(offset);
fidl::encoding::Encode::<GainControlSetMuteRequest, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.muted),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<GainControlSetMuteRequest, 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::<GainControlSetMuteRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for GainControlSetMuteRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { muted: 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!(bool, D, &mut self.muted, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeControlOnVolumeMuteChangedRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeControlOnVolumeMuteChangedRequest {
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<VolumeControlOnVolumeMuteChangedRequest, D>
for &VolumeControlOnVolumeMuteChangedRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeControlOnVolumeMuteChangedRequest>(offset);
fidl::encoding::Encode::<VolumeControlOnVolumeMuteChangedRequest, D>::encode(
(
<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.new_volume),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.new_muted),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<f32, D>,
T1: fidl::encoding::Encode<bool, D>,
> fidl::encoding::Encode<VolumeControlOnVolumeMuteChangedRequest, 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::<VolumeControlOnVolumeMuteChangedRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(4);
(ptr as *mut u32).write_unaligned(0);
}
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 VolumeControlOnVolumeMuteChangedRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { new_volume: fidl::new_empty!(f32, D), new_muted: 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);
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(4) };
let padval = unsafe { (ptr as *const u32).read_unaligned() };
let mask = 0xffffff00u32;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 4 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(f32, D, &mut self.new_volume, decoder, offset + 0, _depth)?;
fidl::decode!(bool, D, &mut self.new_muted, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeControlSetMuteRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeControlSetMuteRequest {
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<VolumeControlSetMuteRequest, D> for &VolumeControlSetMuteRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeControlSetMuteRequest>(offset);
fidl::encoding::Encode::<VolumeControlSetMuteRequest, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.mute),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<VolumeControlSetMuteRequest, 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::<VolumeControlSetMuteRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for VolumeControlSetMuteRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { mute: 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!(bool, D, &mut self.mute, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for VolumeControlSetVolumeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for VolumeControlSetVolumeRequest {
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<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<VolumeControlSetVolumeRequest, D>
for &VolumeControlSetVolumeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<VolumeControlSetVolumeRequest>(offset);
fidl::encoding::Encode::<VolumeControlSetVolumeRequest, D>::encode(
(<f32 as fidl::encoding::ValueTypeMarker>::borrow(&self.volume),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<f32, D>>
fidl::encoding::Encode<VolumeControlSetVolumeRequest, 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::<VolumeControlSetVolumeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for VolumeControlSetVolumeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { volume: fidl::new_empty!(f32, 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!(f32, D, &mut self.volume, decoder, offset + 0, _depth)?;
Ok(())
}
}
}