#![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 type ClockDomain = u32;
pub type ElementId = u64;
pub type TopologyId = u64;
pub const CLOCK_DOMAIN_EXTERNAL: u32 = 4294967295;
pub const CLOCK_DOMAIN_MONOTONIC: u32 = 0;
pub const MAX_COUNT_CHANNELS_IN_RING_BUFFER: u32 = 64;
pub const MAX_COUNT_CHANNEL_SETS: u32 = 64;
pub const MAX_COUNT_DAI_FORMATS: u32 = MAX_COUNT_FORMATS as u32;
pub const MAX_COUNT_DAI_SUPPORTED_BITS_PER_SAMPLE: u32 = 8;
pub const MAX_COUNT_DAI_SUPPORTED_BITS_PER_SLOT: u32 = 8;
pub const MAX_COUNT_DAI_SUPPORTED_FRAME_FORMATS: u32 = 64;
pub const MAX_COUNT_DAI_SUPPORTED_NUMBER_OF_CHANNELS: u32 = 64;
pub const MAX_COUNT_DAI_SUPPORTED_RATES: u32 = 64;
pub const MAX_COUNT_DAI_SUPPORTED_SAMPLE_FORMATS: u32 = 4;
pub const MAX_COUNT_FORMATS: u32 = 64;
pub const MAX_COUNT_SUPPORTED_BYTES_PER_SAMPLE: u32 = 8;
pub const MAX_COUNT_SUPPORTED_NUMBER_OF_CHANNELS: u32 = 64;
pub const MAX_COUNT_SUPPORTED_RATES: u32 = 64;
pub const MAX_COUNT_SUPPORTED_SAMPLE_FORMATS: u32 = 3;
pub const MAX_COUNT_SUPPORTED_VALID_BITS_PER_SAMPLE: u32 = 8;
pub const MAX_DAI_UI_STRING_SIZE: u32 = 256;
pub const MAX_UI_STRING_SIZE: u32 = 256;
pub const UNIQUE_ID_SIZE: u32 = 16;
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u8)]
pub enum DaiFrameFormatStandard {
None = 1,
I2S = 2,
StereoLeft = 3,
StereoRight = 4,
Tdm1 = 5,
Tdm2 = 6,
Tdm3 = 7,
}
impl DaiFrameFormatStandard {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::None),
2 => Some(Self::I2S),
3 => Some(Self::StereoLeft),
4 => Some(Self::StereoRight),
5 => Some(Self::Tdm1),
6 => Some(Self::Tdm2),
7 => Some(Self::Tdm3),
_ => 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 DaiSampleFormat {
Pdm = 1,
PcmSigned = 2,
PcmUnsigned = 3,
PcmFloat = 4,
}
impl DaiSampleFormat {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::Pdm),
2 => Some(Self::PcmSigned),
3 => Some(Self::PcmUnsigned),
4 => Some(Self::PcmFloat),
_ => 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)]
pub enum DeviceType {
StreamConfig,
Dai,
Codec,
Composite,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! DeviceTypeUnknown {
() => {
_
};
}
impl DeviceType {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::StreamConfig),
2 => Some(Self::Dai),
3 => Some(Self::Codec),
4 => Some(Self::Composite),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::StreamConfig,
2 => Self::Dai,
3 => Self::Codec,
4 => Self::Composite,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::StreamConfig => 1,
Self::Dai => 2,
Self::Codec => 3,
Self::Composite => 4,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum DriverError {
InternalError,
NotSupported,
InvalidArgs,
WrongType,
ShouldWait,
#[doc(hidden)]
__SourceBreaking { unknown_ordinal: u32 },
}
#[macro_export]
macro_rules! DriverErrorUnknown {
() => {
_
};
}
impl DriverError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::InternalError),
2 => Some(Self::NotSupported),
3 => Some(Self::InvalidArgs),
4 => Some(Self::WrongType),
5 => Some(Self::ShouldWait),
_ => None,
}
}
#[inline]
pub fn from_primitive_allow_unknown(prim: u32) -> Self {
match prim {
1 => Self::InternalError,
2 => Self::NotSupported,
3 => Self::InvalidArgs,
4 => Self::WrongType,
5 => Self::ShouldWait,
unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
}
}
#[inline]
pub fn unknown() -> Self {
Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
}
#[inline]
pub const fn into_primitive(self) -> u32 {
match self {
Self::InternalError => 1,
Self::NotSupported => 2,
Self::InvalidArgs => 3,
Self::WrongType => 4,
Self::ShouldWait => 5,
Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
}
}
#[inline]
pub fn is_unknown(&self) -> bool {
match self {
Self::__SourceBreaking { unknown_ordinal: _ } => true,
_ => false,
}
}
}
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(u32)]
pub enum GetVmoError {
InvalidArgs = 1,
InternalError = 2,
}
impl GetVmoError {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
1 => Some(Self::InvalidArgs),
2 => Some(Self::InternalError),
_ => 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 PlugDetectCapabilities {
Hardwired = 0,
CanAsyncNotify = 1,
}
impl PlugDetectCapabilities {
#[inline]
pub fn from_primitive(prim: u32) -> Option<Self> {
match prim {
0 => Some(Self::Hardwired),
1 => Some(Self::CanAsyncNotify),
_ => 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 SampleFormat {
PcmSigned = 1,
PcmUnsigned = 2,
PcmFloat = 3,
}
impl SampleFormat {
#[inline]
pub fn from_primitive(prim: u8) -> Option<Self> {
match prim {
1 => Some(Self::PcmSigned),
2 => Some(Self::PcmUnsigned),
3 => Some(Self::PcmFloat),
_ => 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(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CodecConnectorConnectRequest {
pub codec_protocol: fidl::endpoints::ServerEnd<CodecMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for CodecConnectorConnectRequest
{
}
#[derive(Clone, Debug, PartialEq)]
pub struct CodecGetPropertiesResponse {
pub properties: CodecProperties,
}
impl fidl::Persistable for CodecGetPropertiesResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CodecIsBridgeableResponse {
pub supports_bridged_mode: bool,
}
impl fidl::Persistable for CodecIsBridgeableResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CodecSetBridgedModeRequest {
pub enable_bridged_mode: bool,
}
impl fidl::Persistable for CodecSetBridgedModeRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CodecSetDaiFormatRequest {
pub format: DaiFormat,
}
impl fidl::Persistable for CodecSetDaiFormatRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CodecStartResponse {
pub start_time: i64,
}
impl fidl::Persistable for CodecStartResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CodecStopResponse {
pub stop_time: i64,
}
impl fidl::Persistable for CodecStopResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct CodecWatchPlugStateResponse {
pub plug_state: PlugState,
}
impl fidl::Persistable for CodecWatchPlugStateResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CodecGetDaiFormatsResponse {
pub formats: Vec<DaiSupportedFormats>,
}
impl fidl::Persistable for CodecGetDaiFormatsResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct CodecSetDaiFormatResponse {
pub state: CodecFormatInfo,
}
impl fidl::Persistable for CodecSetDaiFormatResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CompositeConnectorConnectRequest {
pub composite_protocol: fidl::endpoints::ServerEnd<CompositeMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for CompositeConnectorConnectRequest
{
}
#[derive(Debug, PartialEq)]
pub struct CompositeCreateRingBufferRequest {
pub processing_element_id: u64,
pub format: Format,
pub ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for CompositeCreateRingBufferRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CompositeGetDaiFormatsRequest {
pub processing_element_id: u64,
}
impl fidl::Persistable for CompositeGetDaiFormatsRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct CompositeGetPropertiesResponse {
pub properties: CompositeProperties,
}
impl fidl::Persistable for CompositeGetPropertiesResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct CompositeGetRingBufferFormatsRequest {
pub processing_element_id: u64,
}
impl fidl::Persistable for CompositeGetRingBufferFormatsRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CompositeSetDaiFormatRequest {
pub processing_element_id: u64,
pub format: DaiFormat,
}
impl fidl::Persistable for CompositeSetDaiFormatRequest {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct CompositeGetDaiFormatsResponse {
pub dai_formats: Vec<DaiSupportedFormats>,
}
impl fidl::Persistable for CompositeGetDaiFormatsResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct CompositeGetRingBufferFormatsResponse {
pub ring_buffer_formats: Vec<SupportedFormats>,
}
impl fidl::Persistable for CompositeGetRingBufferFormatsResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DaiConnectorConnectRequest {
pub dai_protocol: fidl::endpoints::ServerEnd<DaiMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DaiConnectorConnectRequest
{
}
#[derive(Debug, PartialEq)]
pub struct DaiCreateRingBufferRequest {
pub dai_format: DaiFormat,
pub ring_buffer_format: Format,
pub ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for DaiCreateRingBufferRequest
{
}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DaiFormat {
pub number_of_channels: u32,
pub channels_to_use_bitmask: u64,
pub sample_format: DaiSampleFormat,
pub frame_format: DaiFrameFormat,
pub frame_rate: u32,
pub bits_per_slot: u8,
pub bits_per_sample: u8,
}
impl fidl::Persistable for DaiFormat {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DaiFrameFormatCustom {
pub left_justified: bool,
pub sclk_on_raising: bool,
pub frame_sync_sclks_offset: i8,
pub frame_sync_size: u8,
}
impl fidl::Persistable for DaiFrameFormatCustom {}
#[derive(Clone, Debug, PartialEq)]
pub struct DaiGetPropertiesResponse {
pub properties: DaiProperties,
}
impl fidl::Persistable for DaiGetPropertiesResponse {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DaiSupportedFormats {
pub number_of_channels: Vec<u32>,
pub sample_formats: Vec<DaiSampleFormat>,
pub frame_formats: Vec<DaiFrameFormat>,
pub frame_rates: Vec<u32>,
pub bits_per_slot: Vec<u8>,
pub bits_per_sample: Vec<u8>,
}
impl fidl::Persistable for DaiSupportedFormats {}
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct DaiGetDaiFormatsResponse {
pub dai_formats: Vec<DaiSupportedFormats>,
}
impl fidl::Persistable for DaiGetDaiFormatsResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct DaiGetRingBufferFormatsResponse {
pub ring_buffer_formats: Vec<SupportedFormats>,
}
impl fidl::Persistable for DaiGetRingBufferFormatsResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct HealthGetHealthStateResponse {
pub state: HealthState,
}
impl fidl::Persistable for HealthGetHealthStateResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PcmFormat {
pub number_of_channels: u8,
pub sample_format: SampleFormat,
pub bytes_per_sample: u8,
pub valid_bits_per_sample: u8,
pub frame_rate: u32,
}
impl fidl::Persistable for PcmFormat {}
#[derive(Clone, Debug, PartialEq)]
pub struct RingBufferGetPropertiesResponse {
pub properties: RingBufferProperties,
}
impl fidl::Persistable for RingBufferGetPropertiesResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct RingBufferGetVmoRequest {
pub min_frames: u32,
pub clock_recovery_notifications_per_ring: u32,
}
impl fidl::Persistable for RingBufferGetVmoRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct RingBufferPositionInfo {
pub timestamp: i64,
pub position: u32,
}
impl fidl::Persistable for RingBufferPositionInfo {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct RingBufferSetActiveChannelsRequest {
pub active_channels_bitmask: u64,
}
impl fidl::Persistable for RingBufferSetActiveChannelsRequest {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct RingBufferStartResponse {
pub start_time: i64,
}
impl fidl::Persistable for RingBufferStartResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct RingBufferWatchClockRecoveryPositionInfoResponse {
pub position_info: RingBufferPositionInfo,
}
impl fidl::Persistable for RingBufferWatchClockRecoveryPositionInfoResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct RingBufferGetVmoResponse {
pub num_frames: u32,
pub ring_buffer: fidl::Vmo,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect> for RingBufferGetVmoResponse {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(C)]
pub struct RingBufferSetActiveChannelsResponse {
pub set_time: i64,
}
impl fidl::Persistable for RingBufferSetActiveChannelsResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct RingBufferWatchDelayInfoResponse {
pub delay_info: DelayInfo,
}
impl fidl::Persistable for RingBufferWatchDelayInfoResponse {}
#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct StreamConfigConnectorConnectRequest {
pub protocol: fidl::endpoints::ServerEnd<StreamConfigMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for StreamConfigConnectorConnectRequest
{
}
#[derive(Debug, PartialEq)]
pub struct StreamConfigCreateRingBufferRequest {
pub format: Format,
pub ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
}
impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
for StreamConfigCreateRingBufferRequest
{
}
#[derive(Clone, Debug, PartialEq)]
pub struct StreamConfigGetPropertiesResponse {
pub properties: StreamProperties,
}
impl fidl::Persistable for StreamConfigGetPropertiesResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct StreamConfigGetSupportedFormatsResponse {
pub supported_formats: Vec<SupportedFormats>,
}
impl fidl::Persistable for StreamConfigGetSupportedFormatsResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct StreamConfigSetGainRequest {
pub target_state: GainState,
}
impl fidl::Persistable for StreamConfigSetGainRequest {}
#[derive(Clone, Debug, PartialEq)]
pub struct StreamConfigWatchGainStateResponse {
pub gain_state: GainState,
}
impl fidl::Persistable for StreamConfigWatchGainStateResponse {}
#[derive(Clone, Debug, PartialEq)]
pub struct StreamConfigWatchPlugStateResponse {
pub plug_state: PlugState,
}
impl fidl::Persistable for StreamConfigWatchPlugStateResponse {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ChannelAttributes {
pub min_frequency: Option<u32>,
pub max_frequency: Option<u32>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for ChannelAttributes {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ChannelSet {
pub attributes: Option<Vec<ChannelAttributes>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for ChannelSet {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct CodecFormatInfo {
pub external_delay: Option<i64>,
pub turn_on_delay: Option<i64>,
pub turn_off_delay: Option<i64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for CodecFormatInfo {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct CodecProperties {
pub is_input: Option<bool>,
pub manufacturer: Option<String>,
pub product: Option<String>,
pub unique_id: Option<[u8; 16]>,
pub plug_detect_capabilities: Option<PlugDetectCapabilities>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for CodecProperties {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct CompositeProperties {
pub manufacturer: Option<String>,
pub product: Option<String>,
pub unique_id: Option<[u8; 16]>,
pub clock_domain: Option<u32>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for CompositeProperties {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DaiProperties {
pub is_input: Option<bool>,
pub manufacturer: Option<String>,
pub product_name: Option<String>,
pub unique_id: Option<[u8; 16]>,
pub clock_domain: Option<u32>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for DaiProperties {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DelayInfo {
pub internal_delay: Option<i64>,
pub external_delay: Option<i64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for DelayInfo {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct Format {
pub pcm_format: Option<PcmFormat>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for Format {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct GainState {
pub muted: Option<bool>,
pub agc_enabled: Option<bool>,
pub gain_db: Option<f32>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for GainState {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct HealthState {
pub healthy: Option<bool>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for HealthState {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct PcmSupportedFormats {
pub channel_sets: Option<Vec<ChannelSet>>,
pub sample_formats: Option<Vec<SampleFormat>>,
pub bytes_per_sample: Option<Vec<u8>>,
pub valid_bits_per_sample: Option<Vec<u8>>,
pub frame_rates: Option<Vec<u32>>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for PcmSupportedFormats {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct PlugState {
pub plugged: Option<bool>,
pub plug_state_time: Option<i64>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for PlugState {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct RingBufferProperties {
pub external_delay: Option<i64>,
pub fifo_depth: Option<u32>,
pub needs_cache_flush_or_invalidate: Option<bool>,
pub turn_on_delay: Option<i64>,
pub driver_transfer_bytes: Option<u32>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for RingBufferProperties {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct StreamProperties {
pub unique_id: Option<[u8; 16]>,
pub is_input: Option<bool>,
pub can_mute: Option<bool>,
pub can_agc: Option<bool>,
pub min_gain_db: Option<f32>,
pub max_gain_db: Option<f32>,
pub gain_step_db: Option<f32>,
pub plug_detect_capabilities: Option<PlugDetectCapabilities>,
pub manufacturer: Option<String>,
pub product: Option<String>,
pub clock_domain: Option<u32>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for StreamProperties {}
#[derive(Clone, Debug, Default, PartialEq)]
pub struct SupportedFormats {
pub pcm_supported_formats: Option<PcmSupportedFormats>,
#[doc(hidden)]
pub __source_breaking: fidl::marker::SourceBreaking,
}
impl fidl::Persistable for SupportedFormats {}
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum DaiFrameFormat {
FrameFormatStandard(DaiFrameFormatStandard),
FrameFormatCustom(DaiFrameFormatCustom),
}
impl DaiFrameFormat {
#[inline]
pub fn ordinal(&self) -> u64 {
match *self {
Self::FrameFormatStandard(_) => 1,
Self::FrameFormatCustom(_) => 2,
}
}
#[deprecated = "Strict unions should not use `is_unknown`"]
#[inline]
pub fn is_unknown(&self) -> bool {
false
}
}
impl fidl::Persistable for DaiFrameFormat {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct CodecMarker;
impl fidl::endpoints::ProtocolMarker for CodecMarker {
type Proxy = CodecProxy;
type RequestStream = CodecRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = CodecSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Codec";
}
pub type CodecGetDaiFormatsResult = Result<Vec<DaiSupportedFormats>, i32>;
pub type CodecSetDaiFormatResult = Result<CodecFormatInfo, i32>;
pub trait CodecProxyInterface: Send + Sync {
type GetHealthStateResponseFut: std::future::Future<Output = Result<HealthState, fidl::Error>>
+ Send;
fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut;
fn r#signal_processing_connect(
&self,
protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
) -> Result<(), fidl::Error>;
type ResetResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#reset(&self) -> Self::ResetResponseFut;
type GetPropertiesResponseFut: std::future::Future<Output = Result<CodecProperties, fidl::Error>>
+ Send;
fn r#get_properties(&self) -> Self::GetPropertiesResponseFut;
type StopResponseFut: std::future::Future<Output = Result<i64, fidl::Error>> + Send;
fn r#stop(&self) -> Self::StopResponseFut;
type StartResponseFut: std::future::Future<Output = Result<i64, fidl::Error>> + Send;
fn r#start(&self) -> Self::StartResponseFut;
type IsBridgeableResponseFut: std::future::Future<Output = Result<bool, fidl::Error>> + Send;
fn r#is_bridgeable(&self) -> Self::IsBridgeableResponseFut;
fn r#set_bridged_mode(&self, enable_bridged_mode: bool) -> Result<(), fidl::Error>;
type GetDaiFormatsResponseFut: std::future::Future<Output = Result<CodecGetDaiFormatsResult, fidl::Error>>
+ Send;
fn r#get_dai_formats(&self) -> Self::GetDaiFormatsResponseFut;
type SetDaiFormatResponseFut: std::future::Future<Output = Result<CodecSetDaiFormatResult, fidl::Error>>
+ Send;
fn r#set_dai_format(&self, format: &DaiFormat) -> Self::SetDaiFormatResponseFut;
type WatchPlugStateResponseFut: std::future::Future<Output = Result<PlugState, fidl::Error>>
+ Send;
fn r#watch_plug_state(&self) -> Self::WatchPlugStateResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct CodecSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for CodecSynchronousProxy {
type Proxy = CodecProxy;
type Protocol = CodecMarker;
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 CodecSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <CodecMarker 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<CodecEvent, fidl::Error> {
CodecEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_health_state(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<HealthState, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, HealthGetHealthStateResponse>(
(),
0x4e146d6bca733a84,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.state)
}
pub fn r#signal_processing_connect(
&self,
mut protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(
(protocol,),
0xa81907ce6066295,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#reset(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
(),
0x50757ae579a7bd6b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#get_properties(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<CodecProperties, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, CodecGetPropertiesResponse>(
(),
0x7a0d138a6a1d9d90,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.properties)
}
pub fn r#stop(&self, ___deadline: zx::MonotonicInstant) -> Result<i64, fidl::Error> {
let _response = self.client.send_query::<fidl::encoding::EmptyPayload, CodecStopResponse>(
(),
0x5c2e380df1332dbd,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.stop_time)
}
pub fn r#start(&self, ___deadline: zx::MonotonicInstant) -> Result<i64, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, CodecStartResponse>(
(),
0x329cdacb286ab00,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.start_time)
}
pub fn r#is_bridgeable(&self, ___deadline: zx::MonotonicInstant) -> Result<bool, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, CodecIsBridgeableResponse>(
(),
0x26b0684f603f88ec,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.supports_bridged_mode)
}
pub fn r#set_bridged_mode(&self, mut enable_bridged_mode: bool) -> Result<(), fidl::Error> {
self.client.send::<CodecSetBridgedModeRequest>(
(enable_bridged_mode,),
0x2bd8f7bfd0b0aa36,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_dai_formats(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<CodecGetDaiFormatsResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<CodecGetDaiFormatsResponse, i32>,
>(
(),
0xf8bbc46b4ba6a52,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.formats))
}
pub fn r#set_dai_format(
&self,
mut format: &DaiFormat,
___deadline: zx::MonotonicInstant,
) -> Result<CodecSetDaiFormatResult, fidl::Error> {
let _response = self.client.send_query::<
CodecSetDaiFormatRequest,
fidl::encoding::ResultType<CodecSetDaiFormatResponse, i32>,
>(
(format,),
0x2f829df9e5a7a1ea,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.state))
}
pub fn r#watch_plug_state(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<PlugState, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, CodecWatchPlugStateResponse>(
(),
0x182b87f935ca7326,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.plug_state)
}
}
#[derive(Debug, Clone)]
pub struct CodecProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for CodecProxy {
type Protocol = CodecMarker;
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 CodecProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <CodecMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> CodecEventStream {
CodecEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_health_state(
&self,
) -> fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>
{
CodecProxyInterface::r#get_health_state(self)
}
pub fn r#signal_processing_connect(
&self,
mut protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
) -> Result<(), fidl::Error> {
CodecProxyInterface::r#signal_processing_connect(self, protocol)
}
pub fn r#reset(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
CodecProxyInterface::r#reset(self)
}
pub fn r#get_properties(
&self,
) -> fidl::client::QueryResponseFut<
CodecProperties,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CodecProxyInterface::r#get_properties(self)
}
pub fn r#stop(
&self,
) -> fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect> {
CodecProxyInterface::r#stop(self)
}
pub fn r#start(
&self,
) -> fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect> {
CodecProxyInterface::r#start(self)
}
pub fn r#is_bridgeable(
&self,
) -> fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect> {
CodecProxyInterface::r#is_bridgeable(self)
}
pub fn r#set_bridged_mode(&self, mut enable_bridged_mode: bool) -> Result<(), fidl::Error> {
CodecProxyInterface::r#set_bridged_mode(self, enable_bridged_mode)
}
pub fn r#get_dai_formats(
&self,
) -> fidl::client::QueryResponseFut<
CodecGetDaiFormatsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CodecProxyInterface::r#get_dai_formats(self)
}
pub fn r#set_dai_format(
&self,
mut format: &DaiFormat,
) -> fidl::client::QueryResponseFut<
CodecSetDaiFormatResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CodecProxyInterface::r#set_dai_format(self, format)
}
pub fn r#watch_plug_state(
&self,
) -> fidl::client::QueryResponseFut<PlugState, fidl::encoding::DefaultFuchsiaResourceDialect>
{
CodecProxyInterface::r#watch_plug_state(self)
}
}
impl CodecProxyInterface for CodecProxy {
type GetHealthStateResponseFut =
fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<HealthState, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
HealthGetHealthStateResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4e146d6bca733a84,
>(_buf?)?;
Ok(_response.state)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, HealthState>(
(),
0x4e146d6bca733a84,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#signal_processing_connect(
&self,
mut protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(
(protocol,),
0xa81907ce6066295,
fidl::encoding::DynamicFlags::empty(),
)
}
type ResetResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#reset(&self) -> Self::ResetResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x50757ae579a7bd6b,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x50757ae579a7bd6b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetPropertiesResponseFut = fidl::client::QueryResponseFut<
CodecProperties,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_properties(&self) -> Self::GetPropertiesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CodecProperties, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
CodecGetPropertiesResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7a0d138a6a1d9d90,
>(_buf?)?;
Ok(_response.properties)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, CodecProperties>(
(),
0x7a0d138a6a1d9d90,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StopResponseFut =
fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#stop(&self) -> Self::StopResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i64, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
CodecStopResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5c2e380df1332dbd,
>(_buf?)?;
Ok(_response.stop_time)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i64>(
(),
0x5c2e380df1332dbd,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StartResponseFut =
fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#start(&self) -> Self::StartResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i64, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
CodecStartResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x329cdacb286ab00,
>(_buf?)?;
Ok(_response.start_time)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i64>(
(),
0x329cdacb286ab00,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type IsBridgeableResponseFut =
fidl::client::QueryResponseFut<bool, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#is_bridgeable(&self) -> Self::IsBridgeableResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<bool, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
CodecIsBridgeableResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x26b0684f603f88ec,
>(_buf?)?;
Ok(_response.supports_bridged_mode)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, bool>(
(),
0x26b0684f603f88ec,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#set_bridged_mode(&self, mut enable_bridged_mode: bool) -> Result<(), fidl::Error> {
self.client.send::<CodecSetBridgedModeRequest>(
(enable_bridged_mode,),
0x2bd8f7bfd0b0aa36,
fidl::encoding::DynamicFlags::empty(),
)
}
type GetDaiFormatsResponseFut = fidl::client::QueryResponseFut<
CodecGetDaiFormatsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_dai_formats(&self) -> Self::GetDaiFormatsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CodecGetDaiFormatsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<CodecGetDaiFormatsResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xf8bbc46b4ba6a52,
>(_buf?)?;
Ok(_response.map(|x| x.formats))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, CodecGetDaiFormatsResult>(
(),
0xf8bbc46b4ba6a52,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetDaiFormatResponseFut = fidl::client::QueryResponseFut<
CodecSetDaiFormatResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_dai_format(&self, mut format: &DaiFormat) -> Self::SetDaiFormatResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CodecSetDaiFormatResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<CodecSetDaiFormatResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2f829df9e5a7a1ea,
>(_buf?)?;
Ok(_response.map(|x| x.state))
}
self.client.send_query_and_decode::<CodecSetDaiFormatRequest, CodecSetDaiFormatResult>(
(format,),
0x2f829df9e5a7a1ea,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WatchPlugStateResponseFut =
fidl::client::QueryResponseFut<PlugState, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#watch_plug_state(&self) -> Self::WatchPlugStateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<PlugState, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
CodecWatchPlugStateResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x182b87f935ca7326,
>(_buf?)?;
Ok(_response.plug_state)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PlugState>(
(),
0x182b87f935ca7326,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct CodecEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for CodecEventStream {}
impl futures::stream::FusedStream for CodecEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for CodecEventStream {
type Item = Result<CodecEvent, 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(CodecEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum CodecEvent {}
impl CodecEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<CodecEvent, 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: <CodecMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct CodecRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for CodecRequestStream {}
impl futures::stream::FusedStream for CodecRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for CodecRequestStream {
type Protocol = CodecMarker;
type ControlHandle = CodecControlHandle;
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 {
CodecControlHandle { 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 CodecRequestStream {
type Item = Result<CodecRequest, 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 CodecRequestStream 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 {
0x4e146d6bca733a84 => {
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 = CodecControlHandle { inner: this.inner.clone() };
Ok(CodecRequest::GetHealthState {
responder: CodecGetHealthStateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xa81907ce6066295 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CodecControlHandle { inner: this.inner.clone() };
Ok(CodecRequest::SignalProcessingConnect {
protocol: req.protocol,
control_handle,
})
}
0x50757ae579a7bd6b => {
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 = CodecControlHandle { inner: this.inner.clone() };
Ok(CodecRequest::Reset {
responder: CodecResetResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x7a0d138a6a1d9d90 => {
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 = CodecControlHandle { inner: this.inner.clone() };
Ok(CodecRequest::GetProperties {
responder: CodecGetPropertiesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5c2e380df1332dbd => {
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 = CodecControlHandle { inner: this.inner.clone() };
Ok(CodecRequest::Stop {
responder: CodecStopResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x329cdacb286ab00 => {
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 = CodecControlHandle { inner: this.inner.clone() };
Ok(CodecRequest::Start {
responder: CodecStartResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x26b0684f603f88ec => {
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 = CodecControlHandle { inner: this.inner.clone() };
Ok(CodecRequest::IsBridgeable {
responder: CodecIsBridgeableResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2bd8f7bfd0b0aa36 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
CodecSetBridgedModeRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CodecSetBridgedModeRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CodecControlHandle { inner: this.inner.clone() };
Ok(CodecRequest::SetBridgedMode {
enable_bridged_mode: req.enable_bridged_mode,
control_handle,
})
}
0xf8bbc46b4ba6a52 => {
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 = CodecControlHandle { inner: this.inner.clone() };
Ok(CodecRequest::GetDaiFormats {
responder: CodecGetDaiFormatsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2f829df9e5a7a1ea => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CodecSetDaiFormatRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CodecSetDaiFormatRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CodecControlHandle { inner: this.inner.clone() };
Ok(CodecRequest::SetDaiFormat {
format: req.format,
responder: CodecSetDaiFormatResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x182b87f935ca7326 => {
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 = CodecControlHandle { inner: this.inner.clone() };
Ok(CodecRequest::WatchPlugState {
responder: CodecWatchPlugStateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <CodecMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum CodecRequest {
GetHealthState { responder: CodecGetHealthStateResponder },
SignalProcessingConnect {
protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
control_handle: CodecControlHandle,
},
Reset { responder: CodecResetResponder },
GetProperties { responder: CodecGetPropertiesResponder },
Stop { responder: CodecStopResponder },
Start { responder: CodecStartResponder },
IsBridgeable { responder: CodecIsBridgeableResponder },
SetBridgedMode { enable_bridged_mode: bool, control_handle: CodecControlHandle },
GetDaiFormats { responder: CodecGetDaiFormatsResponder },
SetDaiFormat { format: DaiFormat, responder: CodecSetDaiFormatResponder },
WatchPlugState { responder: CodecWatchPlugStateResponder },
}
impl CodecRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_health_state(self) -> Option<(CodecGetHealthStateResponder)> {
if let CodecRequest::GetHealthState { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_signal_processing_connect(
self,
) -> Option<(
fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
CodecControlHandle,
)> {
if let CodecRequest::SignalProcessingConnect { protocol, control_handle } = self {
Some((protocol, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_reset(self) -> Option<(CodecResetResponder)> {
if let CodecRequest::Reset { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_properties(self) -> Option<(CodecGetPropertiesResponder)> {
if let CodecRequest::GetProperties { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_stop(self) -> Option<(CodecStopResponder)> {
if let CodecRequest::Stop { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_start(self) -> Option<(CodecStartResponder)> {
if let CodecRequest::Start { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_is_bridgeable(self) -> Option<(CodecIsBridgeableResponder)> {
if let CodecRequest::IsBridgeable { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_bridged_mode(self) -> Option<(bool, CodecControlHandle)> {
if let CodecRequest::SetBridgedMode { enable_bridged_mode, control_handle } = self {
Some((enable_bridged_mode, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_dai_formats(self) -> Option<(CodecGetDaiFormatsResponder)> {
if let CodecRequest::GetDaiFormats { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_dai_format(self) -> Option<(DaiFormat, CodecSetDaiFormatResponder)> {
if let CodecRequest::SetDaiFormat { format, responder } = self {
Some((format, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_watch_plug_state(self) -> Option<(CodecWatchPlugStateResponder)> {
if let CodecRequest::WatchPlugState { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
CodecRequest::GetHealthState { .. } => "get_health_state",
CodecRequest::SignalProcessingConnect { .. } => "signal_processing_connect",
CodecRequest::Reset { .. } => "reset",
CodecRequest::GetProperties { .. } => "get_properties",
CodecRequest::Stop { .. } => "stop",
CodecRequest::Start { .. } => "start",
CodecRequest::IsBridgeable { .. } => "is_bridgeable",
CodecRequest::SetBridgedMode { .. } => "set_bridged_mode",
CodecRequest::GetDaiFormats { .. } => "get_dai_formats",
CodecRequest::SetDaiFormat { .. } => "set_dai_format",
CodecRequest::WatchPlugState { .. } => "watch_plug_state",
}
}
}
#[derive(Debug, Clone)]
pub struct CodecControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for CodecControlHandle {
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 CodecControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CodecGetHealthStateResponder {
control_handle: std::mem::ManuallyDrop<CodecControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CodecGetHealthStateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CodecGetHealthStateResponder {
type ControlHandle = CodecControlHandle;
fn control_handle(&self) -> &CodecControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CodecGetHealthStateResponder {
pub fn send(self, mut state: &HealthState) -> Result<(), fidl::Error> {
let _result = self.send_raw(state);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut state: &HealthState) -> Result<(), fidl::Error> {
let _result = self.send_raw(state);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut state: &HealthState) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<HealthGetHealthStateResponse>(
(state,),
self.tx_id,
0x4e146d6bca733a84,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CodecResetResponder {
control_handle: std::mem::ManuallyDrop<CodecControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CodecResetResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CodecResetResponder {
type ControlHandle = CodecControlHandle;
fn control_handle(&self) -> &CodecControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CodecResetResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x50757ae579a7bd6b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CodecGetPropertiesResponder {
control_handle: std::mem::ManuallyDrop<CodecControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CodecGetPropertiesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CodecGetPropertiesResponder {
type ControlHandle = CodecControlHandle;
fn control_handle(&self) -> &CodecControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CodecGetPropertiesResponder {
pub fn send(self, mut properties: &CodecProperties) -> Result<(), fidl::Error> {
let _result = self.send_raw(properties);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut properties: &CodecProperties,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(properties);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut properties: &CodecProperties) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<CodecGetPropertiesResponse>(
(properties,),
self.tx_id,
0x7a0d138a6a1d9d90,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CodecStopResponder {
control_handle: std::mem::ManuallyDrop<CodecControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CodecStopResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CodecStopResponder {
type ControlHandle = CodecControlHandle;
fn control_handle(&self) -> &CodecControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CodecStopResponder {
pub fn send(self, mut stop_time: i64) -> Result<(), fidl::Error> {
let _result = self.send_raw(stop_time);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut stop_time: i64) -> Result<(), fidl::Error> {
let _result = self.send_raw(stop_time);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut stop_time: i64) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<CodecStopResponse>(
(stop_time,),
self.tx_id,
0x5c2e380df1332dbd,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CodecStartResponder {
control_handle: std::mem::ManuallyDrop<CodecControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CodecStartResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CodecStartResponder {
type ControlHandle = CodecControlHandle;
fn control_handle(&self) -> &CodecControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CodecStartResponder {
pub fn send(self, mut start_time: i64) -> Result<(), fidl::Error> {
let _result = self.send_raw(start_time);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut start_time: i64) -> Result<(), fidl::Error> {
let _result = self.send_raw(start_time);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut start_time: i64) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<CodecStartResponse>(
(start_time,),
self.tx_id,
0x329cdacb286ab00,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CodecIsBridgeableResponder {
control_handle: std::mem::ManuallyDrop<CodecControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CodecIsBridgeableResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CodecIsBridgeableResponder {
type ControlHandle = CodecControlHandle;
fn control_handle(&self) -> &CodecControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CodecIsBridgeableResponder {
pub fn send(self, mut supports_bridged_mode: bool) -> Result<(), fidl::Error> {
let _result = self.send_raw(supports_bridged_mode);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut supports_bridged_mode: bool,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(supports_bridged_mode);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut supports_bridged_mode: bool) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<CodecIsBridgeableResponse>(
(supports_bridged_mode,),
self.tx_id,
0x26b0684f603f88ec,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CodecGetDaiFormatsResponder {
control_handle: std::mem::ManuallyDrop<CodecControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CodecGetDaiFormatsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CodecGetDaiFormatsResponder {
type ControlHandle = CodecControlHandle;
fn control_handle(&self) -> &CodecControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CodecGetDaiFormatsResponder {
pub fn send(self, mut result: Result<&[DaiSupportedFormats], 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<&[DaiSupportedFormats], i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&[DaiSupportedFormats], i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<CodecGetDaiFormatsResponse, i32>>(
result.map(|formats| (formats,)),
self.tx_id,
0xf8bbc46b4ba6a52,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CodecSetDaiFormatResponder {
control_handle: std::mem::ManuallyDrop<CodecControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CodecSetDaiFormatResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CodecSetDaiFormatResponder {
type ControlHandle = CodecControlHandle;
fn control_handle(&self) -> &CodecControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CodecSetDaiFormatResponder {
pub fn send(self, mut result: Result<&CodecFormatInfo, 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<&CodecFormatInfo, i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&CodecFormatInfo, i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<CodecSetDaiFormatResponse, i32>>(
result.map(|state| (state,)),
self.tx_id,
0x2f829df9e5a7a1ea,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CodecWatchPlugStateResponder {
control_handle: std::mem::ManuallyDrop<CodecControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CodecWatchPlugStateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CodecWatchPlugStateResponder {
type ControlHandle = CodecControlHandle;
fn control_handle(&self) -> &CodecControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CodecWatchPlugStateResponder {
pub fn send(self, mut plug_state: &PlugState) -> Result<(), fidl::Error> {
let _result = self.send_raw(plug_state);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut plug_state: &PlugState) -> Result<(), fidl::Error> {
let _result = self.send_raw(plug_state);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut plug_state: &PlugState) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<CodecWatchPlugStateResponse>(
(plug_state,),
self.tx_id,
0x182b87f935ca7326,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct CodecConnectorMarker;
impl fidl::endpoints::ProtocolMarker for CodecConnectorMarker {
type Proxy = CodecConnectorProxy;
type RequestStream = CodecConnectorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = CodecConnectorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) CodecConnector";
}
pub trait CodecConnectorProxyInterface: Send + Sync {
fn r#connect(
&self,
codec_protocol: fidl::endpoints::ServerEnd<CodecMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct CodecConnectorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for CodecConnectorSynchronousProxy {
type Proxy = CodecConnectorProxy;
type Protocol = CodecConnectorMarker;
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 CodecConnectorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <CodecConnectorMarker 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<CodecConnectorEvent, fidl::Error> {
CodecConnectorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#connect(
&self,
mut codec_protocol: fidl::endpoints::ServerEnd<CodecMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<CodecConnectorConnectRequest>(
(codec_protocol,),
0x1413f551544026c9,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct CodecConnectorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for CodecConnectorProxy {
type Protocol = CodecConnectorMarker;
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 CodecConnectorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <CodecConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> CodecConnectorEventStream {
CodecConnectorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#connect(
&self,
mut codec_protocol: fidl::endpoints::ServerEnd<CodecMarker>,
) -> Result<(), fidl::Error> {
CodecConnectorProxyInterface::r#connect(self, codec_protocol)
}
}
impl CodecConnectorProxyInterface for CodecConnectorProxy {
fn r#connect(
&self,
mut codec_protocol: fidl::endpoints::ServerEnd<CodecMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<CodecConnectorConnectRequest>(
(codec_protocol,),
0x1413f551544026c9,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct CodecConnectorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for CodecConnectorEventStream {}
impl futures::stream::FusedStream for CodecConnectorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for CodecConnectorEventStream {
type Item = Result<CodecConnectorEvent, 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(CodecConnectorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum CodecConnectorEvent {}
impl CodecConnectorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<CodecConnectorEvent, 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:
<CodecConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct CodecConnectorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for CodecConnectorRequestStream {}
impl futures::stream::FusedStream for CodecConnectorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for CodecConnectorRequestStream {
type Protocol = CodecConnectorMarker;
type ControlHandle = CodecConnectorControlHandle;
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 {
CodecConnectorControlHandle { 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 CodecConnectorRequestStream {
type Item = Result<CodecConnectorRequest, 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 CodecConnectorRequestStream 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 {
0x1413f551544026c9 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
CodecConnectorConnectRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CodecConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
CodecConnectorControlHandle { inner: this.inner.clone() };
Ok(CodecConnectorRequest::Connect {
codec_protocol: req.codec_protocol,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<CodecConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum CodecConnectorRequest {
Connect {
codec_protocol: fidl::endpoints::ServerEnd<CodecMarker>,
control_handle: CodecConnectorControlHandle,
},
}
impl CodecConnectorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_connect(
self,
) -> Option<(fidl::endpoints::ServerEnd<CodecMarker>, CodecConnectorControlHandle)> {
if let CodecConnectorRequest::Connect { codec_protocol, control_handle } = self {
Some((codec_protocol, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
CodecConnectorRequest::Connect { .. } => "connect",
}
}
}
#[derive(Debug, Clone)]
pub struct CodecConnectorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for CodecConnectorControlHandle {
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 CodecConnectorControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct CompositeMarker;
impl fidl::endpoints::ProtocolMarker for CompositeMarker {
type Proxy = CompositeProxy;
type RequestStream = CompositeRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = CompositeSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Composite";
}
pub type CompositeResetResult = Result<(), DriverError>;
pub type CompositeGetRingBufferFormatsResult = Result<Vec<SupportedFormats>, DriverError>;
pub type CompositeCreateRingBufferResult = Result<(), DriverError>;
pub type CompositeGetDaiFormatsResult = Result<Vec<DaiSupportedFormats>, DriverError>;
pub type CompositeSetDaiFormatResult = Result<(), DriverError>;
pub trait CompositeProxyInterface: Send + Sync {
type GetHealthStateResponseFut: std::future::Future<Output = Result<HealthState, fidl::Error>>
+ Send;
fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut;
fn r#signal_processing_connect(
&self,
protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
) -> Result<(), fidl::Error>;
type ResetResponseFut: std::future::Future<Output = Result<CompositeResetResult, fidl::Error>>
+ Send;
fn r#reset(&self) -> Self::ResetResponseFut;
type GetPropertiesResponseFut: std::future::Future<Output = Result<CompositeProperties, fidl::Error>>
+ Send;
fn r#get_properties(&self) -> Self::GetPropertiesResponseFut;
type GetRingBufferFormatsResponseFut: std::future::Future<Output = Result<CompositeGetRingBufferFormatsResult, fidl::Error>>
+ Send;
fn r#get_ring_buffer_formats(
&self,
processing_element_id: u64,
) -> Self::GetRingBufferFormatsResponseFut;
type CreateRingBufferResponseFut: std::future::Future<Output = Result<CompositeCreateRingBufferResult, fidl::Error>>
+ Send;
fn r#create_ring_buffer(
&self,
processing_element_id: u64,
format: &Format,
ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
) -> Self::CreateRingBufferResponseFut;
type GetDaiFormatsResponseFut: std::future::Future<Output = Result<CompositeGetDaiFormatsResult, fidl::Error>>
+ Send;
fn r#get_dai_formats(&self, processing_element_id: u64) -> Self::GetDaiFormatsResponseFut;
type SetDaiFormatResponseFut: std::future::Future<Output = Result<CompositeSetDaiFormatResult, fidl::Error>>
+ Send;
fn r#set_dai_format(
&self,
processing_element_id: u64,
format: &DaiFormat,
) -> Self::SetDaiFormatResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct CompositeSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for CompositeSynchronousProxy {
type Proxy = CompositeProxy;
type Protocol = CompositeMarker;
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 CompositeSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <CompositeMarker 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<CompositeEvent, fidl::Error> {
CompositeEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_health_state(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<HealthState, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, HealthGetHealthStateResponse>(
(),
0x4e146d6bca733a84,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.state)
}
pub fn r#signal_processing_connect(
&self,
mut protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(
(protocol,),
0xa81907ce6066295,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#reset(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<CompositeResetResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DriverError>,
>(
(),
0xac355fb98341996,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_properties(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<CompositeProperties, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, CompositeGetPropertiesResponse>(
(),
0x31846fa0a459942b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.properties)
}
pub fn r#get_ring_buffer_formats(
&self,
mut processing_element_id: u64,
___deadline: zx::MonotonicInstant,
) -> Result<CompositeGetRingBufferFormatsResult, fidl::Error> {
let _response = self.client.send_query::<
CompositeGetRingBufferFormatsRequest,
fidl::encoding::ResultType<CompositeGetRingBufferFormatsResponse, DriverError>,
>(
(processing_element_id,),
0x1d89b701b6816ac4,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.ring_buffer_formats))
}
pub fn r#create_ring_buffer(
&self,
mut processing_element_id: u64,
mut format: &Format,
mut ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
___deadline: zx::MonotonicInstant,
) -> Result<CompositeCreateRingBufferResult, fidl::Error> {
let _response = self.client.send_query::<
CompositeCreateRingBufferRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DriverError>,
>(
(processing_element_id, format, ring_buffer,),
0x28c5685f85262033,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
pub fn r#get_dai_formats(
&self,
mut processing_element_id: u64,
___deadline: zx::MonotonicInstant,
) -> Result<CompositeGetDaiFormatsResult, fidl::Error> {
let _response = self.client.send_query::<
CompositeGetDaiFormatsRequest,
fidl::encoding::ResultType<CompositeGetDaiFormatsResponse, DriverError>,
>(
(processing_element_id,),
0x3cbeaed59c8f69b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.dai_formats))
}
pub fn r#set_dai_format(
&self,
mut processing_element_id: u64,
mut format: &DaiFormat,
___deadline: zx::MonotonicInstant,
) -> Result<CompositeSetDaiFormatResult, fidl::Error> {
let _response = self.client.send_query::<
CompositeSetDaiFormatRequest,
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DriverError>,
>(
(processing_element_id, format,),
0x155acf5cc0dc8a84,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x))
}
}
#[derive(Debug, Clone)]
pub struct CompositeProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for CompositeProxy {
type Protocol = CompositeMarker;
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 CompositeProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <CompositeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> CompositeEventStream {
CompositeEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_health_state(
&self,
) -> fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>
{
CompositeProxyInterface::r#get_health_state(self)
}
pub fn r#signal_processing_connect(
&self,
mut protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
) -> Result<(), fidl::Error> {
CompositeProxyInterface::r#signal_processing_connect(self, protocol)
}
pub fn r#reset(
&self,
) -> fidl::client::QueryResponseFut<
CompositeResetResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CompositeProxyInterface::r#reset(self)
}
pub fn r#get_properties(
&self,
) -> fidl::client::QueryResponseFut<
CompositeProperties,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CompositeProxyInterface::r#get_properties(self)
}
pub fn r#get_ring_buffer_formats(
&self,
mut processing_element_id: u64,
) -> fidl::client::QueryResponseFut<
CompositeGetRingBufferFormatsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CompositeProxyInterface::r#get_ring_buffer_formats(self, processing_element_id)
}
pub fn r#create_ring_buffer(
&self,
mut processing_element_id: u64,
mut format: &Format,
mut ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
) -> fidl::client::QueryResponseFut<
CompositeCreateRingBufferResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CompositeProxyInterface::r#create_ring_buffer(
self,
processing_element_id,
format,
ring_buffer,
)
}
pub fn r#get_dai_formats(
&self,
mut processing_element_id: u64,
) -> fidl::client::QueryResponseFut<
CompositeGetDaiFormatsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CompositeProxyInterface::r#get_dai_formats(self, processing_element_id)
}
pub fn r#set_dai_format(
&self,
mut processing_element_id: u64,
mut format: &DaiFormat,
) -> fidl::client::QueryResponseFut<
CompositeSetDaiFormatResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
CompositeProxyInterface::r#set_dai_format(self, processing_element_id, format)
}
}
impl CompositeProxyInterface for CompositeProxy {
type GetHealthStateResponseFut =
fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<HealthState, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
HealthGetHealthStateResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4e146d6bca733a84,
>(_buf?)?;
Ok(_response.state)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, HealthState>(
(),
0x4e146d6bca733a84,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#signal_processing_connect(
&self,
mut protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(
(protocol,),
0xa81907ce6066295,
fidl::encoding::DynamicFlags::empty(),
)
}
type ResetResponseFut = fidl::client::QueryResponseFut<
CompositeResetResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#reset(&self) -> Self::ResetResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CompositeResetResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DriverError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0xac355fb98341996,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, CompositeResetResult>(
(),
0xac355fb98341996,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetPropertiesResponseFut = fidl::client::QueryResponseFut<
CompositeProperties,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_properties(&self) -> Self::GetPropertiesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CompositeProperties, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
CompositeGetPropertiesResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x31846fa0a459942b,
>(_buf?)?;
Ok(_response.properties)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, CompositeProperties>(
(),
0x31846fa0a459942b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetRingBufferFormatsResponseFut = fidl::client::QueryResponseFut<
CompositeGetRingBufferFormatsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_ring_buffer_formats(
&self,
mut processing_element_id: u64,
) -> Self::GetRingBufferFormatsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CompositeGetRingBufferFormatsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<CompositeGetRingBufferFormatsResponse, DriverError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1d89b701b6816ac4,
>(_buf?)?;
Ok(_response.map(|x| x.ring_buffer_formats))
}
self.client.send_query_and_decode::<
CompositeGetRingBufferFormatsRequest,
CompositeGetRingBufferFormatsResult,
>(
(processing_element_id,),
0x1d89b701b6816ac4,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type CreateRingBufferResponseFut = fidl::client::QueryResponseFut<
CompositeCreateRingBufferResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#create_ring_buffer(
&self,
mut processing_element_id: u64,
mut format: &Format,
mut ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
) -> Self::CreateRingBufferResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CompositeCreateRingBufferResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DriverError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x28c5685f85262033,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client.send_query_and_decode::<
CompositeCreateRingBufferRequest,
CompositeCreateRingBufferResult,
>(
(processing_element_id, format, ring_buffer,),
0x28c5685f85262033,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetDaiFormatsResponseFut = fidl::client::QueryResponseFut<
CompositeGetDaiFormatsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_dai_formats(&self, mut processing_element_id: u64) -> Self::GetDaiFormatsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CompositeGetDaiFormatsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<CompositeGetDaiFormatsResponse, DriverError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x3cbeaed59c8f69b,
>(_buf?)?;
Ok(_response.map(|x| x.dai_formats))
}
self.client
.send_query_and_decode::<CompositeGetDaiFormatsRequest, CompositeGetDaiFormatsResult>(
(processing_element_id,),
0x3cbeaed59c8f69b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetDaiFormatResponseFut = fidl::client::QueryResponseFut<
CompositeSetDaiFormatResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_dai_format(
&self,
mut processing_element_id: u64,
mut format: &DaiFormat,
) -> Self::SetDaiFormatResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<CompositeSetDaiFormatResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<fidl::encoding::EmptyStruct, DriverError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x155acf5cc0dc8a84,
>(_buf?)?;
Ok(_response.map(|x| x))
}
self.client
.send_query_and_decode::<CompositeSetDaiFormatRequest, CompositeSetDaiFormatResult>(
(processing_element_id, format),
0x155acf5cc0dc8a84,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct CompositeEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for CompositeEventStream {}
impl futures::stream::FusedStream for CompositeEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for CompositeEventStream {
type Item = Result<CompositeEvent, 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(CompositeEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum CompositeEvent {}
impl CompositeEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<CompositeEvent, 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: <CompositeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct CompositeRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for CompositeRequestStream {}
impl futures::stream::FusedStream for CompositeRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for CompositeRequestStream {
type Protocol = CompositeMarker;
type ControlHandle = CompositeControlHandle;
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 {
CompositeControlHandle { 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 CompositeRequestStream {
type Item = Result<CompositeRequest, 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 CompositeRequestStream 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 {
0x4e146d6bca733a84 => {
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 = CompositeControlHandle { inner: this.inner.clone() };
Ok(CompositeRequest::GetHealthState {
responder: CompositeGetHealthStateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xa81907ce6066295 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CompositeControlHandle { inner: this.inner.clone() };
Ok(CompositeRequest::SignalProcessingConnect {
protocol: req.protocol,
control_handle,
})
}
0xac355fb98341996 => {
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 = CompositeControlHandle { inner: this.inner.clone() };
Ok(CompositeRequest::Reset {
responder: CompositeResetResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x31846fa0a459942b => {
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 = CompositeControlHandle { inner: this.inner.clone() };
Ok(CompositeRequest::GetProperties {
responder: CompositeGetPropertiesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1d89b701b6816ac4 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CompositeGetRingBufferFormatsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CompositeGetRingBufferFormatsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CompositeControlHandle { inner: this.inner.clone() };
Ok(CompositeRequest::GetRingBufferFormats {
processing_element_id: req.processing_element_id,
responder: CompositeGetRingBufferFormatsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x28c5685f85262033 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CompositeCreateRingBufferRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CompositeCreateRingBufferRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CompositeControlHandle { inner: this.inner.clone() };
Ok(CompositeRequest::CreateRingBuffer {
processing_element_id: req.processing_element_id,
format: req.format,
ring_buffer: req.ring_buffer,
responder: CompositeCreateRingBufferResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3cbeaed59c8f69b => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CompositeGetDaiFormatsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CompositeGetDaiFormatsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CompositeControlHandle { inner: this.inner.clone() };
Ok(CompositeRequest::GetDaiFormats {
processing_element_id: req.processing_element_id,
responder: CompositeGetDaiFormatsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x155acf5cc0dc8a84 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
CompositeSetDaiFormatRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CompositeSetDaiFormatRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CompositeControlHandle { inner: this.inner.clone() };
Ok(CompositeRequest::SetDaiFormat {
processing_element_id: req.processing_element_id,
format: req.format,
responder: CompositeSetDaiFormatResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<CompositeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum CompositeRequest {
GetHealthState { responder: CompositeGetHealthStateResponder },
SignalProcessingConnect {
protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
control_handle: CompositeControlHandle,
},
Reset { responder: CompositeResetResponder },
GetProperties { responder: CompositeGetPropertiesResponder },
GetRingBufferFormats {
processing_element_id: u64,
responder: CompositeGetRingBufferFormatsResponder,
},
CreateRingBuffer {
processing_element_id: u64,
format: Format,
ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
responder: CompositeCreateRingBufferResponder,
},
GetDaiFormats { processing_element_id: u64, responder: CompositeGetDaiFormatsResponder },
SetDaiFormat {
processing_element_id: u64,
format: DaiFormat,
responder: CompositeSetDaiFormatResponder,
},
}
impl CompositeRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_health_state(self) -> Option<(CompositeGetHealthStateResponder)> {
if let CompositeRequest::GetHealthState { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_signal_processing_connect(
self,
) -> Option<(
fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
CompositeControlHandle,
)> {
if let CompositeRequest::SignalProcessingConnect { protocol, control_handle } = self {
Some((protocol, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_reset(self) -> Option<(CompositeResetResponder)> {
if let CompositeRequest::Reset { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_properties(self) -> Option<(CompositeGetPropertiesResponder)> {
if let CompositeRequest::GetProperties { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_ring_buffer_formats(
self,
) -> Option<(u64, CompositeGetRingBufferFormatsResponder)> {
if let CompositeRequest::GetRingBufferFormats { processing_element_id, responder } = self {
Some((processing_element_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_create_ring_buffer(
self,
) -> Option<(
u64,
Format,
fidl::endpoints::ServerEnd<RingBufferMarker>,
CompositeCreateRingBufferResponder,
)> {
if let CompositeRequest::CreateRingBuffer {
processing_element_id,
format,
ring_buffer,
responder,
} = self
{
Some((processing_element_id, format, ring_buffer, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_dai_formats(self) -> Option<(u64, CompositeGetDaiFormatsResponder)> {
if let CompositeRequest::GetDaiFormats { processing_element_id, responder } = self {
Some((processing_element_id, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_dai_format(self) -> Option<(u64, DaiFormat, CompositeSetDaiFormatResponder)> {
if let CompositeRequest::SetDaiFormat { processing_element_id, format, responder } = self {
Some((processing_element_id, format, responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
CompositeRequest::GetHealthState { .. } => "get_health_state",
CompositeRequest::SignalProcessingConnect { .. } => "signal_processing_connect",
CompositeRequest::Reset { .. } => "reset",
CompositeRequest::GetProperties { .. } => "get_properties",
CompositeRequest::GetRingBufferFormats { .. } => "get_ring_buffer_formats",
CompositeRequest::CreateRingBuffer { .. } => "create_ring_buffer",
CompositeRequest::GetDaiFormats { .. } => "get_dai_formats",
CompositeRequest::SetDaiFormat { .. } => "set_dai_format",
}
}
}
#[derive(Debug, Clone)]
pub struct CompositeControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for CompositeControlHandle {
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 CompositeControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CompositeGetHealthStateResponder {
control_handle: std::mem::ManuallyDrop<CompositeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CompositeGetHealthStateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CompositeGetHealthStateResponder {
type ControlHandle = CompositeControlHandle;
fn control_handle(&self) -> &CompositeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CompositeGetHealthStateResponder {
pub fn send(self, mut state: &HealthState) -> Result<(), fidl::Error> {
let _result = self.send_raw(state);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut state: &HealthState) -> Result<(), fidl::Error> {
let _result = self.send_raw(state);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut state: &HealthState) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<HealthGetHealthStateResponse>(
(state,),
self.tx_id,
0x4e146d6bca733a84,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CompositeResetResponder {
control_handle: std::mem::ManuallyDrop<CompositeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CompositeResetResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CompositeResetResponder {
type ControlHandle = CompositeControlHandle;
fn control_handle(&self) -> &CompositeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CompositeResetResponder {
pub fn send(self, mut result: Result<(), DriverError>) -> 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<(), DriverError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), DriverError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
DriverError,
>>(
result,
self.tx_id,
0xac355fb98341996,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CompositeGetPropertiesResponder {
control_handle: std::mem::ManuallyDrop<CompositeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CompositeGetPropertiesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CompositeGetPropertiesResponder {
type ControlHandle = CompositeControlHandle;
fn control_handle(&self) -> &CompositeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CompositeGetPropertiesResponder {
pub fn send(self, mut properties: &CompositeProperties) -> Result<(), fidl::Error> {
let _result = self.send_raw(properties);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut properties: &CompositeProperties,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(properties);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut properties: &CompositeProperties) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<CompositeGetPropertiesResponse>(
(properties,),
self.tx_id,
0x31846fa0a459942b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CompositeGetRingBufferFormatsResponder {
control_handle: std::mem::ManuallyDrop<CompositeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CompositeGetRingBufferFormatsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CompositeGetRingBufferFormatsResponder {
type ControlHandle = CompositeControlHandle;
fn control_handle(&self) -> &CompositeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CompositeGetRingBufferFormatsResponder {
pub fn send(
self,
mut result: Result<&[SupportedFormats], DriverError>,
) -> 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<&[SupportedFormats], DriverError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&[SupportedFormats], DriverError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
CompositeGetRingBufferFormatsResponse,
DriverError,
>>(
result.map(|ring_buffer_formats| (ring_buffer_formats,)),
self.tx_id,
0x1d89b701b6816ac4,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CompositeCreateRingBufferResponder {
control_handle: std::mem::ManuallyDrop<CompositeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CompositeCreateRingBufferResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CompositeCreateRingBufferResponder {
type ControlHandle = CompositeControlHandle;
fn control_handle(&self) -> &CompositeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CompositeCreateRingBufferResponder {
pub fn send(self, mut result: Result<(), DriverError>) -> 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<(), DriverError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), DriverError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
DriverError,
>>(
result,
self.tx_id,
0x28c5685f85262033,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CompositeGetDaiFormatsResponder {
control_handle: std::mem::ManuallyDrop<CompositeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CompositeGetDaiFormatsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CompositeGetDaiFormatsResponder {
type ControlHandle = CompositeControlHandle;
fn control_handle(&self) -> &CompositeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CompositeGetDaiFormatsResponder {
pub fn send(
self,
mut result: Result<&[DaiSupportedFormats], DriverError>,
) -> 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<&[DaiSupportedFormats], DriverError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<&[DaiSupportedFormats], DriverError>,
) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
CompositeGetDaiFormatsResponse,
DriverError,
>>(
result.map(|dai_formats| (dai_formats,)),
self.tx_id,
0x3cbeaed59c8f69b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct CompositeSetDaiFormatResponder {
control_handle: std::mem::ManuallyDrop<CompositeControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for CompositeSetDaiFormatResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for CompositeSetDaiFormatResponder {
type ControlHandle = CompositeControlHandle;
fn control_handle(&self) -> &CompositeControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl CompositeSetDaiFormatResponder {
pub fn send(self, mut result: Result<(), DriverError>) -> 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<(), DriverError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<(), DriverError>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
fidl::encoding::EmptyStruct,
DriverError,
>>(
result,
self.tx_id,
0x155acf5cc0dc8a84,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct CompositeConnectorMarker;
impl fidl::endpoints::ProtocolMarker for CompositeConnectorMarker {
type Proxy = CompositeConnectorProxy;
type RequestStream = CompositeConnectorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = CompositeConnectorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) CompositeConnector";
}
pub trait CompositeConnectorProxyInterface: Send + Sync {
fn r#connect(
&self,
composite_protocol: fidl::endpoints::ServerEnd<CompositeMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct CompositeConnectorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for CompositeConnectorSynchronousProxy {
type Proxy = CompositeConnectorProxy;
type Protocol = CompositeConnectorMarker;
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 CompositeConnectorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<CompositeConnectorMarker 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<CompositeConnectorEvent, fidl::Error> {
CompositeConnectorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#connect(
&self,
mut composite_protocol: fidl::endpoints::ServerEnd<CompositeMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<CompositeConnectorConnectRequest>(
(composite_protocol,),
0x7ee557529079e466,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct CompositeConnectorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for CompositeConnectorProxy {
type Protocol = CompositeConnectorMarker;
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 CompositeConnectorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<CompositeConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> CompositeConnectorEventStream {
CompositeConnectorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#connect(
&self,
mut composite_protocol: fidl::endpoints::ServerEnd<CompositeMarker>,
) -> Result<(), fidl::Error> {
CompositeConnectorProxyInterface::r#connect(self, composite_protocol)
}
}
impl CompositeConnectorProxyInterface for CompositeConnectorProxy {
fn r#connect(
&self,
mut composite_protocol: fidl::endpoints::ServerEnd<CompositeMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<CompositeConnectorConnectRequest>(
(composite_protocol,),
0x7ee557529079e466,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct CompositeConnectorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for CompositeConnectorEventStream {}
impl futures::stream::FusedStream for CompositeConnectorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for CompositeConnectorEventStream {
type Item = Result<CompositeConnectorEvent, 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(CompositeConnectorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum CompositeConnectorEvent {}
impl CompositeConnectorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<CompositeConnectorEvent, 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:
<CompositeConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct CompositeConnectorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for CompositeConnectorRequestStream {}
impl futures::stream::FusedStream for CompositeConnectorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for CompositeConnectorRequestStream {
type Protocol = CompositeConnectorMarker;
type ControlHandle = CompositeConnectorControlHandle;
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 {
CompositeConnectorControlHandle { 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 CompositeConnectorRequestStream {
type Item = Result<CompositeConnectorRequest, 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 CompositeConnectorRequestStream 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 {
0x7ee557529079e466 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(CompositeConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<CompositeConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = CompositeConnectorControlHandle {
inner: this.inner.clone(),
};
Ok(CompositeConnectorRequest::Connect {composite_protocol: req.composite_protocol,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <CompositeConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum CompositeConnectorRequest {
Connect {
composite_protocol: fidl::endpoints::ServerEnd<CompositeMarker>,
control_handle: CompositeConnectorControlHandle,
},
}
impl CompositeConnectorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_connect(
self,
) -> Option<(fidl::endpoints::ServerEnd<CompositeMarker>, CompositeConnectorControlHandle)>
{
if let CompositeConnectorRequest::Connect { composite_protocol, control_handle } = self {
Some((composite_protocol, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
CompositeConnectorRequest::Connect { .. } => "connect",
}
}
}
#[derive(Debug, Clone)]
pub struct CompositeConnectorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for CompositeConnectorControlHandle {
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 CompositeConnectorControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DaiMarker;
impl fidl::endpoints::ProtocolMarker for DaiMarker {
type Proxy = DaiProxy;
type RequestStream = DaiRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DaiSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Dai";
}
pub type DaiGetDaiFormatsResult = Result<Vec<DaiSupportedFormats>, i32>;
pub type DaiGetRingBufferFormatsResult = Result<Vec<SupportedFormats>, i32>;
pub trait DaiProxyInterface: Send + Sync {
type GetHealthStateResponseFut: std::future::Future<Output = Result<HealthState, fidl::Error>>
+ Send;
fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut;
fn r#signal_processing_connect(
&self,
protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
) -> Result<(), fidl::Error>;
type ResetResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#reset(&self) -> Self::ResetResponseFut;
type GetPropertiesResponseFut: std::future::Future<Output = Result<DaiProperties, fidl::Error>>
+ Send;
fn r#get_properties(&self) -> Self::GetPropertiesResponseFut;
type GetDaiFormatsResponseFut: std::future::Future<Output = Result<DaiGetDaiFormatsResult, fidl::Error>>
+ Send;
fn r#get_dai_formats(&self) -> Self::GetDaiFormatsResponseFut;
type GetRingBufferFormatsResponseFut: std::future::Future<Output = Result<DaiGetRingBufferFormatsResult, fidl::Error>>
+ Send;
fn r#get_ring_buffer_formats(&self) -> Self::GetRingBufferFormatsResponseFut;
fn r#create_ring_buffer(
&self,
dai_format: &DaiFormat,
ring_buffer_format: &Format,
ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DaiSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DaiSynchronousProxy {
type Proxy = DaiProxy;
type Protocol = DaiMarker;
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 DaiSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DaiMarker 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<DaiEvent, fidl::Error> {
DaiEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_health_state(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<HealthState, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, HealthGetHealthStateResponse>(
(),
0x4e146d6bca733a84,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.state)
}
pub fn r#signal_processing_connect(
&self,
mut protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(
(protocol,),
0xa81907ce6066295,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#reset(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
(),
0x69e5fa9fa2f78c14,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#get_properties(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<DaiProperties, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, DaiGetPropertiesResponse>(
(),
0x2c25a1a66149510b,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.properties)
}
pub fn r#get_dai_formats(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<DaiGetDaiFormatsResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<DaiGetDaiFormatsResponse, i32>,
>(
(),
0x1eb37b0cddf79d69,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.dai_formats))
}
pub fn r#get_ring_buffer_formats(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<DaiGetRingBufferFormatsResult, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::ResultType<DaiGetRingBufferFormatsResponse, i32>,
>(
(),
0x760371081d8c92e4,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.ring_buffer_formats))
}
pub fn r#create_ring_buffer(
&self,
mut dai_format: &DaiFormat,
mut ring_buffer_format: &Format,
mut ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DaiCreateRingBufferRequest>(
(dai_format, ring_buffer_format, ring_buffer),
0x5af9760589a75257,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct DaiProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DaiProxy {
type Protocol = DaiMarker;
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 DaiProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <DaiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DaiEventStream {
DaiEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_health_state(
&self,
) -> fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>
{
DaiProxyInterface::r#get_health_state(self)
}
pub fn r#signal_processing_connect(
&self,
mut protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
) -> Result<(), fidl::Error> {
DaiProxyInterface::r#signal_processing_connect(self, protocol)
}
pub fn r#reset(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
DaiProxyInterface::r#reset(self)
}
pub fn r#get_properties(
&self,
) -> fidl::client::QueryResponseFut<DaiProperties, fidl::encoding::DefaultFuchsiaResourceDialect>
{
DaiProxyInterface::r#get_properties(self)
}
pub fn r#get_dai_formats(
&self,
) -> fidl::client::QueryResponseFut<
DaiGetDaiFormatsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DaiProxyInterface::r#get_dai_formats(self)
}
pub fn r#get_ring_buffer_formats(
&self,
) -> fidl::client::QueryResponseFut<
DaiGetRingBufferFormatsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
DaiProxyInterface::r#get_ring_buffer_formats(self)
}
pub fn r#create_ring_buffer(
&self,
mut dai_format: &DaiFormat,
mut ring_buffer_format: &Format,
mut ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
) -> Result<(), fidl::Error> {
DaiProxyInterface::r#create_ring_buffer(self, dai_format, ring_buffer_format, ring_buffer)
}
}
impl DaiProxyInterface for DaiProxy {
type GetHealthStateResponseFut =
fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<HealthState, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
HealthGetHealthStateResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4e146d6bca733a84,
>(_buf?)?;
Ok(_response.state)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, HealthState>(
(),
0x4e146d6bca733a84,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#signal_processing_connect(
&self,
mut protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(
(protocol,),
0xa81907ce6066295,
fidl::encoding::DynamicFlags::empty(),
)
}
type ResetResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#reset(&self) -> Self::ResetResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x69e5fa9fa2f78c14,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x69e5fa9fa2f78c14,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetPropertiesResponseFut = fidl::client::QueryResponseFut<
DaiProperties,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_properties(&self) -> Self::GetPropertiesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DaiProperties, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
DaiGetPropertiesResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x2c25a1a66149510b,
>(_buf?)?;
Ok(_response.properties)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, DaiProperties>(
(),
0x2c25a1a66149510b,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetDaiFormatsResponseFut = fidl::client::QueryResponseFut<
DaiGetDaiFormatsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_dai_formats(&self) -> Self::GetDaiFormatsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DaiGetDaiFormatsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DaiGetDaiFormatsResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x1eb37b0cddf79d69,
>(_buf?)?;
Ok(_response.map(|x| x.dai_formats))
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, DaiGetDaiFormatsResult>(
(),
0x1eb37b0cddf79d69,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetRingBufferFormatsResponseFut = fidl::client::QueryResponseFut<
DaiGetRingBufferFormatsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_ring_buffer_formats(&self) -> Self::GetRingBufferFormatsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DaiGetRingBufferFormatsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<DaiGetRingBufferFormatsResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x760371081d8c92e4,
>(_buf?)?;
Ok(_response.map(|x| x.ring_buffer_formats))
}
self.client
.send_query_and_decode::<fidl::encoding::EmptyPayload, DaiGetRingBufferFormatsResult>(
(),
0x760371081d8c92e4,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#create_ring_buffer(
&self,
mut dai_format: &DaiFormat,
mut ring_buffer_format: &Format,
mut ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DaiCreateRingBufferRequest>(
(dai_format, ring_buffer_format, ring_buffer),
0x5af9760589a75257,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct DaiEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DaiEventStream {}
impl futures::stream::FusedStream for DaiEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DaiEventStream {
type Item = Result<DaiEvent, 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(DaiEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DaiEvent {}
impl DaiEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DaiEvent, 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: <DaiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DaiRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DaiRequestStream {}
impl futures::stream::FusedStream for DaiRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DaiRequestStream {
type Protocol = DaiMarker;
type ControlHandle = DaiControlHandle;
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 {
DaiControlHandle { 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 DaiRequestStream {
type Item = Result<DaiRequest, 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 DaiRequestStream 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 {
0x4e146d6bca733a84 => {
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 = DaiControlHandle { inner: this.inner.clone() };
Ok(DaiRequest::GetHealthState {
responder: DaiGetHealthStateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xa81907ce6066295 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DaiControlHandle { inner: this.inner.clone() };
Ok(DaiRequest::SignalProcessingConnect {
protocol: req.protocol,
control_handle,
})
}
0x69e5fa9fa2f78c14 => {
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 = DaiControlHandle { inner: this.inner.clone() };
Ok(DaiRequest::Reset {
responder: DaiResetResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2c25a1a66149510b => {
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 = DaiControlHandle { inner: this.inner.clone() };
Ok(DaiRequest::GetProperties {
responder: DaiGetPropertiesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x1eb37b0cddf79d69 => {
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 = DaiControlHandle { inner: this.inner.clone() };
Ok(DaiRequest::GetDaiFormats {
responder: DaiGetDaiFormatsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x760371081d8c92e4 => {
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 = DaiControlHandle { inner: this.inner.clone() };
Ok(DaiRequest::GetRingBufferFormats {
responder: DaiGetRingBufferFormatsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5af9760589a75257 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
DaiCreateRingBufferRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DaiCreateRingBufferRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = DaiControlHandle { inner: this.inner.clone() };
Ok(DaiRequest::CreateRingBuffer {
dai_format: req.dai_format,
ring_buffer_format: req.ring_buffer_format,
ring_buffer: req.ring_buffer,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <DaiMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DaiRequest {
GetHealthState { responder: DaiGetHealthStateResponder },
SignalProcessingConnect {
protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
control_handle: DaiControlHandle,
},
Reset { responder: DaiResetResponder },
GetProperties { responder: DaiGetPropertiesResponder },
GetDaiFormats { responder: DaiGetDaiFormatsResponder },
GetRingBufferFormats { responder: DaiGetRingBufferFormatsResponder },
CreateRingBuffer {
dai_format: DaiFormat,
ring_buffer_format: Format,
ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
control_handle: DaiControlHandle,
},
}
impl DaiRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_health_state(self) -> Option<(DaiGetHealthStateResponder)> {
if let DaiRequest::GetHealthState { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_signal_processing_connect(
self,
) -> Option<(
fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
DaiControlHandle,
)> {
if let DaiRequest::SignalProcessingConnect { protocol, control_handle } = self {
Some((protocol, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_reset(self) -> Option<(DaiResetResponder)> {
if let DaiRequest::Reset { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_properties(self) -> Option<(DaiGetPropertiesResponder)> {
if let DaiRequest::GetProperties { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_dai_formats(self) -> Option<(DaiGetDaiFormatsResponder)> {
if let DaiRequest::GetDaiFormats { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_ring_buffer_formats(self) -> Option<(DaiGetRingBufferFormatsResponder)> {
if let DaiRequest::GetRingBufferFormats { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_create_ring_buffer(
self,
) -> Option<(DaiFormat, Format, fidl::endpoints::ServerEnd<RingBufferMarker>, DaiControlHandle)>
{
if let DaiRequest::CreateRingBuffer {
dai_format,
ring_buffer_format,
ring_buffer,
control_handle,
} = self
{
Some((dai_format, ring_buffer_format, ring_buffer, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DaiRequest::GetHealthState { .. } => "get_health_state",
DaiRequest::SignalProcessingConnect { .. } => "signal_processing_connect",
DaiRequest::Reset { .. } => "reset",
DaiRequest::GetProperties { .. } => "get_properties",
DaiRequest::GetDaiFormats { .. } => "get_dai_formats",
DaiRequest::GetRingBufferFormats { .. } => "get_ring_buffer_formats",
DaiRequest::CreateRingBuffer { .. } => "create_ring_buffer",
}
}
}
#[derive(Debug, Clone)]
pub struct DaiControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DaiControlHandle {
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 DaiControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DaiGetHealthStateResponder {
control_handle: std::mem::ManuallyDrop<DaiControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DaiGetHealthStateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DaiGetHealthStateResponder {
type ControlHandle = DaiControlHandle;
fn control_handle(&self) -> &DaiControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DaiGetHealthStateResponder {
pub fn send(self, mut state: &HealthState) -> Result<(), fidl::Error> {
let _result = self.send_raw(state);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut state: &HealthState) -> Result<(), fidl::Error> {
let _result = self.send_raw(state);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut state: &HealthState) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<HealthGetHealthStateResponse>(
(state,),
self.tx_id,
0x4e146d6bca733a84,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DaiResetResponder {
control_handle: std::mem::ManuallyDrop<DaiControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DaiResetResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DaiResetResponder {
type ControlHandle = DaiControlHandle;
fn control_handle(&self) -> &DaiControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DaiResetResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x69e5fa9fa2f78c14,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DaiGetPropertiesResponder {
control_handle: std::mem::ManuallyDrop<DaiControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DaiGetPropertiesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DaiGetPropertiesResponder {
type ControlHandle = DaiControlHandle;
fn control_handle(&self) -> &DaiControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DaiGetPropertiesResponder {
pub fn send(self, mut properties: &DaiProperties) -> Result<(), fidl::Error> {
let _result = self.send_raw(properties);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut properties: &DaiProperties,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(properties);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut properties: &DaiProperties) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<DaiGetPropertiesResponse>(
(properties,),
self.tx_id,
0x2c25a1a66149510b,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DaiGetDaiFormatsResponder {
control_handle: std::mem::ManuallyDrop<DaiControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DaiGetDaiFormatsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DaiGetDaiFormatsResponder {
type ControlHandle = DaiControlHandle;
fn control_handle(&self) -> &DaiControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DaiGetDaiFormatsResponder {
pub fn send(self, mut result: Result<&[DaiSupportedFormats], 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<&[DaiSupportedFormats], i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&[DaiSupportedFormats], i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<DaiGetDaiFormatsResponse, i32>>(
result.map(|dai_formats| (dai_formats,)),
self.tx_id,
0x1eb37b0cddf79d69,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct DaiGetRingBufferFormatsResponder {
control_handle: std::mem::ManuallyDrop<DaiControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for DaiGetRingBufferFormatsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for DaiGetRingBufferFormatsResponder {
type ControlHandle = DaiControlHandle;
fn control_handle(&self) -> &DaiControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl DaiGetRingBufferFormatsResponder {
pub fn send(self, mut result: Result<&[SupportedFormats], 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<&[SupportedFormats], i32>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<&[SupportedFormats], i32>) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<DaiGetRingBufferFormatsResponse, i32>>(
result.map(|ring_buffer_formats| (ring_buffer_formats,)),
self.tx_id,
0x760371081d8c92e4,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DaiConnectorMarker;
impl fidl::endpoints::ProtocolMarker for DaiConnectorMarker {
type Proxy = DaiConnectorProxy;
type RequestStream = DaiConnectorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = DaiConnectorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) DaiConnector";
}
pub trait DaiConnectorProxyInterface: Send + Sync {
fn r#connect(
&self,
dai_protocol: fidl::endpoints::ServerEnd<DaiMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct DaiConnectorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for DaiConnectorSynchronousProxy {
type Proxy = DaiConnectorProxy;
type Protocol = DaiConnectorMarker;
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 DaiConnectorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <DaiConnectorMarker 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<DaiConnectorEvent, fidl::Error> {
DaiConnectorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#connect(
&self,
mut dai_protocol: fidl::endpoints::ServerEnd<DaiMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DaiConnectorConnectRequest>(
(dai_protocol,),
0x4e4db05c2eca1450,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct DaiConnectorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for DaiConnectorProxy {
type Protocol = DaiConnectorMarker;
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 DaiConnectorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <DaiConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> DaiConnectorEventStream {
DaiConnectorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#connect(
&self,
mut dai_protocol: fidl::endpoints::ServerEnd<DaiMarker>,
) -> Result<(), fidl::Error> {
DaiConnectorProxyInterface::r#connect(self, dai_protocol)
}
}
impl DaiConnectorProxyInterface for DaiConnectorProxy {
fn r#connect(
&self,
mut dai_protocol: fidl::endpoints::ServerEnd<DaiMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<DaiConnectorConnectRequest>(
(dai_protocol,),
0x4e4db05c2eca1450,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct DaiConnectorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for DaiConnectorEventStream {}
impl futures::stream::FusedStream for DaiConnectorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for DaiConnectorEventStream {
type Item = Result<DaiConnectorEvent, 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(DaiConnectorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum DaiConnectorEvent {}
impl DaiConnectorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<DaiConnectorEvent, 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: <DaiConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct DaiConnectorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for DaiConnectorRequestStream {}
impl futures::stream::FusedStream for DaiConnectorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for DaiConnectorRequestStream {
type Protocol = DaiConnectorMarker;
type ControlHandle = DaiConnectorControlHandle;
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 {
DaiConnectorControlHandle { 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 DaiConnectorRequestStream {
type Item = Result<DaiConnectorRequest, 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 DaiConnectorRequestStream 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 {
0x4e4db05c2eca1450 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
DaiConnectorConnectRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<DaiConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
DaiConnectorControlHandle { inner: this.inner.clone() };
Ok(DaiConnectorRequest::Connect {
dai_protocol: req.dai_protocol,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<DaiConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum DaiConnectorRequest {
Connect {
dai_protocol: fidl::endpoints::ServerEnd<DaiMarker>,
control_handle: DaiConnectorControlHandle,
},
}
impl DaiConnectorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_connect(
self,
) -> Option<(fidl::endpoints::ServerEnd<DaiMarker>, DaiConnectorControlHandle)> {
if let DaiConnectorRequest::Connect { dai_protocol, control_handle } = self {
Some((dai_protocol, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
DaiConnectorRequest::Connect { .. } => "connect",
}
}
}
#[derive(Debug, Clone)]
pub struct DaiConnectorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for DaiConnectorControlHandle {
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 DaiConnectorControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct HealthMarker;
impl fidl::endpoints::ProtocolMarker for HealthMarker {
type Proxy = HealthProxy;
type RequestStream = HealthRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = HealthSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) Health";
}
pub trait HealthProxyInterface: Send + Sync {
type GetHealthStateResponseFut: std::future::Future<Output = Result<HealthState, fidl::Error>>
+ Send;
fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct HealthSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for HealthSynchronousProxy {
type Proxy = HealthProxy;
type Protocol = HealthMarker;
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 HealthSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <HealthMarker 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<HealthEvent, fidl::Error> {
HealthEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_health_state(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<HealthState, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, HealthGetHealthStateResponse>(
(),
0x4e146d6bca733a84,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.state)
}
}
#[derive(Debug, Clone)]
pub struct HealthProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for HealthProxy {
type Protocol = HealthMarker;
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 HealthProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <HealthMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> HealthEventStream {
HealthEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_health_state(
&self,
) -> fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>
{
HealthProxyInterface::r#get_health_state(self)
}
}
impl HealthProxyInterface for HealthProxy {
type GetHealthStateResponseFut =
fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<HealthState, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
HealthGetHealthStateResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4e146d6bca733a84,
>(_buf?)?;
Ok(_response.state)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, HealthState>(
(),
0x4e146d6bca733a84,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct HealthEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for HealthEventStream {}
impl futures::stream::FusedStream for HealthEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for HealthEventStream {
type Item = Result<HealthEvent, 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(HealthEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum HealthEvent {}
impl HealthEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<HealthEvent, 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: <HealthMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct HealthRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for HealthRequestStream {}
impl futures::stream::FusedStream for HealthRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for HealthRequestStream {
type Protocol = HealthMarker;
type ControlHandle = HealthControlHandle;
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 {
HealthControlHandle { 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 HealthRequestStream {
type Item = Result<HealthRequest, 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 HealthRequestStream 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 {
0x4e146d6bca733a84 => {
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 = HealthControlHandle { inner: this.inner.clone() };
Ok(HealthRequest::GetHealthState {
responder: HealthGetHealthStateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<HealthMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum HealthRequest {
GetHealthState { responder: HealthGetHealthStateResponder },
}
impl HealthRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_health_state(self) -> Option<(HealthGetHealthStateResponder)> {
if let HealthRequest::GetHealthState { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
HealthRequest::GetHealthState { .. } => "get_health_state",
}
}
}
#[derive(Debug, Clone)]
pub struct HealthControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for HealthControlHandle {
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 HealthControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct HealthGetHealthStateResponder {
control_handle: std::mem::ManuallyDrop<HealthControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for HealthGetHealthStateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for HealthGetHealthStateResponder {
type ControlHandle = HealthControlHandle;
fn control_handle(&self) -> &HealthControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl HealthGetHealthStateResponder {
pub fn send(self, mut state: &HealthState) -> Result<(), fidl::Error> {
let _result = self.send_raw(state);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut state: &HealthState) -> Result<(), fidl::Error> {
let _result = self.send_raw(state);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut state: &HealthState) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<HealthGetHealthStateResponse>(
(state,),
self.tx_id,
0x4e146d6bca733a84,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RingBufferMarker;
impl fidl::endpoints::ProtocolMarker for RingBufferMarker {
type Proxy = RingBufferProxy;
type RequestStream = RingBufferRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = RingBufferSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) RingBuffer";
}
pub type RingBufferGetVmoResult = Result<(u32, fidl::Vmo), GetVmoError>;
pub type RingBufferSetActiveChannelsResult = Result<i64, i32>;
pub trait RingBufferProxyInterface: Send + Sync {
type GetPropertiesResponseFut: std::future::Future<Output = Result<RingBufferProperties, fidl::Error>>
+ Send;
fn r#get_properties(&self) -> Self::GetPropertiesResponseFut;
type WatchClockRecoveryPositionInfoResponseFut: std::future::Future<Output = Result<RingBufferPositionInfo, fidl::Error>>
+ Send;
fn r#watch_clock_recovery_position_info(
&self,
) -> Self::WatchClockRecoveryPositionInfoResponseFut;
type GetVmoResponseFut: std::future::Future<Output = Result<RingBufferGetVmoResult, fidl::Error>>
+ Send;
fn r#get_vmo(
&self,
min_frames: u32,
clock_recovery_notifications_per_ring: u32,
) -> Self::GetVmoResponseFut;
type StartResponseFut: std::future::Future<Output = Result<i64, fidl::Error>> + Send;
fn r#start(&self) -> Self::StartResponseFut;
type StopResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
fn r#stop(&self) -> Self::StopResponseFut;
type SetActiveChannelsResponseFut: std::future::Future<Output = Result<RingBufferSetActiveChannelsResult, fidl::Error>>
+ Send;
fn r#set_active_channels(
&self,
active_channels_bitmask: u64,
) -> Self::SetActiveChannelsResponseFut;
type WatchDelayInfoResponseFut: std::future::Future<Output = Result<DelayInfo, fidl::Error>>
+ Send;
fn r#watch_delay_info(&self) -> Self::WatchDelayInfoResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct RingBufferSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for RingBufferSynchronousProxy {
type Proxy = RingBufferProxy;
type Protocol = RingBufferMarker;
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 RingBufferSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <RingBufferMarker 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<RingBufferEvent, fidl::Error> {
RingBufferEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_properties(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<RingBufferProperties, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, RingBufferGetPropertiesResponse>(
(),
0x12947f061a8fe1,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.properties)
}
pub fn r#watch_clock_recovery_position_info(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<RingBufferPositionInfo, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
RingBufferWatchClockRecoveryPositionInfoResponse,
>(
(),
0x694d5b898a4167e5,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.position_info)
}
pub fn r#get_vmo(
&self,
mut min_frames: u32,
mut clock_recovery_notifications_per_ring: u32,
___deadline: zx::MonotonicInstant,
) -> Result<RingBufferGetVmoResult, fidl::Error> {
let _response = self.client.send_query::<
RingBufferGetVmoRequest,
fidl::encoding::ResultType<RingBufferGetVmoResponse, GetVmoError>,
>(
(min_frames, clock_recovery_notifications_per_ring,),
0x44c8f4f5680e853a,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| (x.num_frames, x.ring_buffer)))
}
pub fn r#start(&self, ___deadline: zx::MonotonicInstant) -> Result<i64, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, RingBufferStartResponse>(
(),
0x5dd780a769a8892d,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.start_time)
}
pub fn r#stop(&self, ___deadline: zx::MonotonicInstant) -> Result<(), fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
(),
0x49a73d9cf1d4e110,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response)
}
pub fn r#set_active_channels(
&self,
mut active_channels_bitmask: u64,
___deadline: zx::MonotonicInstant,
) -> Result<RingBufferSetActiveChannelsResult, fidl::Error> {
let _response = self.client.send_query::<
RingBufferSetActiveChannelsRequest,
fidl::encoding::ResultType<RingBufferSetActiveChannelsResponse, i32>,
>(
(active_channels_bitmask,),
0x605464c1d384f309,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.map(|x| x.set_time))
}
pub fn r#watch_delay_info(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<DelayInfo, fidl::Error> {
let _response = self.client.send_query::<
fidl::encoding::EmptyPayload,
fidl::encoding::FlexibleType<RingBufferWatchDelayInfoResponse>,
>(
(),
0x6c1248db213fcf9f,
fidl::encoding::DynamicFlags::FLEXIBLE,
___deadline,
)?
.into_result::<RingBufferMarker>("watch_delay_info")?;
Ok(_response.delay_info)
}
}
#[derive(Debug, Clone)]
pub struct RingBufferProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for RingBufferProxy {
type Protocol = RingBufferMarker;
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 RingBufferProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <RingBufferMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> RingBufferEventStream {
RingBufferEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_properties(
&self,
) -> fidl::client::QueryResponseFut<
RingBufferProperties,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RingBufferProxyInterface::r#get_properties(self)
}
pub fn r#watch_clock_recovery_position_info(
&self,
) -> fidl::client::QueryResponseFut<
RingBufferPositionInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RingBufferProxyInterface::r#watch_clock_recovery_position_info(self)
}
pub fn r#get_vmo(
&self,
mut min_frames: u32,
mut clock_recovery_notifications_per_ring: u32,
) -> fidl::client::QueryResponseFut<
RingBufferGetVmoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RingBufferProxyInterface::r#get_vmo(self, min_frames, clock_recovery_notifications_per_ring)
}
pub fn r#start(
&self,
) -> fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect> {
RingBufferProxyInterface::r#start(self)
}
pub fn r#stop(
&self,
) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
RingBufferProxyInterface::r#stop(self)
}
pub fn r#set_active_channels(
&self,
mut active_channels_bitmask: u64,
) -> fidl::client::QueryResponseFut<
RingBufferSetActiveChannelsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
RingBufferProxyInterface::r#set_active_channels(self, active_channels_bitmask)
}
pub fn r#watch_delay_info(
&self,
) -> fidl::client::QueryResponseFut<DelayInfo, fidl::encoding::DefaultFuchsiaResourceDialect>
{
RingBufferProxyInterface::r#watch_delay_info(self)
}
}
impl RingBufferProxyInterface for RingBufferProxy {
type GetPropertiesResponseFut = fidl::client::QueryResponseFut<
RingBufferProperties,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_properties(&self) -> Self::GetPropertiesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RingBufferProperties, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
RingBufferGetPropertiesResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x12947f061a8fe1,
>(_buf?)?;
Ok(_response.properties)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, RingBufferProperties>(
(),
0x12947f061a8fe1,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WatchClockRecoveryPositionInfoResponseFut = fidl::client::QueryResponseFut<
RingBufferPositionInfo,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#watch_clock_recovery_position_info(
&self,
) -> Self::WatchClockRecoveryPositionInfoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RingBufferPositionInfo, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
RingBufferWatchClockRecoveryPositionInfoResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x694d5b898a4167e5,
>(_buf?)?;
Ok(_response.position_info)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, RingBufferPositionInfo>(
(),
0x694d5b898a4167e5,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetVmoResponseFut = fidl::client::QueryResponseFut<
RingBufferGetVmoResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_vmo(
&self,
mut min_frames: u32,
mut clock_recovery_notifications_per_ring: u32,
) -> Self::GetVmoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RingBufferGetVmoResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<RingBufferGetVmoResponse, GetVmoError>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x44c8f4f5680e853a,
>(_buf?)?;
Ok(_response.map(|x| (x.num_frames, x.ring_buffer)))
}
self.client.send_query_and_decode::<RingBufferGetVmoRequest, RingBufferGetVmoResult>(
(min_frames, clock_recovery_notifications_per_ring),
0x44c8f4f5680e853a,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StartResponseFut =
fidl::client::QueryResponseFut<i64, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#start(&self) -> Self::StartResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<i64, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
RingBufferStartResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x5dd780a769a8892d,
>(_buf?)?;
Ok(_response.start_time)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, i64>(
(),
0x5dd780a769a8892d,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type StopResponseFut =
fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#stop(&self) -> Self::StopResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<(), fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::EmptyPayload,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x49a73d9cf1d4e110,
>(_buf?)?;
Ok(_response)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
(),
0x49a73d9cf1d4e110,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type SetActiveChannelsResponseFut = fidl::client::QueryResponseFut<
RingBufferSetActiveChannelsResult,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#set_active_channels(
&self,
mut active_channels_bitmask: u64,
) -> Self::SetActiveChannelsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<RingBufferSetActiveChannelsResult, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::ResultType<RingBufferSetActiveChannelsResponse, i32>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x605464c1d384f309,
>(_buf?)?;
Ok(_response.map(|x| x.set_time))
}
self.client.send_query_and_decode::<
RingBufferSetActiveChannelsRequest,
RingBufferSetActiveChannelsResult,
>(
(active_channels_bitmask,),
0x605464c1d384f309,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type WatchDelayInfoResponseFut =
fidl::client::QueryResponseFut<DelayInfo, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#watch_delay_info(&self) -> Self::WatchDelayInfoResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<DelayInfo, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
fidl::encoding::FlexibleType<RingBufferWatchDelayInfoResponse>,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x6c1248db213fcf9f,
>(_buf?)?
.into_result::<RingBufferMarker>("watch_delay_info")?;
Ok(_response.delay_info)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, DelayInfo>(
(),
0x6c1248db213fcf9f,
fidl::encoding::DynamicFlags::FLEXIBLE,
_decode,
)
}
}
pub struct RingBufferEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for RingBufferEventStream {}
impl futures::stream::FusedStream for RingBufferEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for RingBufferEventStream {
type Item = Result<RingBufferEvent, 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(RingBufferEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum RingBufferEvent {
#[non_exhaustive]
_UnknownEvent {
ordinal: u64,
},
}
impl RingBufferEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<RingBufferEvent, 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 {
_ if tx_header.dynamic_flags().contains(fidl::encoding::DynamicFlags::FLEXIBLE) => {
Ok(RingBufferEvent::_UnknownEvent { ordinal: tx_header.ordinal })
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: tx_header.ordinal,
protocol_name: <RingBufferMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct RingBufferRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for RingBufferRequestStream {}
impl futures::stream::FusedStream for RingBufferRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for RingBufferRequestStream {
type Protocol = RingBufferMarker;
type ControlHandle = RingBufferControlHandle;
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 {
RingBufferControlHandle { 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 RingBufferRequestStream {
type Item = Result<RingBufferRequest, 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 RingBufferRequestStream 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 {
0x12947f061a8fe1 => {
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 = RingBufferControlHandle { inner: this.inner.clone() };
Ok(RingBufferRequest::GetProperties {
responder: RingBufferGetPropertiesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x694d5b898a4167e5 => {
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 = RingBufferControlHandle { inner: this.inner.clone() };
Ok(RingBufferRequest::WatchClockRecoveryPositionInfo {
responder: RingBufferWatchClockRecoveryPositionInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x44c8f4f5680e853a => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RingBufferGetVmoRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RingBufferGetVmoRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = RingBufferControlHandle { inner: this.inner.clone() };
Ok(RingBufferRequest::GetVmo {
min_frames: req.min_frames,
clock_recovery_notifications_per_ring: req
.clock_recovery_notifications_per_ring,
responder: RingBufferGetVmoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x5dd780a769a8892d => {
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 = RingBufferControlHandle { inner: this.inner.clone() };
Ok(RingBufferRequest::Start {
responder: RingBufferStartResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x49a73d9cf1d4e110 => {
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 = RingBufferControlHandle { inner: this.inner.clone() };
Ok(RingBufferRequest::Stop {
responder: RingBufferStopResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x605464c1d384f309 => {
header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
let mut req = fidl::new_empty!(
RingBufferSetActiveChannelsRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<RingBufferSetActiveChannelsRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = RingBufferControlHandle { inner: this.inner.clone() };
Ok(RingBufferRequest::SetActiveChannels {
active_channels_bitmask: req.active_channels_bitmask,
responder: RingBufferSetActiveChannelsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x6c1248db213fcf9f => {
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 = RingBufferControlHandle { inner: this.inner.clone() };
Ok(RingBufferRequest::WatchDelayInfo {
responder: RingBufferWatchDelayInfoResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ if header.tx_id == 0
&& header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
Ok(RingBufferRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: RingBufferControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::OneWay,
})
}
_ if header
.dynamic_flags()
.contains(fidl::encoding::DynamicFlags::FLEXIBLE) =>
{
this.inner.send_framework_err(
fidl::encoding::FrameworkErr::UnknownMethod,
header.tx_id,
header.ordinal,
header.dynamic_flags(),
(bytes, handles),
)?;
Ok(RingBufferRequest::_UnknownMethod {
ordinal: header.ordinal,
control_handle: RingBufferControlHandle { inner: this.inner.clone() },
method_type: fidl::MethodType::TwoWay,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<RingBufferMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum RingBufferRequest {
GetProperties { responder: RingBufferGetPropertiesResponder },
WatchClockRecoveryPositionInfo { responder: RingBufferWatchClockRecoveryPositionInfoResponder },
GetVmo {
min_frames: u32,
clock_recovery_notifications_per_ring: u32,
responder: RingBufferGetVmoResponder,
},
Start { responder: RingBufferStartResponder },
Stop { responder: RingBufferStopResponder },
SetActiveChannels {
active_channels_bitmask: u64,
responder: RingBufferSetActiveChannelsResponder,
},
WatchDelayInfo { responder: RingBufferWatchDelayInfoResponder },
#[non_exhaustive]
_UnknownMethod {
ordinal: u64,
control_handle: RingBufferControlHandle,
method_type: fidl::MethodType,
},
}
impl RingBufferRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_properties(self) -> Option<(RingBufferGetPropertiesResponder)> {
if let RingBufferRequest::GetProperties { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_watch_clock_recovery_position_info(
self,
) -> Option<(RingBufferWatchClockRecoveryPositionInfoResponder)> {
if let RingBufferRequest::WatchClockRecoveryPositionInfo { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_vmo(self) -> Option<(u32, u32, RingBufferGetVmoResponder)> {
if let RingBufferRequest::GetVmo {
min_frames,
clock_recovery_notifications_per_ring,
responder,
} = self
{
Some((min_frames, clock_recovery_notifications_per_ring, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_start(self) -> Option<(RingBufferStartResponder)> {
if let RingBufferRequest::Start { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_stop(self) -> Option<(RingBufferStopResponder)> {
if let RingBufferRequest::Stop { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_active_channels(self) -> Option<(u64, RingBufferSetActiveChannelsResponder)> {
if let RingBufferRequest::SetActiveChannels { active_channels_bitmask, responder } = self {
Some((active_channels_bitmask, responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_watch_delay_info(self) -> Option<(RingBufferWatchDelayInfoResponder)> {
if let RingBufferRequest::WatchDelayInfo { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
RingBufferRequest::GetProperties { .. } => "get_properties",
RingBufferRequest::WatchClockRecoveryPositionInfo { .. } => {
"watch_clock_recovery_position_info"
}
RingBufferRequest::GetVmo { .. } => "get_vmo",
RingBufferRequest::Start { .. } => "start",
RingBufferRequest::Stop { .. } => "stop",
RingBufferRequest::SetActiveChannels { .. } => "set_active_channels",
RingBufferRequest::WatchDelayInfo { .. } => "watch_delay_info",
RingBufferRequest::_UnknownMethod { method_type: fidl::MethodType::OneWay, .. } => {
"unknown one-way method"
}
RingBufferRequest::_UnknownMethod { method_type: fidl::MethodType::TwoWay, .. } => {
"unknown two-way method"
}
}
}
}
#[derive(Debug, Clone)]
pub struct RingBufferControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for RingBufferControlHandle {
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 RingBufferControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RingBufferGetPropertiesResponder {
control_handle: std::mem::ManuallyDrop<RingBufferControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RingBufferGetPropertiesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RingBufferGetPropertiesResponder {
type ControlHandle = RingBufferControlHandle;
fn control_handle(&self) -> &RingBufferControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RingBufferGetPropertiesResponder {
pub fn send(self, mut properties: &RingBufferProperties) -> Result<(), fidl::Error> {
let _result = self.send_raw(properties);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut properties: &RingBufferProperties,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(properties);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut properties: &RingBufferProperties) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<RingBufferGetPropertiesResponse>(
(properties,),
self.tx_id,
0x12947f061a8fe1,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RingBufferWatchClockRecoveryPositionInfoResponder {
control_handle: std::mem::ManuallyDrop<RingBufferControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RingBufferWatchClockRecoveryPositionInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RingBufferWatchClockRecoveryPositionInfoResponder {
type ControlHandle = RingBufferControlHandle;
fn control_handle(&self) -> &RingBufferControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RingBufferWatchClockRecoveryPositionInfoResponder {
pub fn send(self, mut position_info: &RingBufferPositionInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(position_info);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut position_info: &RingBufferPositionInfo,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(position_info);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut position_info: &RingBufferPositionInfo) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<RingBufferWatchClockRecoveryPositionInfoResponse>(
(position_info,),
self.tx_id,
0x694d5b898a4167e5,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RingBufferGetVmoResponder {
control_handle: std::mem::ManuallyDrop<RingBufferControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RingBufferGetVmoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RingBufferGetVmoResponder {
type ControlHandle = RingBufferControlHandle;
fn control_handle(&self) -> &RingBufferControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RingBufferGetVmoResponder {
pub fn send(
self,
mut result: Result<(u32, fidl::Vmo), GetVmoError>,
) -> 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, fidl::Vmo), GetVmoError>,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(
&self,
mut result: Result<(u32, fidl::Vmo), GetVmoError>,
) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::ResultType<RingBufferGetVmoResponse, GetVmoError>>(
result,
self.tx_id,
0x44c8f4f5680e853a,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RingBufferStartResponder {
control_handle: std::mem::ManuallyDrop<RingBufferControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RingBufferStartResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RingBufferStartResponder {
type ControlHandle = RingBufferControlHandle;
fn control_handle(&self) -> &RingBufferControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RingBufferStartResponder {
pub fn send(self, mut start_time: i64) -> Result<(), fidl::Error> {
let _result = self.send_raw(start_time);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut start_time: i64) -> Result<(), fidl::Error> {
let _result = self.send_raw(start_time);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut start_time: i64) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<RingBufferStartResponse>(
(start_time,),
self.tx_id,
0x5dd780a769a8892d,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RingBufferStopResponder {
control_handle: std::mem::ManuallyDrop<RingBufferControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RingBufferStopResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RingBufferStopResponder {
type ControlHandle = RingBufferControlHandle;
fn control_handle(&self) -> &RingBufferControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RingBufferStopResponder {
pub fn send(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
let _result = self.send_raw();
self.drop_without_shutdown();
_result
}
fn send_raw(&self) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
(),
self.tx_id,
0x49a73d9cf1d4e110,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RingBufferSetActiveChannelsResponder {
control_handle: std::mem::ManuallyDrop<RingBufferControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RingBufferSetActiveChannelsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RingBufferSetActiveChannelsResponder {
type ControlHandle = RingBufferControlHandle;
fn control_handle(&self) -> &RingBufferControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RingBufferSetActiveChannelsResponder {
pub fn send(self, mut result: Result<i64, 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<i64, i32>) -> Result<(), fidl::Error> {
let _result = self.send_raw(result);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut result: Result<i64, i32>) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<fidl::encoding::ResultType<
RingBufferSetActiveChannelsResponse,
i32,
>>(
result.map(|set_time| (set_time,)),
self.tx_id,
0x605464c1d384f309,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct RingBufferWatchDelayInfoResponder {
control_handle: std::mem::ManuallyDrop<RingBufferControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for RingBufferWatchDelayInfoResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for RingBufferWatchDelayInfoResponder {
type ControlHandle = RingBufferControlHandle;
fn control_handle(&self) -> &RingBufferControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl RingBufferWatchDelayInfoResponder {
pub fn send(self, mut delay_info: &DelayInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(delay_info);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut delay_info: &DelayInfo) -> Result<(), fidl::Error> {
let _result = self.send_raw(delay_info);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut delay_info: &DelayInfo) -> Result<(), fidl::Error> {
self.control_handle
.inner
.send::<fidl::encoding::FlexibleType<RingBufferWatchDelayInfoResponse>>(
fidl::encoding::Flexible::new((delay_info,)),
self.tx_id,
0x6c1248db213fcf9f,
fidl::encoding::DynamicFlags::FLEXIBLE,
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct StreamConfigMarker;
impl fidl::endpoints::ProtocolMarker for StreamConfigMarker {
type Proxy = StreamConfigProxy;
type RequestStream = StreamConfigRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = StreamConfigSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) StreamConfig";
}
pub trait StreamConfigProxyInterface: Send + Sync {
type GetHealthStateResponseFut: std::future::Future<Output = Result<HealthState, fidl::Error>>
+ Send;
fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut;
fn r#signal_processing_connect(
&self,
protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
) -> Result<(), fidl::Error>;
type GetPropertiesResponseFut: std::future::Future<Output = Result<StreamProperties, fidl::Error>>
+ Send;
fn r#get_properties(&self) -> Self::GetPropertiesResponseFut;
type GetSupportedFormatsResponseFut: std::future::Future<Output = Result<Vec<SupportedFormats>, fidl::Error>>
+ Send;
fn r#get_supported_formats(&self) -> Self::GetSupportedFormatsResponseFut;
fn r#create_ring_buffer(
&self,
format: &Format,
ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
) -> Result<(), fidl::Error>;
type WatchGainStateResponseFut: std::future::Future<Output = Result<GainState, fidl::Error>>
+ Send;
fn r#watch_gain_state(&self) -> Self::WatchGainStateResponseFut;
fn r#set_gain(&self, target_state: &GainState) -> Result<(), fidl::Error>;
type WatchPlugStateResponseFut: std::future::Future<Output = Result<PlugState, fidl::Error>>
+ Send;
fn r#watch_plug_state(&self) -> Self::WatchPlugStateResponseFut;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct StreamConfigSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for StreamConfigSynchronousProxy {
type Proxy = StreamConfigProxy;
type Protocol = StreamConfigMarker;
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 StreamConfigSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name = <StreamConfigMarker 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<StreamConfigEvent, fidl::Error> {
StreamConfigEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#get_health_state(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<HealthState, fidl::Error> {
let _response =
self.client.send_query::<fidl::encoding::EmptyPayload, HealthGetHealthStateResponse>(
(),
0x4e146d6bca733a84,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.state)
}
pub fn r#signal_processing_connect(
&self,
mut protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(
(protocol,),
0xa81907ce6066295,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#get_properties(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<StreamProperties, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, StreamConfigGetPropertiesResponse>(
(),
0x7d89c02f3e2d3c01,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.properties)
}
pub fn r#get_supported_formats(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<Vec<SupportedFormats>, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, StreamConfigGetSupportedFormatsResponse>(
(),
0x448efa7850cafe7e,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.supported_formats)
}
pub fn r#create_ring_buffer(
&self,
mut format: &Format,
mut ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<StreamConfigCreateRingBufferRequest>(
(format, ring_buffer),
0x2afb19dd13faa1ba,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#watch_gain_state(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<GainState, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, StreamConfigWatchGainStateResponse>(
(),
0x4772506136ab65c1,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.gain_state)
}
pub fn r#set_gain(&self, mut target_state: &GainState) -> Result<(), fidl::Error> {
self.client.send::<StreamConfigSetGainRequest>(
(target_state,),
0x3943b41498c6a384,
fidl::encoding::DynamicFlags::empty(),
)
}
pub fn r#watch_plug_state(
&self,
___deadline: zx::MonotonicInstant,
) -> Result<PlugState, fidl::Error> {
let _response = self
.client
.send_query::<fidl::encoding::EmptyPayload, StreamConfigWatchPlugStateResponse>(
(),
0x497345a6f048b2a6,
fidl::encoding::DynamicFlags::empty(),
___deadline,
)?;
Ok(_response.plug_state)
}
}
#[derive(Debug, Clone)]
pub struct StreamConfigProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for StreamConfigProxy {
type Protocol = StreamConfigMarker;
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 StreamConfigProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name = <StreamConfigMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> StreamConfigEventStream {
StreamConfigEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#get_health_state(
&self,
) -> fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>
{
StreamConfigProxyInterface::r#get_health_state(self)
}
pub fn r#signal_processing_connect(
&self,
mut protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
) -> Result<(), fidl::Error> {
StreamConfigProxyInterface::r#signal_processing_connect(self, protocol)
}
pub fn r#get_properties(
&self,
) -> fidl::client::QueryResponseFut<
StreamProperties,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
StreamConfigProxyInterface::r#get_properties(self)
}
pub fn r#get_supported_formats(
&self,
) -> fidl::client::QueryResponseFut<
Vec<SupportedFormats>,
fidl::encoding::DefaultFuchsiaResourceDialect,
> {
StreamConfigProxyInterface::r#get_supported_formats(self)
}
pub fn r#create_ring_buffer(
&self,
mut format: &Format,
mut ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
) -> Result<(), fidl::Error> {
StreamConfigProxyInterface::r#create_ring_buffer(self, format, ring_buffer)
}
pub fn r#watch_gain_state(
&self,
) -> fidl::client::QueryResponseFut<GainState, fidl::encoding::DefaultFuchsiaResourceDialect>
{
StreamConfigProxyInterface::r#watch_gain_state(self)
}
pub fn r#set_gain(&self, mut target_state: &GainState) -> Result<(), fidl::Error> {
StreamConfigProxyInterface::r#set_gain(self, target_state)
}
pub fn r#watch_plug_state(
&self,
) -> fidl::client::QueryResponseFut<PlugState, fidl::encoding::DefaultFuchsiaResourceDialect>
{
StreamConfigProxyInterface::r#watch_plug_state(self)
}
}
impl StreamConfigProxyInterface for StreamConfigProxy {
type GetHealthStateResponseFut =
fidl::client::QueryResponseFut<HealthState, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#get_health_state(&self) -> Self::GetHealthStateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<HealthState, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
HealthGetHealthStateResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4e146d6bca733a84,
>(_buf?)?;
Ok(_response.state)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, HealthState>(
(),
0x4e146d6bca733a84,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#signal_processing_connect(
&self,
mut protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
) -> Result<(), fidl::Error> {
self.client.send::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(
(protocol,),
0xa81907ce6066295,
fidl::encoding::DynamicFlags::empty(),
)
}
type GetPropertiesResponseFut = fidl::client::QueryResponseFut<
StreamProperties,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_properties(&self) -> Self::GetPropertiesResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<StreamProperties, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
StreamConfigGetPropertiesResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x7d89c02f3e2d3c01,
>(_buf?)?;
Ok(_response.properties)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, StreamProperties>(
(),
0x7d89c02f3e2d3c01,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
type GetSupportedFormatsResponseFut = fidl::client::QueryResponseFut<
Vec<SupportedFormats>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>;
fn r#get_supported_formats(&self) -> Self::GetSupportedFormatsResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<Vec<SupportedFormats>, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
StreamConfigGetSupportedFormatsResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x448efa7850cafe7e,
>(_buf?)?;
Ok(_response.supported_formats)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, Vec<SupportedFormats>>(
(),
0x448efa7850cafe7e,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#create_ring_buffer(
&self,
mut format: &Format,
mut ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<StreamConfigCreateRingBufferRequest>(
(format, ring_buffer),
0x2afb19dd13faa1ba,
fidl::encoding::DynamicFlags::empty(),
)
}
type WatchGainStateResponseFut =
fidl::client::QueryResponseFut<GainState, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#watch_gain_state(&self) -> Self::WatchGainStateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<GainState, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
StreamConfigWatchGainStateResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x4772506136ab65c1,
>(_buf?)?;
Ok(_response.gain_state)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, GainState>(
(),
0x4772506136ab65c1,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
fn r#set_gain(&self, mut target_state: &GainState) -> Result<(), fidl::Error> {
self.client.send::<StreamConfigSetGainRequest>(
(target_state,),
0x3943b41498c6a384,
fidl::encoding::DynamicFlags::empty(),
)
}
type WatchPlugStateResponseFut =
fidl::client::QueryResponseFut<PlugState, fidl::encoding::DefaultFuchsiaResourceDialect>;
fn r#watch_plug_state(&self) -> Self::WatchPlugStateResponseFut {
fn _decode(
mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
) -> Result<PlugState, fidl::Error> {
let _response = fidl::client::decode_transaction_body::<
StreamConfigWatchPlugStateResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
0x497345a6f048b2a6,
>(_buf?)?;
Ok(_response.plug_state)
}
self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, PlugState>(
(),
0x497345a6f048b2a6,
fidl::encoding::DynamicFlags::empty(),
_decode,
)
}
}
pub struct StreamConfigEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for StreamConfigEventStream {}
impl futures::stream::FusedStream for StreamConfigEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for StreamConfigEventStream {
type Item = Result<StreamConfigEvent, 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(StreamConfigEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum StreamConfigEvent {}
impl StreamConfigEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<StreamConfigEvent, 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: <StreamConfigMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct StreamConfigRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for StreamConfigRequestStream {}
impl futures::stream::FusedStream for StreamConfigRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for StreamConfigRequestStream {
type Protocol = StreamConfigMarker;
type ControlHandle = StreamConfigControlHandle;
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 {
StreamConfigControlHandle { 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 StreamConfigRequestStream {
type Item = Result<StreamConfigRequest, 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 StreamConfigRequestStream 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 {
0x4e146d6bca733a84 => {
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 =
StreamConfigControlHandle { inner: this.inner.clone() };
Ok(StreamConfigRequest::GetHealthState {
responder: StreamConfigGetHealthStateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0xa81907ce6066295 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl_fuchsia_hardware_audio_signalprocessing::ConnectorSignalProcessingConnectRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
StreamConfigControlHandle { inner: this.inner.clone() };
Ok(StreamConfigRequest::SignalProcessingConnect {
protocol: req.protocol,
control_handle,
})
}
0x7d89c02f3e2d3c01 => {
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 =
StreamConfigControlHandle { inner: this.inner.clone() };
Ok(StreamConfigRequest::GetProperties {
responder: StreamConfigGetPropertiesResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x448efa7850cafe7e => {
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 =
StreamConfigControlHandle { inner: this.inner.clone() };
Ok(StreamConfigRequest::GetSupportedFormats {
responder: StreamConfigGetSupportedFormatsResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x2afb19dd13faa1ba => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
StreamConfigCreateRingBufferRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StreamConfigCreateRingBufferRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
StreamConfigControlHandle { inner: this.inner.clone() };
Ok(StreamConfigRequest::CreateRingBuffer {
format: req.format,
ring_buffer: req.ring_buffer,
control_handle,
})
}
0x4772506136ab65c1 => {
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 =
StreamConfigControlHandle { inner: this.inner.clone() };
Ok(StreamConfigRequest::WatchGainState {
responder: StreamConfigWatchGainStateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
0x3943b41498c6a384 => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(
StreamConfigSetGainRequest,
fidl::encoding::DefaultFuchsiaResourceDialect
);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StreamConfigSetGainRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle =
StreamConfigControlHandle { inner: this.inner.clone() };
Ok(StreamConfigRequest::SetGain {
target_state: req.target_state,
control_handle,
})
}
0x497345a6f048b2a6 => {
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 =
StreamConfigControlHandle { inner: this.inner.clone() };
Ok(StreamConfigRequest::WatchPlugState {
responder: StreamConfigWatchPlugStateResponder {
control_handle: std::mem::ManuallyDrop::new(control_handle),
tx_id: header.tx_id,
},
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name:
<StreamConfigMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum StreamConfigRequest {
GetHealthState { responder: StreamConfigGetHealthStateResponder },
SignalProcessingConnect {
protocol: fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
control_handle: StreamConfigControlHandle,
},
GetProperties { responder: StreamConfigGetPropertiesResponder },
GetSupportedFormats { responder: StreamConfigGetSupportedFormatsResponder },
CreateRingBuffer {
format: Format,
ring_buffer: fidl::endpoints::ServerEnd<RingBufferMarker>,
control_handle: StreamConfigControlHandle,
},
WatchGainState { responder: StreamConfigWatchGainStateResponder },
SetGain { target_state: GainState, control_handle: StreamConfigControlHandle },
WatchPlugState { responder: StreamConfigWatchPlugStateResponder },
}
impl StreamConfigRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_get_health_state(self) -> Option<(StreamConfigGetHealthStateResponder)> {
if let StreamConfigRequest::GetHealthState { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_signal_processing_connect(
self,
) -> Option<(
fidl::endpoints::ServerEnd<
fidl_fuchsia_hardware_audio_signalprocessing::SignalProcessingMarker,
>,
StreamConfigControlHandle,
)> {
if let StreamConfigRequest::SignalProcessingConnect { protocol, control_handle } = self {
Some((protocol, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_properties(self) -> Option<(StreamConfigGetPropertiesResponder)> {
if let StreamConfigRequest::GetProperties { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_get_supported_formats(self) -> Option<(StreamConfigGetSupportedFormatsResponder)> {
if let StreamConfigRequest::GetSupportedFormats { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_create_ring_buffer(
self,
) -> Option<(Format, fidl::endpoints::ServerEnd<RingBufferMarker>, StreamConfigControlHandle)>
{
if let StreamConfigRequest::CreateRingBuffer { format, ring_buffer, control_handle } = self
{
Some((format, ring_buffer, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_watch_gain_state(self) -> Option<(StreamConfigWatchGainStateResponder)> {
if let StreamConfigRequest::WatchGainState { responder } = self {
Some((responder))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_set_gain(self) -> Option<(GainState, StreamConfigControlHandle)> {
if let StreamConfigRequest::SetGain { target_state, control_handle } = self {
Some((target_state, control_handle))
} else {
None
}
}
#[allow(irrefutable_let_patterns)]
pub fn into_watch_plug_state(self) -> Option<(StreamConfigWatchPlugStateResponder)> {
if let StreamConfigRequest::WatchPlugState { responder } = self {
Some((responder))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
StreamConfigRequest::GetHealthState { .. } => "get_health_state",
StreamConfigRequest::SignalProcessingConnect { .. } => "signal_processing_connect",
StreamConfigRequest::GetProperties { .. } => "get_properties",
StreamConfigRequest::GetSupportedFormats { .. } => "get_supported_formats",
StreamConfigRequest::CreateRingBuffer { .. } => "create_ring_buffer",
StreamConfigRequest::WatchGainState { .. } => "watch_gain_state",
StreamConfigRequest::SetGain { .. } => "set_gain",
StreamConfigRequest::WatchPlugState { .. } => "watch_plug_state",
}
}
}
#[derive(Debug, Clone)]
pub struct StreamConfigControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for StreamConfigControlHandle {
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 StreamConfigControlHandle {}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct StreamConfigGetHealthStateResponder {
control_handle: std::mem::ManuallyDrop<StreamConfigControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for StreamConfigGetHealthStateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for StreamConfigGetHealthStateResponder {
type ControlHandle = StreamConfigControlHandle;
fn control_handle(&self) -> &StreamConfigControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl StreamConfigGetHealthStateResponder {
pub fn send(self, mut state: &HealthState) -> Result<(), fidl::Error> {
let _result = self.send_raw(state);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut state: &HealthState) -> Result<(), fidl::Error> {
let _result = self.send_raw(state);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut state: &HealthState) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<HealthGetHealthStateResponse>(
(state,),
self.tx_id,
0x4e146d6bca733a84,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct StreamConfigGetPropertiesResponder {
control_handle: std::mem::ManuallyDrop<StreamConfigControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for StreamConfigGetPropertiesResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for StreamConfigGetPropertiesResponder {
type ControlHandle = StreamConfigControlHandle;
fn control_handle(&self) -> &StreamConfigControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl StreamConfigGetPropertiesResponder {
pub fn send(self, mut properties: &StreamProperties) -> Result<(), fidl::Error> {
let _result = self.send_raw(properties);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut properties: &StreamProperties,
) -> Result<(), fidl::Error> {
let _result = self.send_raw(properties);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut properties: &StreamProperties) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<StreamConfigGetPropertiesResponse>(
(properties,),
self.tx_id,
0x7d89c02f3e2d3c01,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct StreamConfigGetSupportedFormatsResponder {
control_handle: std::mem::ManuallyDrop<StreamConfigControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for StreamConfigGetSupportedFormatsResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for StreamConfigGetSupportedFormatsResponder {
type ControlHandle = StreamConfigControlHandle;
fn control_handle(&self) -> &StreamConfigControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl StreamConfigGetSupportedFormatsResponder {
pub fn send(self, mut supported_formats: &[SupportedFormats]) -> Result<(), fidl::Error> {
let _result = self.send_raw(supported_formats);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(
self,
mut supported_formats: &[SupportedFormats],
) -> Result<(), fidl::Error> {
let _result = self.send_raw(supported_formats);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut supported_formats: &[SupportedFormats]) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<StreamConfigGetSupportedFormatsResponse>(
(supported_formats,),
self.tx_id,
0x448efa7850cafe7e,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct StreamConfigWatchGainStateResponder {
control_handle: std::mem::ManuallyDrop<StreamConfigControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for StreamConfigWatchGainStateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for StreamConfigWatchGainStateResponder {
type ControlHandle = StreamConfigControlHandle;
fn control_handle(&self) -> &StreamConfigControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl StreamConfigWatchGainStateResponder {
pub fn send(self, mut gain_state: &GainState) -> Result<(), fidl::Error> {
let _result = self.send_raw(gain_state);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut gain_state: &GainState) -> Result<(), fidl::Error> {
let _result = self.send_raw(gain_state);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut gain_state: &GainState) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<StreamConfigWatchGainStateResponse>(
(gain_state,),
self.tx_id,
0x4772506136ab65c1,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[must_use = "FIDL methods require a response to be sent"]
#[derive(Debug)]
pub struct StreamConfigWatchPlugStateResponder {
control_handle: std::mem::ManuallyDrop<StreamConfigControlHandle>,
tx_id: u32,
}
impl std::ops::Drop for StreamConfigWatchPlugStateResponder {
fn drop(&mut self) {
self.control_handle.shutdown();
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
}
}
impl fidl::endpoints::Responder for StreamConfigWatchPlugStateResponder {
type ControlHandle = StreamConfigControlHandle;
fn control_handle(&self) -> &StreamConfigControlHandle {
&self.control_handle
}
fn drop_without_shutdown(mut self) {
unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
std::mem::forget(self);
}
}
impl StreamConfigWatchPlugStateResponder {
pub fn send(self, mut plug_state: &PlugState) -> Result<(), fidl::Error> {
let _result = self.send_raw(plug_state);
if _result.is_err() {
self.control_handle.shutdown();
}
self.drop_without_shutdown();
_result
}
pub fn send_no_shutdown_on_err(self, mut plug_state: &PlugState) -> Result<(), fidl::Error> {
let _result = self.send_raw(plug_state);
self.drop_without_shutdown();
_result
}
fn send_raw(&self, mut plug_state: &PlugState) -> Result<(), fidl::Error> {
self.control_handle.inner.send::<StreamConfigWatchPlugStateResponse>(
(plug_state,),
self.tx_id,
0x497345a6f048b2a6,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct StreamConfigConnectorMarker;
impl fidl::endpoints::ProtocolMarker for StreamConfigConnectorMarker {
type Proxy = StreamConfigConnectorProxy;
type RequestStream = StreamConfigConnectorRequestStream;
#[cfg(target_os = "fuchsia")]
type SynchronousProxy = StreamConfigConnectorSynchronousProxy;
const DEBUG_NAME: &'static str = "(anonymous) StreamConfigConnector";
}
pub trait StreamConfigConnectorProxyInterface: Send + Sync {
fn r#connect(
&self,
protocol: fidl::endpoints::ServerEnd<StreamConfigMarker>,
) -> Result<(), fidl::Error>;
}
#[derive(Debug)]
#[cfg(target_os = "fuchsia")]
pub struct StreamConfigConnectorSynchronousProxy {
client: fidl::client::sync::Client,
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::SynchronousProxy for StreamConfigConnectorSynchronousProxy {
type Proxy = StreamConfigConnectorProxy;
type Protocol = StreamConfigConnectorMarker;
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 StreamConfigConnectorSynchronousProxy {
pub fn new(channel: fidl::Channel) -> Self {
let protocol_name =
<StreamConfigConnectorMarker 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<StreamConfigConnectorEvent, fidl::Error> {
StreamConfigConnectorEvent::decode(self.client.wait_for_event(deadline)?)
}
pub fn r#connect(
&self,
mut protocol: fidl::endpoints::ServerEnd<StreamConfigMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<StreamConfigConnectorConnectRequest>(
(protocol,),
0x22051ff3021eafec,
fidl::encoding::DynamicFlags::empty(),
)
}
}
#[derive(Debug, Clone)]
pub struct StreamConfigConnectorProxy {
client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl fidl::endpoints::Proxy for StreamConfigConnectorProxy {
type Protocol = StreamConfigConnectorMarker;
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 StreamConfigConnectorProxy {
pub fn new(channel: ::fidl::AsyncChannel) -> Self {
let protocol_name =
<StreamConfigConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
Self { client: fidl::client::Client::new(channel, protocol_name) }
}
pub fn take_event_stream(&self) -> StreamConfigConnectorEventStream {
StreamConfigConnectorEventStream { event_receiver: self.client.take_event_receiver() }
}
pub fn r#connect(
&self,
mut protocol: fidl::endpoints::ServerEnd<StreamConfigMarker>,
) -> Result<(), fidl::Error> {
StreamConfigConnectorProxyInterface::r#connect(self, protocol)
}
}
impl StreamConfigConnectorProxyInterface for StreamConfigConnectorProxy {
fn r#connect(
&self,
mut protocol: fidl::endpoints::ServerEnd<StreamConfigMarker>,
) -> Result<(), fidl::Error> {
self.client.send::<StreamConfigConnectorConnectRequest>(
(protocol,),
0x22051ff3021eafec,
fidl::encoding::DynamicFlags::empty(),
)
}
}
pub struct StreamConfigConnectorEventStream {
event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
}
impl std::marker::Unpin for StreamConfigConnectorEventStream {}
impl futures::stream::FusedStream for StreamConfigConnectorEventStream {
fn is_terminated(&self) -> bool {
self.event_receiver.is_terminated()
}
}
impl futures::Stream for StreamConfigConnectorEventStream {
type Item = Result<StreamConfigConnectorEvent, 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(StreamConfigConnectorEvent::decode(buf))),
None => std::task::Poll::Ready(None),
}
}
}
#[derive(Debug)]
pub enum StreamConfigConnectorEvent {}
impl StreamConfigConnectorEvent {
fn decode(
mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
) -> Result<StreamConfigConnectorEvent, 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:
<StreamConfigConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}
}
}
pub struct StreamConfigConnectorRequestStream {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
is_terminated: bool,
}
impl std::marker::Unpin for StreamConfigConnectorRequestStream {}
impl futures::stream::FusedStream for StreamConfigConnectorRequestStream {
fn is_terminated(&self) -> bool {
self.is_terminated
}
}
impl fidl::endpoints::RequestStream for StreamConfigConnectorRequestStream {
type Protocol = StreamConfigConnectorMarker;
type ControlHandle = StreamConfigConnectorControlHandle;
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 {
StreamConfigConnectorControlHandle { 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 StreamConfigConnectorRequestStream {
type Item = Result<StreamConfigConnectorRequest, 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 StreamConfigConnectorRequestStream 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 {
0x22051ff3021eafec => {
header.validate_request_tx_id(fidl::MethodType::OneWay)?;
let mut req = fidl::new_empty!(StreamConfigConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<StreamConfigConnectorConnectRequest>(&header, _body_bytes, handles, &mut req)?;
let control_handle = StreamConfigConnectorControlHandle {
inner: this.inner.clone(),
};
Ok(StreamConfigConnectorRequest::Connect {protocol: req.protocol,
control_handle,
})
}
_ => Err(fidl::Error::UnknownOrdinal {
ordinal: header.ordinal,
protocol_name: <StreamConfigConnectorMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
}),
}))
},
)
}
}
#[derive(Debug)]
pub enum StreamConfigConnectorRequest {
Connect {
protocol: fidl::endpoints::ServerEnd<StreamConfigMarker>,
control_handle: StreamConfigConnectorControlHandle,
},
}
impl StreamConfigConnectorRequest {
#[allow(irrefutable_let_patterns)]
pub fn into_connect(
self,
) -> Option<(fidl::endpoints::ServerEnd<StreamConfigMarker>, StreamConfigConnectorControlHandle)>
{
if let StreamConfigConnectorRequest::Connect { protocol, control_handle } = self {
Some((protocol, control_handle))
} else {
None
}
}
pub fn method_name(&self) -> &'static str {
match *self {
StreamConfigConnectorRequest::Connect { .. } => "connect",
}
}
}
#[derive(Debug, Clone)]
pub struct StreamConfigConnectorControlHandle {
inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
}
impl fidl::endpoints::ControlHandle for StreamConfigConnectorControlHandle {
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 StreamConfigConnectorControlHandle {}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct CodecConnectorServiceMarker;
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceMarker for CodecConnectorServiceMarker {
type Proxy = CodecConnectorServiceProxy;
type Request = CodecConnectorServiceRequest;
const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.CodecConnectorService";
}
#[cfg(target_os = "fuchsia")]
pub enum CodecConnectorServiceRequest {
CodecConnector(CodecConnectorRequestStream),
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceRequest for CodecConnectorServiceRequest {
type Service = CodecConnectorServiceMarker;
fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
match name {
"codec_connector" => Self::CodecConnector(
<CodecConnectorRequestStream as fidl::endpoints::RequestStream>::from_channel(
_channel,
),
),
_ => panic!("no such member protocol name for service CodecConnectorService"),
}
}
fn member_names() -> &'static [&'static str] {
&["codec_connector"]
}
}
#[cfg(target_os = "fuchsia")]
pub struct CodecConnectorServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceProxy for CodecConnectorServiceProxy {
type Service = CodecConnectorServiceMarker;
fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
Self(opener)
}
}
#[cfg(target_os = "fuchsia")]
impl CodecConnectorServiceProxy {
pub fn connect_to_codec_connector(&self) -> Result<CodecConnectorProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_proxy::<CodecConnectorMarker>();
self.connect_channel_to_codec_connector(server_end)?;
Ok(proxy)
}
pub fn connect_to_codec_connector_sync(
&self,
) -> Result<CodecConnectorSynchronousProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<CodecConnectorMarker>();
self.connect_channel_to_codec_connector(server_end)?;
Ok(proxy)
}
pub fn connect_channel_to_codec_connector(
&self,
server_end: fidl::endpoints::ServerEnd<CodecConnectorMarker>,
) -> Result<(), fidl::Error> {
self.0.open_member("codec_connector", server_end.into_channel())
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct CodecServiceMarker;
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceMarker for CodecServiceMarker {
type Proxy = CodecServiceProxy;
type Request = CodecServiceRequest;
const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.CodecService";
}
#[cfg(target_os = "fuchsia")]
pub enum CodecServiceRequest {
Codec(CodecRequestStream),
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceRequest for CodecServiceRequest {
type Service = CodecServiceMarker;
fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
match name {
"codec" => Self::Codec(
<CodecRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
),
_ => panic!("no such member protocol name for service CodecService"),
}
}
fn member_names() -> &'static [&'static str] {
&["codec"]
}
}
#[cfg(target_os = "fuchsia")]
pub struct CodecServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceProxy for CodecServiceProxy {
type Service = CodecServiceMarker;
fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
Self(opener)
}
}
#[cfg(target_os = "fuchsia")]
impl CodecServiceProxy {
pub fn connect_to_codec(&self) -> Result<CodecProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_proxy::<CodecMarker>();
self.connect_channel_to_codec(server_end)?;
Ok(proxy)
}
pub fn connect_to_codec_sync(&self) -> Result<CodecSynchronousProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<CodecMarker>();
self.connect_channel_to_codec(server_end)?;
Ok(proxy)
}
pub fn connect_channel_to_codec(
&self,
server_end: fidl::endpoints::ServerEnd<CodecMarker>,
) -> Result<(), fidl::Error> {
self.0.open_member("codec", server_end.into_channel())
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct CompositeConnectorServiceMarker;
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceMarker for CompositeConnectorServiceMarker {
type Proxy = CompositeConnectorServiceProxy;
type Request = CompositeConnectorServiceRequest;
const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.CompositeConnectorService";
}
#[cfg(target_os = "fuchsia")]
pub enum CompositeConnectorServiceRequest {
CompositeConnector(CompositeConnectorRequestStream),
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceRequest for CompositeConnectorServiceRequest {
type Service = CompositeConnectorServiceMarker;
fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
match name {
"composite_connector" => Self::CompositeConnector(
<CompositeConnectorRequestStream as fidl::endpoints::RequestStream>::from_channel(
_channel,
),
),
_ => panic!("no such member protocol name for service CompositeConnectorService"),
}
}
fn member_names() -> &'static [&'static str] {
&["composite_connector"]
}
}
#[cfg(target_os = "fuchsia")]
pub struct CompositeConnectorServiceProxy(
#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>,
);
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceProxy for CompositeConnectorServiceProxy {
type Service = CompositeConnectorServiceMarker;
fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
Self(opener)
}
}
#[cfg(target_os = "fuchsia")]
impl CompositeConnectorServiceProxy {
pub fn connect_to_composite_connector(&self) -> Result<CompositeConnectorProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_proxy::<CompositeConnectorMarker>();
self.connect_channel_to_composite_connector(server_end)?;
Ok(proxy)
}
pub fn connect_to_composite_connector_sync(
&self,
) -> Result<CompositeConnectorSynchronousProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<CompositeConnectorMarker>();
self.connect_channel_to_composite_connector(server_end)?;
Ok(proxy)
}
pub fn connect_channel_to_composite_connector(
&self,
server_end: fidl::endpoints::ServerEnd<CompositeConnectorMarker>,
) -> Result<(), fidl::Error> {
self.0.open_member("composite_connector", server_end.into_channel())
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DaiConnectorServiceMarker;
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceMarker for DaiConnectorServiceMarker {
type Proxy = DaiConnectorServiceProxy;
type Request = DaiConnectorServiceRequest;
const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.DaiConnectorService";
}
#[cfg(target_os = "fuchsia")]
pub enum DaiConnectorServiceRequest {
DaiConnector(DaiConnectorRequestStream),
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceRequest for DaiConnectorServiceRequest {
type Service = DaiConnectorServiceMarker;
fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
match name {
"dai_connector" => Self::DaiConnector(
<DaiConnectorRequestStream as fidl::endpoints::RequestStream>::from_channel(
_channel,
),
),
_ => panic!("no such member protocol name for service DaiConnectorService"),
}
}
fn member_names() -> &'static [&'static str] {
&["dai_connector"]
}
}
#[cfg(target_os = "fuchsia")]
pub struct DaiConnectorServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceProxy for DaiConnectorServiceProxy {
type Service = DaiConnectorServiceMarker;
fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
Self(opener)
}
}
#[cfg(target_os = "fuchsia")]
impl DaiConnectorServiceProxy {
pub fn connect_to_dai_connector(&self) -> Result<DaiConnectorProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_proxy::<DaiConnectorMarker>();
self.connect_channel_to_dai_connector(server_end)?;
Ok(proxy)
}
pub fn connect_to_dai_connector_sync(
&self,
) -> Result<DaiConnectorSynchronousProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<DaiConnectorMarker>();
self.connect_channel_to_dai_connector(server_end)?;
Ok(proxy)
}
pub fn connect_channel_to_dai_connector(
&self,
server_end: fidl::endpoints::ServerEnd<DaiConnectorMarker>,
) -> Result<(), fidl::Error> {
self.0.open_member("dai_connector", server_end.into_channel())
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DaiServiceMarker;
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceMarker for DaiServiceMarker {
type Proxy = DaiServiceProxy;
type Request = DaiServiceRequest;
const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.DaiService";
}
#[cfg(target_os = "fuchsia")]
pub enum DaiServiceRequest {
Dai(DaiRequestStream),
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceRequest for DaiServiceRequest {
type Service = DaiServiceMarker;
fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
match name {
"dai" => Self::Dai(<DaiRequestStream as fidl::endpoints::RequestStream>::from_channel(
_channel,
)),
_ => panic!("no such member protocol name for service DaiService"),
}
}
fn member_names() -> &'static [&'static str] {
&["dai"]
}
}
#[cfg(target_os = "fuchsia")]
pub struct DaiServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceProxy for DaiServiceProxy {
type Service = DaiServiceMarker;
fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
Self(opener)
}
}
#[cfg(target_os = "fuchsia")]
impl DaiServiceProxy {
pub fn connect_to_dai(&self) -> Result<DaiProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_proxy::<DaiMarker>();
self.connect_channel_to_dai(server_end)?;
Ok(proxy)
}
pub fn connect_to_dai_sync(&self) -> Result<DaiSynchronousProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<DaiMarker>();
self.connect_channel_to_dai(server_end)?;
Ok(proxy)
}
pub fn connect_channel_to_dai(
&self,
server_end: fidl::endpoints::ServerEnd<DaiMarker>,
) -> Result<(), fidl::Error> {
self.0.open_member("dai", server_end.into_channel())
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct DeviceServiceMarker;
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceMarker for DeviceServiceMarker {
type Proxy = DeviceServiceProxy;
type Request = DeviceServiceRequest;
const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.DeviceService";
}
#[cfg(target_os = "fuchsia")]
pub enum DeviceServiceRequest {
Device(CompositeRequestStream),
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceRequest for DeviceServiceRequest {
type Service = DeviceServiceMarker;
fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
match name {
"device" => Self::Device(
<CompositeRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
),
_ => panic!("no such member protocol name for service DeviceService"),
}
}
fn member_names() -> &'static [&'static str] {
&["device"]
}
}
#[cfg(target_os = "fuchsia")]
pub struct DeviceServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceProxy for DeviceServiceProxy {
type Service = DeviceServiceMarker;
fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
Self(opener)
}
}
#[cfg(target_os = "fuchsia")]
impl DeviceServiceProxy {
pub fn connect_to_device(&self) -> Result<CompositeProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_proxy::<CompositeMarker>();
self.connect_channel_to_device(server_end)?;
Ok(proxy)
}
pub fn connect_to_device_sync(&self) -> Result<CompositeSynchronousProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<CompositeMarker>();
self.connect_channel_to_device(server_end)?;
Ok(proxy)
}
pub fn connect_channel_to_device(
&self,
server_end: fidl::endpoints::ServerEnd<CompositeMarker>,
) -> Result<(), fidl::Error> {
self.0.open_member("device", server_end.into_channel())
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct StreamConfigConnectorServiceMarker;
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceMarker for StreamConfigConnectorServiceMarker {
type Proxy = StreamConfigConnectorServiceProxy;
type Request = StreamConfigConnectorServiceRequest;
const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.StreamConfigConnectorService";
}
#[cfg(target_os = "fuchsia")]
pub enum StreamConfigConnectorServiceRequest {
StreamConfigConnector(StreamConfigConnectorRequestStream),
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceRequest for StreamConfigConnectorServiceRequest {
type Service = StreamConfigConnectorServiceMarker;
fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
match name {
"stream_config_connector" => Self::StreamConfigConnector(
<StreamConfigConnectorRequestStream as fidl::endpoints::RequestStream>::from_channel(_channel),
),
_ => panic!("no such member protocol name for service StreamConfigConnectorService"),
}
}
fn member_names() -> &'static [&'static str] {
&["stream_config_connector"]
}
}
#[cfg(target_os = "fuchsia")]
pub struct StreamConfigConnectorServiceProxy(
#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>,
);
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceProxy for StreamConfigConnectorServiceProxy {
type Service = StreamConfigConnectorServiceMarker;
fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
Self(opener)
}
}
#[cfg(target_os = "fuchsia")]
impl StreamConfigConnectorServiceProxy {
pub fn connect_to_stream_config_connector(
&self,
) -> Result<StreamConfigConnectorProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_proxy::<StreamConfigConnectorMarker>();
self.connect_channel_to_stream_config_connector(server_end)?;
Ok(proxy)
}
pub fn connect_to_stream_config_connector_sync(
&self,
) -> Result<StreamConfigConnectorSynchronousProxy, fidl::Error> {
let (proxy, server_end) =
fidl::endpoints::create_sync_proxy::<StreamConfigConnectorMarker>();
self.connect_channel_to_stream_config_connector(server_end)?;
Ok(proxy)
}
pub fn connect_channel_to_stream_config_connector(
&self,
server_end: fidl::endpoints::ServerEnd<StreamConfigConnectorMarker>,
) -> Result<(), fidl::Error> {
self.0.open_member("stream_config_connector", server_end.into_channel())
}
}
#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct StreamConfigServiceMarker;
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceMarker for StreamConfigServiceMarker {
type Proxy = StreamConfigServiceProxy;
type Request = StreamConfigServiceRequest;
const SERVICE_NAME: &'static str = "fuchsia.hardware.audio.StreamConfigService";
}
#[cfg(target_os = "fuchsia")]
pub enum StreamConfigServiceRequest {
StreamConfig(StreamConfigRequestStream),
}
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceRequest for StreamConfigServiceRequest {
type Service = StreamConfigServiceMarker;
fn dispatch(name: &str, _channel: fidl::AsyncChannel) -> Self {
match name {
"stream_config" => Self::StreamConfig(
<StreamConfigRequestStream as fidl::endpoints::RequestStream>::from_channel(
_channel,
),
),
_ => panic!("no such member protocol name for service StreamConfigService"),
}
}
fn member_names() -> &'static [&'static str] {
&["stream_config"]
}
}
#[cfg(target_os = "fuchsia")]
pub struct StreamConfigServiceProxy(#[allow(dead_code)] Box<dyn fidl::endpoints::MemberOpener>);
#[cfg(target_os = "fuchsia")]
impl fidl::endpoints::ServiceProxy for StreamConfigServiceProxy {
type Service = StreamConfigServiceMarker;
fn from_member_opener(opener: Box<dyn fidl::endpoints::MemberOpener>) -> Self {
Self(opener)
}
}
#[cfg(target_os = "fuchsia")]
impl StreamConfigServiceProxy {
pub fn connect_to_stream_config(&self) -> Result<StreamConfigProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_proxy::<StreamConfigMarker>();
self.connect_channel_to_stream_config(server_end)?;
Ok(proxy)
}
pub fn connect_to_stream_config_sync(
&self,
) -> Result<StreamConfigSynchronousProxy, fidl::Error> {
let (proxy, server_end) = fidl::endpoints::create_sync_proxy::<StreamConfigMarker>();
self.connect_channel_to_stream_config(server_end)?;
Ok(proxy)
}
pub fn connect_channel_to_stream_config(
&self,
server_end: fidl::endpoints::ServerEnd<StreamConfigMarker>,
) -> Result<(), fidl::Error> {
self.0.open_member("stream_config", server_end.into_channel())
}
}
mod internal {
use super::*;
unsafe impl fidl::encoding::TypeMarker for DaiFrameFormatStandard {
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 DaiFrameFormatStandard {
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 DaiFrameFormatStandard
{
#[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 DaiFrameFormatStandard
{
#[inline(always)]
fn new_empty() -> Self {
Self::None
}
#[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 DaiSampleFormat {
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 DaiSampleFormat {
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 DaiSampleFormat
{
#[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 DaiSampleFormat {
#[inline(always)]
fn new_empty() -> Self {
Self::Pdm
}
#[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 DeviceType {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for DeviceType {
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 DeviceType {
#[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 DeviceType {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[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_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for DriverError {
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 {
false
}
#[inline(always)]
fn decode_is_copy() -> bool {
false
}
}
impl fidl::encoding::ValueTypeMarker for DriverError {
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 DriverError {
#[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 DriverError {
#[inline(always)]
fn new_empty() -> Self {
Self::unknown()
}
#[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_allow_unknown(prim);
Ok(())
}
}
unsafe impl fidl::encoding::TypeMarker for GetVmoError {
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 GetVmoError {
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 GetVmoError {
#[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 GetVmoError {
#[inline(always)]
fn new_empty() -> Self {
Self::InvalidArgs
}
#[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 PlugDetectCapabilities {
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 PlugDetectCapabilities {
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 PlugDetectCapabilities
{
#[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 PlugDetectCapabilities
{
#[inline(always)]
fn new_empty() -> Self {
Self::Hardwired
}
#[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 SampleFormat {
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 SampleFormat {
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 SampleFormat {
#[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 SampleFormat {
#[inline(always)]
fn new_empty() -> Self {
Self::PcmSigned
}
#[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(())
}
}
impl fidl::encoding::ResourceTypeMarker for CodecConnectorConnectRequest {
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 CodecConnectorConnectRequest {
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<
CodecConnectorConnectRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut CodecConnectorConnectRequest
{
#[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::<CodecConnectorConnectRequest>(offset);
fidl::encoding::Encode::<CodecConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CodecMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.codec_protocol),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CodecMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
CodecConnectorConnectRequest,
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::<CodecConnectorConnectRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CodecConnectorConnectRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
codec_protocol: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CodecMarker>>,
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::ServerEnd<CodecMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.codec_protocol,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CodecGetPropertiesResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CodecGetPropertiesResponse {
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<CodecGetPropertiesResponse, D> for &CodecGetPropertiesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CodecGetPropertiesResponse>(offset);
fidl::encoding::Encode::<CodecGetPropertiesResponse, D>::encode(
(<CodecProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<CodecProperties, D>>
fidl::encoding::Encode<CodecGetPropertiesResponse, 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::<CodecGetPropertiesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CodecGetPropertiesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { properties: fidl::new_empty!(CodecProperties, 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!(CodecProperties, D, &mut self.properties, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CodecIsBridgeableResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CodecIsBridgeableResponse {
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<CodecIsBridgeableResponse, D> for &CodecIsBridgeableResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CodecIsBridgeableResponse>(offset);
fidl::encoding::Encode::<CodecIsBridgeableResponse, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supports_bridged_mode),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<CodecIsBridgeableResponse, 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::<CodecIsBridgeableResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CodecIsBridgeableResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { supports_bridged_mode: 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.supports_bridged_mode, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CodecSetBridgedModeRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CodecSetBridgedModeRequest {
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<CodecSetBridgedModeRequest, D> for &CodecSetBridgedModeRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CodecSetBridgedModeRequest>(offset);
fidl::encoding::Encode::<CodecSetBridgedModeRequest, D>::encode(
(<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.enable_bridged_mode),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
fidl::encoding::Encode<CodecSetBridgedModeRequest, 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::<CodecSetBridgedModeRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CodecSetBridgedModeRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { enable_bridged_mode: 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.enable_bridged_mode, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CodecSetDaiFormatRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CodecSetDaiFormatRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
48
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CodecSetDaiFormatRequest, D> for &CodecSetDaiFormatRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CodecSetDaiFormatRequest>(offset);
fidl::encoding::Encode::<CodecSetDaiFormatRequest, D>::encode(
(<DaiFormat as fidl::encoding::ValueTypeMarker>::borrow(&self.format),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DaiFormat, D>>
fidl::encoding::Encode<CodecSetDaiFormatRequest, 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::<CodecSetDaiFormatRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CodecSetDaiFormatRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { format: fidl::new_empty!(DaiFormat, 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!(DaiFormat, D, &mut self.format, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CodecStartResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CodecStartResponse {
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<CodecStartResponse, D>
for &CodecStartResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CodecStartResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CodecStartResponse)
.write_unaligned((self as *const CodecStartResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
fidl::encoding::Encode<CodecStartResponse, 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::<CodecStartResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CodecStartResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { start_time: fidl::new_empty!(i64, 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 CodecStopResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CodecStopResponse {
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<CodecStopResponse, D>
for &CodecStopResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CodecStopResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CodecStopResponse)
.write_unaligned((self as *const CodecStopResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
fidl::encoding::Encode<CodecStopResponse, 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::<CodecStopResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for CodecStopResponse {
#[inline(always)]
fn new_empty() -> Self {
Self { stop_time: fidl::new_empty!(i64, 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 CodecWatchPlugStateResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CodecWatchPlugStateResponse {
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<CodecWatchPlugStateResponse, D> for &CodecWatchPlugStateResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CodecWatchPlugStateResponse>(offset);
fidl::encoding::Encode::<CodecWatchPlugStateResponse, D>::encode(
(<PlugState as fidl::encoding::ValueTypeMarker>::borrow(&self.plug_state),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PlugState, D>>
fidl::encoding::Encode<CodecWatchPlugStateResponse, 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::<CodecWatchPlugStateResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CodecWatchPlugStateResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { plug_state: fidl::new_empty!(PlugState, 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!(PlugState, D, &mut self.plug_state, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CodecGetDaiFormatsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CodecGetDaiFormatsResponse {
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<CodecGetDaiFormatsResponse, D> for &CodecGetDaiFormatsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CodecGetDaiFormatsResponse>(offset);
fidl::encoding::Encode::<CodecGetDaiFormatsResponse, D>::encode(
(
<fidl::encoding::Vector<DaiSupportedFormats, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.formats),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<DaiSupportedFormats, 64>, D>,
> fidl::encoding::Encode<CodecGetDaiFormatsResponse, 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::<CodecGetDaiFormatsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CodecGetDaiFormatsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { formats: fidl::new_empty!(fidl::encoding::Vector<DaiSupportedFormats, 64>, 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<DaiSupportedFormats, 64>, D, &mut self.formats, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CodecSetDaiFormatResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CodecSetDaiFormatResponse {
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<CodecSetDaiFormatResponse, D> for &CodecSetDaiFormatResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CodecSetDaiFormatResponse>(offset);
fidl::encoding::Encode::<CodecSetDaiFormatResponse, D>::encode(
(<CodecFormatInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.state),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<CodecFormatInfo, D>>
fidl::encoding::Encode<CodecSetDaiFormatResponse, 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::<CodecSetDaiFormatResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CodecSetDaiFormatResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { state: fidl::new_empty!(CodecFormatInfo, 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!(CodecFormatInfo, D, &mut self.state, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for CompositeConnectorConnectRequest {
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 CompositeConnectorConnectRequest {
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<
CompositeConnectorConnectRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut CompositeConnectorConnectRequest
{
#[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::<CompositeConnectorConnectRequest>(offset);
fidl::encoding::Encode::<CompositeConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CompositeMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.composite_protocol),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CompositeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
CompositeConnectorConnectRequest,
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::<CompositeConnectorConnectRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CompositeConnectorConnectRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
composite_protocol: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<CompositeMarker>>,
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::ServerEnd<CompositeMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.composite_protocol,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for CompositeCreateRingBufferRequest {
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 CompositeCreateRingBufferRequest {
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
fidl::encoding::Encode<
CompositeCreateRingBufferRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut CompositeCreateRingBufferRequest
{
#[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::<CompositeCreateRingBufferRequest>(offset);
fidl::encoding::Encode::<CompositeCreateRingBufferRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.processing_element_id),
<Format as fidl::encoding::ValueTypeMarker>::borrow(&self.format),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.ring_buffer),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<Format, fidl::encoding::DefaultFuchsiaResourceDialect>,
T2: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
CompositeCreateRingBufferRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2)
{
#[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::<CompositeCreateRingBufferRequest>(offset);
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 fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for CompositeCreateRingBufferRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
processing_element_id: fidl::new_empty!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect
),
format: fidl::new_empty!(Format, fidl::encoding::DefaultFuchsiaResourceDialect),
ring_buffer: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>>,
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(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!(
u64,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.processing_element_id,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
Format,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.format,
decoder,
offset + 8,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.ring_buffer,
decoder,
offset + 24,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CompositeGetDaiFormatsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CompositeGetDaiFormatsRequest {
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<CompositeGetDaiFormatsRequest, D>
for &CompositeGetDaiFormatsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CompositeGetDaiFormatsRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CompositeGetDaiFormatsRequest)
.write_unaligned((self as *const CompositeGetDaiFormatsRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<CompositeGetDaiFormatsRequest, 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::<CompositeGetDaiFormatsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CompositeGetDaiFormatsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { processing_element_id: 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 CompositeGetPropertiesResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CompositeGetPropertiesResponse {
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<CompositeGetPropertiesResponse, D>
for &CompositeGetPropertiesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CompositeGetPropertiesResponse>(offset);
fidl::encoding::Encode::<CompositeGetPropertiesResponse, D>::encode(
(<CompositeProperties as fidl::encoding::ValueTypeMarker>::borrow(
&self.properties,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<CompositeProperties, D>,
> fidl::encoding::Encode<CompositeGetPropertiesResponse, 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::<CompositeGetPropertiesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CompositeGetPropertiesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { properties: fidl::new_empty!(CompositeProperties, 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!(
CompositeProperties,
D,
&mut self.properties,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CompositeGetRingBufferFormatsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CompositeGetRingBufferFormatsRequest {
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<CompositeGetRingBufferFormatsRequest, D>
for &CompositeGetRingBufferFormatsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CompositeGetRingBufferFormatsRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut CompositeGetRingBufferFormatsRequest)
.write_unaligned((self as *const CompositeGetRingBufferFormatsRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<CompositeGetRingBufferFormatsRequest, 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::<CompositeGetRingBufferFormatsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CompositeGetRingBufferFormatsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { processing_element_id: 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 CompositeSetDaiFormatRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CompositeSetDaiFormatRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
56
}
}
unsafe impl<D: fidl::encoding::ResourceDialect>
fidl::encoding::Encode<CompositeSetDaiFormatRequest, D> for &CompositeSetDaiFormatRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CompositeSetDaiFormatRequest>(offset);
fidl::encoding::Encode::<CompositeSetDaiFormatRequest, D>::encode(
(
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.processing_element_id),
<DaiFormat as fidl::encoding::ValueTypeMarker>::borrow(&self.format),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u64, D>,
T1: fidl::encoding::Encode<DaiFormat, D>,
> fidl::encoding::Encode<CompositeSetDaiFormatRequest, 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::<CompositeSetDaiFormatRequest>(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 CompositeSetDaiFormatRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
processing_element_id: fidl::new_empty!(u64, D),
format: fidl::new_empty!(DaiFormat, 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!(u64, D, &mut self.processing_element_id, decoder, offset + 0, _depth)?;
fidl::decode!(DaiFormat, D, &mut self.format, decoder, offset + 8, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CompositeGetDaiFormatsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CompositeGetDaiFormatsResponse {
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<CompositeGetDaiFormatsResponse, D>
for &CompositeGetDaiFormatsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CompositeGetDaiFormatsResponse>(offset);
fidl::encoding::Encode::<CompositeGetDaiFormatsResponse, D>::encode(
(
<fidl::encoding::Vector<DaiSupportedFormats, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.dai_formats),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<DaiSupportedFormats, 64>, D>,
> fidl::encoding::Encode<CompositeGetDaiFormatsResponse, 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::<CompositeGetDaiFormatsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CompositeGetDaiFormatsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
dai_formats: fidl::new_empty!(fidl::encoding::Vector<DaiSupportedFormats, 64>, 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<DaiSupportedFormats, 64>, D, &mut self.dai_formats, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for CompositeGetRingBufferFormatsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CompositeGetRingBufferFormatsResponse {
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<CompositeGetRingBufferFormatsResponse, D>
for &CompositeGetRingBufferFormatsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CompositeGetRingBufferFormatsResponse>(offset);
fidl::encoding::Encode::<CompositeGetRingBufferFormatsResponse, D>::encode(
(
<fidl::encoding::Vector<SupportedFormats, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.ring_buffer_formats),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<SupportedFormats, 64>, D>,
> fidl::encoding::Encode<CompositeGetRingBufferFormatsResponse, 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::<CompositeGetRingBufferFormatsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for CompositeGetRingBufferFormatsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
ring_buffer_formats: fidl::new_empty!(fidl::encoding::Vector<SupportedFormats, 64>, 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<SupportedFormats, 64>, D, &mut self.ring_buffer_formats, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DaiConnectorConnectRequest {
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 DaiConnectorConnectRequest {
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<
DaiConnectorConnectRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DaiConnectorConnectRequest
{
#[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::<DaiConnectorConnectRequest>(offset);
fidl::encoding::Encode::<DaiConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DaiMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.dai_protocol),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DaiMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DaiConnectorConnectRequest,
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::<DaiConnectorConnectRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DaiConnectorConnectRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
dai_protocol: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<DaiMarker>>,
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::ServerEnd<DaiMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.dai_protocol,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for DaiCreateRingBufferRequest {
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 DaiCreateRingBufferRequest {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
72
}
}
unsafe impl
fidl::encoding::Encode<
DaiCreateRingBufferRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut DaiCreateRingBufferRequest
{
#[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::<DaiCreateRingBufferRequest>(offset);
fidl::encoding::Encode::<DaiCreateRingBufferRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<DaiFormat as fidl::encoding::ValueTypeMarker>::borrow(&self.dai_format),
<Format as fidl::encoding::ValueTypeMarker>::borrow(&self.ring_buffer_format),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.ring_buffer),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<DaiFormat, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<Format, fidl::encoding::DefaultFuchsiaResourceDialect>,
T2: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
DaiCreateRingBufferRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for (T0, T1, T2)
{
#[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::<DaiCreateRingBufferRequest>(offset);
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(64);
(ptr as *mut u64).write_unaligned(0);
}
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 48, depth)?;
self.2.encode(encoder, offset + 64, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for DaiCreateRingBufferRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
dai_format: fidl::new_empty!(
DaiFormat,
fidl::encoding::DefaultFuchsiaResourceDialect
),
ring_buffer_format: fidl::new_empty!(
Format,
fidl::encoding::DefaultFuchsiaResourceDialect
),
ring_buffer: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>>,
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(64) };
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 + 64 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
DaiFormat,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.dai_format,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
Format,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.ring_buffer_format,
decoder,
offset + 48,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.ring_buffer,
decoder,
offset + 64,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DaiFormat {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DaiFormat {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
48
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DaiFormat, D>
for &DaiFormat
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DaiFormat>(offset);
fidl::encoding::Encode::<DaiFormat, D>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.number_of_channels),
<u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.channels_to_use_bitmask),
<DaiSampleFormat as fidl::encoding::ValueTypeMarker>::borrow(
&self.sample_format,
),
<DaiFrameFormat as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_format),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_rate),
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.bits_per_slot),
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.bits_per_sample),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u64, D>,
T2: fidl::encoding::Encode<DaiSampleFormat, D>,
T3: fidl::encoding::Encode<DaiFrameFormat, D>,
T4: fidl::encoding::Encode<u32, D>,
T5: fidl::encoding::Encode<u8, D>,
T6: fidl::encoding::Encode<u8, D>,
> fidl::encoding::Encode<DaiFormat, D> for (T0, T1, T2, T3, T4, T5, T6)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DaiFormat>(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);
}
unsafe {
let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
(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)?;
self.3.encode(encoder, offset + 24, depth)?;
self.4.encode(encoder, offset + 40, depth)?;
self.5.encode(encoder, offset + 44, depth)?;
self.6.encode(encoder, offset + 45, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DaiFormat {
#[inline(always)]
fn new_empty() -> Self {
Self {
number_of_channels: fidl::new_empty!(u32, D),
channels_to_use_bitmask: fidl::new_empty!(u64, D),
sample_format: fidl::new_empty!(DaiSampleFormat, D),
frame_format: fidl::new_empty!(DaiFrameFormat, D),
frame_rate: fidl::new_empty!(u32, D),
bits_per_slot: fidl::new_empty!(u8, D),
bits_per_sample: 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(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 = 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,
});
}
let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
let padval = unsafe { (ptr as *const u64).read_unaligned() };
let mask = 0xffff000000000000u64;
let maskedval = padval & mask;
if maskedval != 0 {
return Err(fidl::Error::NonZeroPadding {
padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(u32, D, &mut self.number_of_channels, decoder, offset + 0, _depth)?;
fidl::decode!(u64, D, &mut self.channels_to_use_bitmask, decoder, offset + 8, _depth)?;
fidl::decode!(
DaiSampleFormat,
D,
&mut self.sample_format,
decoder,
offset + 16,
_depth
)?;
fidl::decode!(DaiFrameFormat, D, &mut self.frame_format, decoder, offset + 24, _depth)?;
fidl::decode!(u32, D, &mut self.frame_rate, decoder, offset + 40, _depth)?;
fidl::decode!(u8, D, &mut self.bits_per_slot, decoder, offset + 44, _depth)?;
fidl::decode!(u8, D, &mut self.bits_per_sample, decoder, offset + 45, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DaiFrameFormatCustom {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DaiFrameFormatCustom {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
1
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
4
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DaiFrameFormatCustom, D>
for &DaiFrameFormatCustom
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DaiFrameFormatCustom>(offset);
fidl::encoding::Encode::<DaiFrameFormatCustom, D>::encode(
(
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.left_justified),
<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.sclk_on_raising),
<i8 as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_sync_sclks_offset),
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_sync_size),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<bool, D>,
T1: fidl::encoding::Encode<bool, D>,
T2: fidl::encoding::Encode<i8, D>,
T3: fidl::encoding::Encode<u8, D>,
> fidl::encoding::Encode<DaiFrameFormatCustom, D> for (T0, T1, T2, T3)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DaiFrameFormatCustom>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 1, depth)?;
self.2.encode(encoder, offset + 2, depth)?;
self.3.encode(encoder, offset + 3, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DaiFrameFormatCustom {
#[inline(always)]
fn new_empty() -> Self {
Self {
left_justified: fidl::new_empty!(bool, D),
sclk_on_raising: fidl::new_empty!(bool, D),
frame_sync_sclks_offset: fidl::new_empty!(i8, D),
frame_sync_size: 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);
fidl::decode!(bool, D, &mut self.left_justified, decoder, offset + 0, _depth)?;
fidl::decode!(bool, D, &mut self.sclk_on_raising, decoder, offset + 1, _depth)?;
fidl::decode!(i8, D, &mut self.frame_sync_sclks_offset, decoder, offset + 2, _depth)?;
fidl::decode!(u8, D, &mut self.frame_sync_size, decoder, offset + 3, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DaiGetPropertiesResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DaiGetPropertiesResponse {
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<DaiGetPropertiesResponse, D> for &DaiGetPropertiesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DaiGetPropertiesResponse>(offset);
fidl::encoding::Encode::<DaiGetPropertiesResponse, D>::encode(
(<DaiProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DaiProperties, D>>
fidl::encoding::Encode<DaiGetPropertiesResponse, 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::<DaiGetPropertiesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DaiGetPropertiesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { properties: fidl::new_empty!(DaiProperties, 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!(DaiProperties, D, &mut self.properties, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DaiSupportedFormats {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DaiSupportedFormats {
type Owned = Self;
#[inline(always)]
fn inline_align(_context: fidl::encoding::Context) -> usize {
8
}
#[inline(always)]
fn inline_size(_context: fidl::encoding::Context) -> usize {
96
}
}
unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DaiSupportedFormats, D>
for &DaiSupportedFormats
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DaiSupportedFormats>(offset);
fidl::encoding::Encode::<DaiSupportedFormats, D>::encode(
(
<fidl::encoding::Vector<u32, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.number_of_channels),
<fidl::encoding::Vector<DaiSampleFormat, 4> as fidl::encoding::ValueTypeMarker>::borrow(&self.sample_formats),
<fidl::encoding::Vector<DaiFrameFormat, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_formats),
<fidl::encoding::Vector<u32, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_rates),
<fidl::encoding::Vector<u8, 8> as fidl::encoding::ValueTypeMarker>::borrow(&self.bits_per_slot),
<fidl::encoding::Vector<u8, 8> as fidl::encoding::ValueTypeMarker>::borrow(&self.bits_per_sample),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<u32, 64>, D>,
T1: fidl::encoding::Encode<fidl::encoding::Vector<DaiSampleFormat, 4>, D>,
T2: fidl::encoding::Encode<fidl::encoding::Vector<DaiFrameFormat, 64>, D>,
T3: fidl::encoding::Encode<fidl::encoding::Vector<u32, 64>, D>,
T4: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8>, D>,
T5: fidl::encoding::Encode<fidl::encoding::Vector<u8, 8>, D>,
> fidl::encoding::Encode<DaiSupportedFormats, D> for (T0, T1, T2, T3, T4, T5)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DaiSupportedFormats>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 16, depth)?;
self.2.encode(encoder, offset + 32, depth)?;
self.3.encode(encoder, offset + 48, depth)?;
self.4.encode(encoder, offset + 64, depth)?;
self.5.encode(encoder, offset + 80, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DaiSupportedFormats {
#[inline(always)]
fn new_empty() -> Self {
Self {
number_of_channels: fidl::new_empty!(fidl::encoding::Vector<u32, 64>, D),
sample_formats: fidl::new_empty!(fidl::encoding::Vector<DaiSampleFormat, 4>, D),
frame_formats: fidl::new_empty!(fidl::encoding::Vector<DaiFrameFormat, 64>, D),
frame_rates: fidl::new_empty!(fidl::encoding::Vector<u32, 64>, D),
bits_per_slot: fidl::new_empty!(fidl::encoding::Vector<u8, 8>, D),
bits_per_sample: fidl::new_empty!(fidl::encoding::Vector<u8, 8>, 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<u32, 64>, D, &mut self.number_of_channels, decoder, offset + 0, _depth)?;
fidl::decode!(fidl::encoding::Vector<DaiSampleFormat, 4>, D, &mut self.sample_formats, decoder, offset + 16, _depth)?;
fidl::decode!(fidl::encoding::Vector<DaiFrameFormat, 64>, D, &mut self.frame_formats, decoder, offset + 32, _depth)?;
fidl::decode!(fidl::encoding::Vector<u32, 64>, D, &mut self.frame_rates, decoder, offset + 48, _depth)?;
fidl::decode!(fidl::encoding::Vector<u8, 8>, D, &mut self.bits_per_slot, decoder, offset + 64, _depth)?;
fidl::decode!(fidl::encoding::Vector<u8, 8>, D, &mut self.bits_per_sample, decoder, offset + 80, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DaiGetDaiFormatsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DaiGetDaiFormatsResponse {
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<DaiGetDaiFormatsResponse, D> for &DaiGetDaiFormatsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DaiGetDaiFormatsResponse>(offset);
fidl::encoding::Encode::<DaiGetDaiFormatsResponse, D>::encode(
(
<fidl::encoding::Vector<DaiSupportedFormats, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.dai_formats),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<DaiSupportedFormats, 64>, D>,
> fidl::encoding::Encode<DaiGetDaiFormatsResponse, 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::<DaiGetDaiFormatsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DaiGetDaiFormatsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
dai_formats: fidl::new_empty!(fidl::encoding::Vector<DaiSupportedFormats, 64>, 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<DaiSupportedFormats, 64>, D, &mut self.dai_formats, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for DaiGetRingBufferFormatsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DaiGetRingBufferFormatsResponse {
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<DaiGetRingBufferFormatsResponse, D>
for &DaiGetRingBufferFormatsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DaiGetRingBufferFormatsResponse>(offset);
fidl::encoding::Encode::<DaiGetRingBufferFormatsResponse, D>::encode(
(
<fidl::encoding::Vector<SupportedFormats, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.ring_buffer_formats),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<SupportedFormats, 64>, D>,
> fidl::encoding::Encode<DaiGetRingBufferFormatsResponse, 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::<DaiGetRingBufferFormatsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for DaiGetRingBufferFormatsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
ring_buffer_formats: fidl::new_empty!(fidl::encoding::Vector<SupportedFormats, 64>, 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<SupportedFormats, 64>, D, &mut self.ring_buffer_formats, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for HealthGetHealthStateResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for HealthGetHealthStateResponse {
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<HealthGetHealthStateResponse, D> for &HealthGetHealthStateResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<HealthGetHealthStateResponse>(offset);
fidl::encoding::Encode::<HealthGetHealthStateResponse, D>::encode(
(<HealthState as fidl::encoding::ValueTypeMarker>::borrow(&self.state),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<HealthState, D>>
fidl::encoding::Encode<HealthGetHealthStateResponse, 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::<HealthGetHealthStateResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for HealthGetHealthStateResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { state: fidl::new_empty!(HealthState, 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!(HealthState, D, &mut self.state, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for PcmFormat {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PcmFormat {
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<PcmFormat, D>
for &PcmFormat
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PcmFormat>(offset);
fidl::encoding::Encode::<PcmFormat, D>::encode(
(
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.number_of_channels),
<SampleFormat as fidl::encoding::ValueTypeMarker>::borrow(&self.sample_format),
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.bytes_per_sample),
<u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.valid_bits_per_sample),
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.frame_rate),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u8, D>,
T1: fidl::encoding::Encode<SampleFormat, D>,
T2: fidl::encoding::Encode<u8, D>,
T3: fidl::encoding::Encode<u8, D>,
T4: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<PcmFormat, D> for (T0, T1, T2, T3, T4)
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PcmFormat>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 1, depth)?;
self.2.encode(encoder, offset + 2, depth)?;
self.3.encode(encoder, offset + 3, depth)?;
self.4.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PcmFormat {
#[inline(always)]
fn new_empty() -> Self {
Self {
number_of_channels: fidl::new_empty!(u8, D),
sample_format: fidl::new_empty!(SampleFormat, D),
bytes_per_sample: fidl::new_empty!(u8, D),
valid_bits_per_sample: fidl::new_empty!(u8, D),
frame_rate: 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!(u8, D, &mut self.number_of_channels, decoder, offset + 0, _depth)?;
fidl::decode!(SampleFormat, D, &mut self.sample_format, decoder, offset + 1, _depth)?;
fidl::decode!(u8, D, &mut self.bytes_per_sample, decoder, offset + 2, _depth)?;
fidl::decode!(u8, D, &mut self.valid_bits_per_sample, decoder, offset + 3, _depth)?;
fidl::decode!(u32, D, &mut self.frame_rate, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RingBufferGetPropertiesResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RingBufferGetPropertiesResponse {
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<RingBufferGetPropertiesResponse, D>
for &RingBufferGetPropertiesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RingBufferGetPropertiesResponse>(offset);
fidl::encoding::Encode::<RingBufferGetPropertiesResponse, D>::encode(
(<RingBufferProperties as fidl::encoding::ValueTypeMarker>::borrow(
&self.properties,
),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<RingBufferProperties, D>,
> fidl::encoding::Encode<RingBufferGetPropertiesResponse, 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::<RingBufferGetPropertiesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RingBufferGetPropertiesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { properties: fidl::new_empty!(RingBufferProperties, 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!(
RingBufferProperties,
D,
&mut self.properties,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RingBufferGetVmoRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RingBufferGetVmoRequest {
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<RingBufferGetVmoRequest, D> for &RingBufferGetVmoRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RingBufferGetVmoRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut RingBufferGetVmoRequest)
.write_unaligned((self as *const RingBufferGetVmoRequest).read());
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<u32, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<RingBufferGetVmoRequest, 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::<RingBufferGetVmoRequest>(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 RingBufferGetVmoRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
min_frames: fidl::new_empty!(u32, D),
clock_recovery_notifications_per_ring: 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 RingBufferPositionInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RingBufferPositionInfo {
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<RingBufferPositionInfo, D> for &RingBufferPositionInfo
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RingBufferPositionInfo>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut RingBufferPositionInfo)
.write_unaligned((self as *const RingBufferPositionInfo).read());
let padding_ptr = buf_ptr.offset(8) as *mut u64;
let padding_mask = 0xffffffff00000000u64;
padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<i64, D>,
T1: fidl::encoding::Encode<u32, D>,
> fidl::encoding::Encode<RingBufferPositionInfo, 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::<RingBufferPositionInfo>(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<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RingBufferPositionInfo
{
#[inline(always)]
fn new_empty() -> Self {
Self { timestamp: fidl::new_empty!(i64, D), position: 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) };
let ptr = unsafe { buf_ptr.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,
});
}
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
}
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RingBufferSetActiveChannelsRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RingBufferSetActiveChannelsRequest {
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<RingBufferSetActiveChannelsRequest, D>
for &RingBufferSetActiveChannelsRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RingBufferSetActiveChannelsRequest>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut RingBufferSetActiveChannelsRequest)
.write_unaligned((self as *const RingBufferSetActiveChannelsRequest).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u64, D>>
fidl::encoding::Encode<RingBufferSetActiveChannelsRequest, 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::<RingBufferSetActiveChannelsRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RingBufferSetActiveChannelsRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { active_channels_bitmask: 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 RingBufferStartResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RingBufferStartResponse {
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<RingBufferStartResponse, D> for &RingBufferStartResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RingBufferStartResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut RingBufferStartResponse)
.write_unaligned((self as *const RingBufferStartResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
fidl::encoding::Encode<RingBufferStartResponse, 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::<RingBufferStartResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RingBufferStartResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { start_time: fidl::new_empty!(i64, 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 RingBufferWatchClockRecoveryPositionInfoResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RingBufferWatchClockRecoveryPositionInfoResponse {
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<RingBufferWatchClockRecoveryPositionInfoResponse, D>
for &RingBufferWatchClockRecoveryPositionInfoResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RingBufferWatchClockRecoveryPositionInfoResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut RingBufferWatchClockRecoveryPositionInfoResponse).write_unaligned(
(self as *const RingBufferWatchClockRecoveryPositionInfoResponse).read(),
);
let padding_ptr = buf_ptr.offset(8) as *mut u64;
let padding_mask = 0xffffffff00000000u64;
padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
}
Ok(())
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<RingBufferPositionInfo, D>,
> fidl::encoding::Encode<RingBufferWatchClockRecoveryPositionInfoResponse, 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::<RingBufferWatchClockRecoveryPositionInfoResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RingBufferWatchClockRecoveryPositionInfoResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { position_info: fidl::new_empty!(RingBufferPositionInfo, 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) };
let ptr = unsafe { buf_ptr.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,
});
}
unsafe {
std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
}
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for RingBufferGetVmoResponse {
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 RingBufferGetVmoResponse {
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
fidl::encoding::Encode<
RingBufferGetVmoResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut RingBufferGetVmoResponse
{
#[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::<RingBufferGetVmoResponse>(offset);
fidl::encoding::Encode::<
RingBufferGetVmoResponse,
fidl::encoding::DefaultFuchsiaResourceDialect,
>::encode(
(
<u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.num_frames),
<fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
&mut self.ring_buffer
),
),
encoder,
offset,
_depth,
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<u32, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::HandleType<
fidl::Vmo,
{ fidl::ObjectType::VMO.into_raw() },
2147483648,
>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
RingBufferGetVmoResponse,
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::<RingBufferGetVmoResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
self.1.encode(encoder, offset + 4, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for RingBufferGetVmoResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
num_frames: fidl::new_empty!(u32, fidl::encoding::DefaultFuchsiaResourceDialect),
ring_buffer: fidl::new_empty!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, 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!(
u32,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.num_frames,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(fidl::encoding::HandleType<fidl::Vmo, { fidl::ObjectType::VMO.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.ring_buffer, decoder, offset + 4, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for RingBufferSetActiveChannelsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RingBufferSetActiveChannelsResponse {
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<RingBufferSetActiveChannelsResponse, D>
for &RingBufferSetActiveChannelsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RingBufferSetActiveChannelsResponse>(offset);
unsafe {
let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
(buf_ptr as *mut RingBufferSetActiveChannelsResponse)
.write_unaligned((self as *const RingBufferSetActiveChannelsResponse).read());
}
Ok(())
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i64, D>>
fidl::encoding::Encode<RingBufferSetActiveChannelsResponse, 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::<RingBufferSetActiveChannelsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RingBufferSetActiveChannelsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { set_time: fidl::new_empty!(i64, 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 RingBufferWatchDelayInfoResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RingBufferWatchDelayInfoResponse {
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<RingBufferWatchDelayInfoResponse, D>
for &RingBufferWatchDelayInfoResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RingBufferWatchDelayInfoResponse>(offset);
fidl::encoding::Encode::<RingBufferWatchDelayInfoResponse, D>::encode(
(<DelayInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.delay_info),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DelayInfo, D>>
fidl::encoding::Encode<RingBufferWatchDelayInfoResponse, 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::<RingBufferWatchDelayInfoResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for RingBufferWatchDelayInfoResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { delay_info: fidl::new_empty!(DelayInfo, 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!(DelayInfo, D, &mut self.delay_info, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for StreamConfigConnectorConnectRequest {
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 StreamConfigConnectorConnectRequest {
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<
StreamConfigConnectorConnectRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut StreamConfigConnectorConnectRequest
{
#[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::<StreamConfigConnectorConnectRequest>(offset);
fidl::encoding::Encode::<StreamConfigConnectorConnectRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StreamConfigMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.protocol),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StreamConfigMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
StreamConfigConnectorConnectRequest,
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::<StreamConfigConnectorConnectRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for StreamConfigConnectorConnectRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
protocol: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<StreamConfigMarker>>,
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::ServerEnd<StreamConfigMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.protocol,
decoder,
offset + 0,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ResourceTypeMarker for StreamConfigCreateRingBufferRequest {
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 StreamConfigCreateRingBufferRequest {
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
fidl::encoding::Encode<
StreamConfigCreateRingBufferRequest,
fidl::encoding::DefaultFuchsiaResourceDialect,
> for &mut StreamConfigCreateRingBufferRequest
{
#[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::<StreamConfigCreateRingBufferRequest>(offset);
fidl::encoding::Encode::<StreamConfigCreateRingBufferRequest, fidl::encoding::DefaultFuchsiaResourceDialect>::encode(
(
<Format as fidl::encoding::ValueTypeMarker>::borrow(&self.format),
<fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>> as fidl::encoding::ResourceTypeMarker>::take_or_borrow(&mut self.ring_buffer),
),
encoder, offset, _depth
)
}
}
unsafe impl<
T0: fidl::encoding::Encode<Format, fidl::encoding::DefaultFuchsiaResourceDialect>,
T1: fidl::encoding::Encode<
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
>,
>
fidl::encoding::Encode<
StreamConfigCreateRingBufferRequest,
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::<StreamConfigCreateRingBufferRequest>(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 fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
for StreamConfigCreateRingBufferRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self {
format: fidl::new_empty!(Format, fidl::encoding::DefaultFuchsiaResourceDialect),
ring_buffer: fidl::new_empty!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>>,
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(16) };
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 + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
});
}
fidl::decode!(
Format,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.format,
decoder,
offset + 0,
_depth
)?;
fidl::decode!(
fidl::encoding::Endpoint<fidl::endpoints::ServerEnd<RingBufferMarker>>,
fidl::encoding::DefaultFuchsiaResourceDialect,
&mut self.ring_buffer,
decoder,
offset + 16,
_depth
)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for StreamConfigGetPropertiesResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StreamConfigGetPropertiesResponse {
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<StreamConfigGetPropertiesResponse, D>
for &StreamConfigGetPropertiesResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StreamConfigGetPropertiesResponse>(offset);
fidl::encoding::Encode::<StreamConfigGetPropertiesResponse, D>::encode(
(<StreamProperties as fidl::encoding::ValueTypeMarker>::borrow(&self.properties),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StreamProperties, D>>
fidl::encoding::Encode<StreamConfigGetPropertiesResponse, 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::<StreamConfigGetPropertiesResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for StreamConfigGetPropertiesResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { properties: fidl::new_empty!(StreamProperties, 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!(StreamProperties, D, &mut self.properties, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for StreamConfigGetSupportedFormatsResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StreamConfigGetSupportedFormatsResponse {
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<StreamConfigGetSupportedFormatsResponse, D>
for &StreamConfigGetSupportedFormatsResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StreamConfigGetSupportedFormatsResponse>(offset);
fidl::encoding::Encode::<StreamConfigGetSupportedFormatsResponse, D>::encode(
(
<fidl::encoding::Vector<SupportedFormats, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.supported_formats),
),
encoder, offset, _depth
)
}
}
unsafe impl<
D: fidl::encoding::ResourceDialect,
T0: fidl::encoding::Encode<fidl::encoding::Vector<SupportedFormats, 64>, D>,
> fidl::encoding::Encode<StreamConfigGetSupportedFormatsResponse, 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::<StreamConfigGetSupportedFormatsResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for StreamConfigGetSupportedFormatsResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self {
supported_formats: fidl::new_empty!(fidl::encoding::Vector<SupportedFormats, 64>, 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<SupportedFormats, 64>, D, &mut self.supported_formats, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for StreamConfigSetGainRequest {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StreamConfigSetGainRequest {
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<StreamConfigSetGainRequest, D> for &StreamConfigSetGainRequest
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StreamConfigSetGainRequest>(offset);
fidl::encoding::Encode::<StreamConfigSetGainRequest, D>::encode(
(<GainState as fidl::encoding::ValueTypeMarker>::borrow(&self.target_state),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<GainState, D>>
fidl::encoding::Encode<StreamConfigSetGainRequest, 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::<StreamConfigSetGainRequest>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for StreamConfigSetGainRequest
{
#[inline(always)]
fn new_empty() -> Self {
Self { target_state: fidl::new_empty!(GainState, 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!(GainState, D, &mut self.target_state, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for StreamConfigWatchGainStateResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StreamConfigWatchGainStateResponse {
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<StreamConfigWatchGainStateResponse, D>
for &StreamConfigWatchGainStateResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StreamConfigWatchGainStateResponse>(offset);
fidl::encoding::Encode::<StreamConfigWatchGainStateResponse, D>::encode(
(<GainState as fidl::encoding::ValueTypeMarker>::borrow(&self.gain_state),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<GainState, D>>
fidl::encoding::Encode<StreamConfigWatchGainStateResponse, 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::<StreamConfigWatchGainStateResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for StreamConfigWatchGainStateResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { gain_state: fidl::new_empty!(GainState, 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!(GainState, D, &mut self.gain_state, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl fidl::encoding::ValueTypeMarker for StreamConfigWatchPlugStateResponse {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StreamConfigWatchPlugStateResponse {
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<StreamConfigWatchPlugStateResponse, D>
for &StreamConfigWatchPlugStateResponse
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StreamConfigWatchPlugStateResponse>(offset);
fidl::encoding::Encode::<StreamConfigWatchPlugStateResponse, D>::encode(
(<PlugState as fidl::encoding::ValueTypeMarker>::borrow(&self.plug_state),),
encoder,
offset,
_depth,
)
}
}
unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<PlugState, D>>
fidl::encoding::Encode<StreamConfigWatchPlugStateResponse, 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::<StreamConfigWatchPlugStateResponse>(offset);
self.0.encode(encoder, offset + 0, depth)?;
Ok(())
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
for StreamConfigWatchPlugStateResponse
{
#[inline(always)]
fn new_empty() -> Self {
Self { plug_state: fidl::new_empty!(PlugState, 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!(PlugState, D, &mut self.plug_state, decoder, offset + 0, _depth)?;
Ok(())
}
}
impl ChannelAttributes {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.max_frequency {
return 2;
}
if let Some(_) = self.min_frequency {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for ChannelAttributes {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ChannelAttributes {
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<ChannelAttributes, D>
for &ChannelAttributes
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ChannelAttributes>(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.min_frequency.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.max_frequency.as_ref().map(<u32 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 ChannelAttributes {
#[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.min_frequency.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.max_frequency.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;
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 ChannelSet {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.attributes {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for ChannelSet {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for ChannelSet {
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<ChannelSet, D>
for &ChannelSet
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<ChannelSet>(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::Vector<ChannelAttributes, 64>, D>(
self.attributes.as_ref().map(<fidl::encoding::Vector<ChannelAttributes, 64> 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 ChannelSet {
#[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::Vector<ChannelAttributes, 64> 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!(fidl::encoding::Vector<ChannelAttributes, 64>, D),
);
fidl::decode!(fidl::encoding::Vector<ChannelAttributes, 64>, 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 CodecFormatInfo {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.turn_off_delay {
return 3;
}
if let Some(_) = self.turn_on_delay {
return 2;
}
if let Some(_) = self.external_delay {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for CodecFormatInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CodecFormatInfo {
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<CodecFormatInfo, D>
for &CodecFormatInfo
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CodecFormatInfo>(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::<i64, D>(
self.external_delay.as_ref().map(<i64 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::<i64, D>(
self.turn_on_delay.as_ref().map(<i64 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::<i64, D>(
self.turn_off_delay.as_ref().map(<i64 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 CodecFormatInfo {
#[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 =
<i64 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.external_delay.get_or_insert_with(|| fidl::new_empty!(i64, D));
fidl::decode!(i64, 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 =
<i64 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.turn_on_delay.get_or_insert_with(|| fidl::new_empty!(i64, D));
fidl::decode!(i64, 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 =
<i64 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.turn_off_delay.get_or_insert_with(|| fidl::new_empty!(i64, D));
fidl::decode!(i64, 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 CodecProperties {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.plug_detect_capabilities {
return 5;
}
if let Some(_) = self.unique_id {
return 4;
}
if let Some(_) = self.product {
return 3;
}
if let Some(_) = self.manufacturer {
return 2;
}
if let Some(_) = self.is_input {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for CodecProperties {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CodecProperties {
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<CodecProperties, D>
for &CodecProperties
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CodecProperties>(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::<bool, D>(
self.is_input.as_ref().map(<bool 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<256>, D>(
self.manufacturer.as_ref().map(
<fidl::encoding::BoundedString<256> 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<256>, D>(
self.product.as_ref().map(
<fidl::encoding::BoundedString<256> 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::Array<u8, 16>, D>(
self.unique_id.as_ref().map(
<fidl::encoding::Array<u8, 16> 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::<PlugDetectCapabilities, D>(
self.plug_detect_capabilities
.as_ref()
.map(<PlugDetectCapabilities 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 CodecProperties {
#[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 =
<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_input.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 < 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<256> 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
.manufacturer
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<256>, D));
fidl::decode!(
fidl::encoding::BoundedString<256>,
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<256> 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
.product
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<256>, D));
fidl::decode!(
fidl::encoding::BoundedString<256>,
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::Array<u8, 16> 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
.unique_id
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 16>, D));
fidl::decode!(fidl::encoding::Array<u8, 16>, 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 =
<PlugDetectCapabilities 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
.plug_detect_capabilities
.get_or_insert_with(|| fidl::new_empty!(PlugDetectCapabilities, D));
fidl::decode!(
PlugDetectCapabilities,
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 CompositeProperties {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.clock_domain {
return 5;
}
if let Some(_) = self.unique_id {
return 4;
}
if let Some(_) = self.product {
return 3;
}
if let Some(_) = self.manufacturer {
return 2;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for CompositeProperties {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for CompositeProperties {
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<CompositeProperties, D>
for &CompositeProperties
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<CompositeProperties>(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 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<256>, D>(
self.manufacturer.as_ref().map(
<fidl::encoding::BoundedString<256> 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<256>, D>(
self.product.as_ref().map(
<fidl::encoding::BoundedString<256> 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::Array<u8, 16>, D>(
self.unique_id.as_ref().map(
<fidl::encoding::Array<u8, 16> 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::<u32, D>(
self.clock_domain.as_ref().map(<u32 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 CompositeProperties {
#[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 < 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<256> 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
.manufacturer
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<256>, D));
fidl::decode!(
fidl::encoding::BoundedString<256>,
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<256> 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
.product
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<256>, D));
fidl::decode!(
fidl::encoding::BoundedString<256>,
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::Array<u8, 16> 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
.unique_id
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 16>, D));
fidl::decode!(fidl::encoding::Array<u8, 16>, 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 =
<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.clock_domain.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;
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 DaiProperties {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.clock_domain {
return 5;
}
if let Some(_) = self.unique_id {
return 4;
}
if let Some(_) = self.product_name {
return 3;
}
if let Some(_) = self.manufacturer {
return 2;
}
if let Some(_) = self.is_input {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for DaiProperties {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DaiProperties {
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<DaiProperties, D>
for &DaiProperties
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DaiProperties>(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::<bool, D>(
self.is_input.as_ref().map(<bool 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<256>, D>(
self.manufacturer.as_ref().map(
<fidl::encoding::BoundedString<256> 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<256>, D>(
self.product_name.as_ref().map(
<fidl::encoding::BoundedString<256> 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::Array<u8, 16>, D>(
self.unique_id.as_ref().map(
<fidl::encoding::Array<u8, 16> 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::<u32, D>(
self.clock_domain.as_ref().map(<u32 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 DaiProperties {
#[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 =
<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_input.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 < 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<256> 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
.manufacturer
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<256>, D));
fidl::decode!(
fidl::encoding::BoundedString<256>,
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<256> 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
.product_name
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<256>, D));
fidl::decode!(
fidl::encoding::BoundedString<256>,
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::Array<u8, 16> 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
.unique_id
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 16>, D));
fidl::decode!(fidl::encoding::Array<u8, 16>, 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 =
<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.clock_domain.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;
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 DelayInfo {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.external_delay {
return 2;
}
if let Some(_) = self.internal_delay {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for DelayInfo {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DelayInfo {
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<DelayInfo, D>
for &DelayInfo
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DelayInfo>(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::<i64, D>(
self.internal_delay.as_ref().map(<i64 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::<i64, D>(
self.external_delay.as_ref().map(<i64 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 DelayInfo {
#[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 =
<i64 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.internal_delay.get_or_insert_with(|| fidl::new_empty!(i64, D));
fidl::decode!(i64, 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 =
<i64 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.external_delay.get_or_insert_with(|| fidl::new_empty!(i64, D));
fidl::decode!(i64, 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 Format {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.pcm_format {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for Format {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for Format {
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<Format, D> for &Format {
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<Format>(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::<PcmFormat, D>(
self.pcm_format
.as_ref()
.map(<PcmFormat 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 Format {
#[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 =
<PcmFormat 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.pcm_format.get_or_insert_with(|| fidl::new_empty!(PcmFormat, D));
fidl::decode!(PcmFormat, 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 GainState {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.gain_db {
return 3;
}
if let Some(_) = self.agc_enabled {
return 2;
}
if let Some(_) = self.muted {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for GainState {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for GainState {
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<GainState, D>
for &GainState
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<GainState>(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::<bool, D>(
self.muted.as_ref().map(<bool 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::<bool, D>(
self.agc_enabled.as_ref().map(<bool 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::<f32, D>(
self.gain_db.as_ref().map(<f32 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 GainState {
#[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 =
<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.muted.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 < 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 =
<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.agc_enabled.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 < 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 =
<f32 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.gain_db.get_or_insert_with(|| fidl::new_empty!(f32, D));
fidl::decode!(f32, 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 HealthState {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.healthy {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for HealthState {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for HealthState {
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<HealthState, D>
for &HealthState
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<HealthState>(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::<bool, D>(
self.healthy.as_ref().map(<bool 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 HealthState {
#[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 =
<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.healthy.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;
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 PcmSupportedFormats {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.frame_rates {
return 5;
}
if let Some(_) = self.valid_bits_per_sample {
return 4;
}
if let Some(_) = self.bytes_per_sample {
return 3;
}
if let Some(_) = self.sample_formats {
return 2;
}
if let Some(_) = self.channel_sets {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for PcmSupportedFormats {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PcmSupportedFormats {
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<PcmSupportedFormats, D>
for &PcmSupportedFormats
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PcmSupportedFormats>(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::Vector<ChannelSet, 64>, D>(
self.channel_sets.as_ref().map(<fidl::encoding::Vector<ChannelSet, 64> 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::Vector<SampleFormat, 3>, D>(
self.sample_formats.as_ref().map(<fidl::encoding::Vector<SampleFormat, 3> 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<u8, 8>, D>(
self.bytes_per_sample.as_ref().map(
<fidl::encoding::Vector<u8, 8> 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::Vector<u8, 8>, D>(
self.valid_bits_per_sample.as_ref().map(
<fidl::encoding::Vector<u8, 8> 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<u32, 64>, D>(
self.frame_rates.as_ref().map(
<fidl::encoding::Vector<u32, 64> 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 PcmSupportedFormats {
#[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::Vector<ChannelSet, 64> 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.channel_sets.get_or_insert_with(
|| fidl::new_empty!(fidl::encoding::Vector<ChannelSet, 64>, D),
);
fidl::decode!(fidl::encoding::Vector<ChannelSet, 64>, 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::Vector<SampleFormat, 3> 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.sample_formats.get_or_insert_with(
|| fidl::new_empty!(fidl::encoding::Vector<SampleFormat, 3>, D),
);
fidl::decode!(fidl::encoding::Vector<SampleFormat, 3>, 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<u8, 8> 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
.bytes_per_sample
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 8>, D));
fidl::decode!(fidl::encoding::Vector<u8, 8>, 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::Vector<u8, 8> 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
.valid_bits_per_sample
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 8>, D));
fidl::decode!(fidl::encoding::Vector<u8, 8>, 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<u32, 64> 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
.frame_rates
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u32, 64>, D));
fidl::decode!(fidl::encoding::Vector<u32, 64>, 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 PlugState {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.plug_state_time {
return 2;
}
if let Some(_) = self.plugged {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for PlugState {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for PlugState {
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<PlugState, D>
for &PlugState
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<PlugState>(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::<bool, D>(
self.plugged.as_ref().map(<bool 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::<i64, D>(
self.plug_state_time.as_ref().map(<i64 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 PlugState {
#[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 =
<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.plugged.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 < 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 =
<i64 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.plug_state_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
fidl::decode!(i64, 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 RingBufferProperties {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.driver_transfer_bytes {
return 5;
}
if let Some(_) = self.turn_on_delay {
return 4;
}
if let Some(_) = self.needs_cache_flush_or_invalidate {
return 3;
}
if let Some(_) = self.fifo_depth {
return 2;
}
if let Some(_) = self.external_delay {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for RingBufferProperties {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for RingBufferProperties {
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<RingBufferProperties, D>
for &RingBufferProperties
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<RingBufferProperties>(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::<i64, D>(
self.external_delay.as_ref().map(<i64 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.fifo_depth.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::<bool, D>(
self.needs_cache_flush_or_invalidate
.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::<i64, D>(
self.turn_on_delay.as_ref().map(<i64 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::<u32, D>(
self.driver_transfer_bytes
.as_ref()
.map(<u32 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 RingBufferProperties {
#[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 =
<i64 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.external_delay.get_or_insert_with(|| fidl::new_empty!(i64, D));
fidl::decode!(i64, 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.fifo_depth.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 =
<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
.needs_cache_flush_or_invalidate
.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 =
<i64 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.turn_on_delay.get_or_insert_with(|| fidl::new_empty!(i64, D));
fidl::decode!(i64, 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 =
<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.driver_transfer_bytes.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;
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 StreamProperties {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.clock_domain {
return 11;
}
if let Some(_) = self.product {
return 10;
}
if let Some(_) = self.manufacturer {
return 9;
}
if let Some(_) = self.plug_detect_capabilities {
return 8;
}
if let Some(_) = self.gain_step_db {
return 7;
}
if let Some(_) = self.max_gain_db {
return 6;
}
if let Some(_) = self.min_gain_db {
return 5;
}
if let Some(_) = self.can_agc {
return 4;
}
if let Some(_) = self.can_mute {
return 3;
}
if let Some(_) = self.is_input {
return 2;
}
if let Some(_) = self.unique_id {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for StreamProperties {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for StreamProperties {
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<StreamProperties, D>
for &StreamProperties
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<StreamProperties>(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::Array<u8, 16>, D>(
self.unique_id.as_ref().map(
<fidl::encoding::Array<u8, 16> 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::<bool, D>(
self.is_input.as_ref().map(<bool 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.can_mute.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::<bool, D>(
self.can_agc.as_ref().map(<bool 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::<f32, D>(
self.min_gain_db.as_ref().map(<f32 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::<f32, D>(
self.max_gain_db.as_ref().map(<f32 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::<f32, D>(
self.gain_step_db.as_ref().map(<f32 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::<PlugDetectCapabilities, D>(
self.plug_detect_capabilities
.as_ref()
.map(<PlugDetectCapabilities 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::<fidl::encoding::BoundedString<256>, D>(
self.manufacturer.as_ref().map(
<fidl::encoding::BoundedString<256> 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::<fidl::encoding::BoundedString<256>, D>(
self.product.as_ref().map(
<fidl::encoding::BoundedString<256> 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::<u32, D>(
self.clock_domain.as_ref().map(<u32 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 StreamProperties {
#[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::Array<u8, 16> 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
.unique_id
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 16>, D));
fidl::decode!(fidl::encoding::Array<u8, 16>, 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 =
<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_input.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 < 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.can_mute.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 =
<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.can_agc.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 < 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 =
<f32 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.min_gain_db.get_or_insert_with(|| fidl::new_empty!(f32, D));
fidl::decode!(f32, 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 =
<f32 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.max_gain_db.get_or_insert_with(|| fidl::new_empty!(f32, D));
fidl::decode!(f32, 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 =
<f32 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.gain_step_db.get_or_insert_with(|| fidl::new_empty!(f32, D));
fidl::decode!(f32, 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 =
<PlugDetectCapabilities 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
.plug_detect_capabilities
.get_or_insert_with(|| fidl::new_empty!(PlugDetectCapabilities, D));
fidl::decode!(
PlugDetectCapabilities,
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 =
<fidl::encoding::BoundedString<256> 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
.manufacturer
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<256>, D));
fidl::decode!(
fidl::encoding::BoundedString<256>,
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 =
<fidl::encoding::BoundedString<256> 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
.product
.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::BoundedString<256>, D));
fidl::decode!(
fidl::encoding::BoundedString<256>,
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 =
<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.clock_domain.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;
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 SupportedFormats {
#[inline(always)]
fn max_ordinal_present(&self) -> u64 {
if let Some(_) = self.pcm_supported_formats {
return 1;
}
0
}
}
impl fidl::encoding::ValueTypeMarker for SupportedFormats {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for SupportedFormats {
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<SupportedFormats, D>
for &SupportedFormats
{
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
mut depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<SupportedFormats>(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::<PcmSupportedFormats, D>(
self.pcm_supported_formats
.as_ref()
.map(<PcmSupportedFormats 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 SupportedFormats {
#[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 =
<PcmSupportedFormats 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
.pcm_supported_formats
.get_or_insert_with(|| fidl::new_empty!(PcmSupportedFormats, D));
fidl::decode!(PcmSupportedFormats, 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 DaiFrameFormat {
type Borrowed<'a> = &'a Self;
fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
value
}
}
unsafe impl fidl::encoding::TypeMarker for DaiFrameFormat {
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<DaiFrameFormat, D>
for &DaiFrameFormat
{
#[inline]
unsafe fn encode(
self,
encoder: &mut fidl::encoding::Encoder<'_, D>,
offset: usize,
_depth: fidl::encoding::Depth,
) -> fidl::Result<()> {
encoder.debug_check_bounds::<DaiFrameFormat>(offset);
encoder.write_num::<u64>(self.ordinal(), offset);
match self {
DaiFrameFormat::FrameFormatStandard(ref val) => {
fidl::encoding::encode_in_envelope::<DaiFrameFormatStandard, D>(
<DaiFrameFormatStandard as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
DaiFrameFormat::FrameFormatCustom(ref val) => {
fidl::encoding::encode_in_envelope::<DaiFrameFormatCustom, D>(
<DaiFrameFormatCustom as fidl::encoding::ValueTypeMarker>::borrow(val),
encoder,
offset + 8,
_depth,
)
}
}
}
}
impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DaiFrameFormat {
#[inline(always)]
fn new_empty() -> Self {
Self::FrameFormatStandard(fidl::new_empty!(DaiFrameFormatStandard, 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 => <DaiFrameFormatStandard as fidl::encoding::TypeMarker>::inline_size(
decoder.context,
),
2 => <DaiFrameFormatCustom 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 DaiFrameFormat::FrameFormatStandard(_) = self {
} else {
*self = DaiFrameFormat::FrameFormatStandard(fidl::new_empty!(
DaiFrameFormatStandard,
D
));
}
#[allow(irrefutable_let_patterns)]
if let DaiFrameFormat::FrameFormatStandard(ref mut val) = self {
fidl::decode!(
DaiFrameFormatStandard,
D,
val,
decoder,
_inner_offset,
depth
)?;
} else {
unreachable!()
}
}
2 => {
#[allow(irrefutable_let_patterns)]
if let DaiFrameFormat::FrameFormatCustom(_) = self {
} else {
*self = DaiFrameFormat::FrameFormatCustom(fidl::new_empty!(
DaiFrameFormatCustom,
D
));
}
#[allow(irrefutable_let_patterns)]
if let DaiFrameFormat::FrameFormatCustom(ref mut val) = self {
fidl::decode!(DaiFrameFormatCustom, 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(())
}
}
}