pub struct Device(/* private fields */);Expand description
The Device implementation associated with the platform’s dynamically dispatched
Host type.
Implementations§
Source§impl Device
impl Device
Sourcepub fn as_inner(&self) -> &DeviceInner
pub fn as_inner(&self) -> &DeviceInner
Returns a reference to the underlying platform specific implementation of this
Device.
Sourcepub fn as_inner_mut(&mut self) -> &mut DeviceInner
pub fn as_inner_mut(&mut self) -> &mut DeviceInner
Returns a mutable reference to the underlying platform specific implementation of
this Device.
Sourcepub fn into_inner(self) -> DeviceInner
pub fn into_inner(self) -> DeviceInner
Returns the underlying platform specific implementation of this Device.
Trait Implementations§
Source§impl DeviceTrait for Device
impl DeviceTrait for Device
Source§type SupportedInputConfigs = SupportedInputConfigs
type SupportedInputConfigs = SupportedInputConfigs
The iterator type yielding supported input stream formats.
Source§type SupportedOutputConfigs = SupportedOutputConfigs
type SupportedOutputConfigs = SupportedOutputConfigs
The iterator type yielding supported output stream formats.
Source§type Stream = Stream
type Stream = Stream
The stream type created by
build_input_stream_raw and build_output_stream_raw.Source§fn name(&self) -> Result<String, DeviceNameError>
fn name(&self) -> Result<String, DeviceNameError>
👎Deprecated since 0.17.0:
Use description() for comprehensive device information including name, manufacturer, and device type. Use id() for a unique, stable device identifier that persists across reboots and reconnections.
The human-readable name of the device.
Source§fn description(&self) -> Result<DeviceDescription, DeviceNameError>
fn description(&self) -> Result<DeviceDescription, DeviceNameError>
Structured description of the device with metadata. Read more
Source§fn supports_input(&self) -> bool
fn supports_input(&self) -> bool
True if the device supports audio input, otherwise false
Source§fn supports_output(&self) -> bool
fn supports_output(&self) -> bool
True if the device supports audio output, otherwise false
Source§fn supported_input_configs(
&self,
) -> Result<Self::SupportedInputConfigs, SupportedStreamConfigsError>
fn supported_input_configs( &self, ) -> Result<Self::SupportedInputConfigs, SupportedStreamConfigsError>
An iterator yielding formats that are supported by the backend. Read more
Source§fn supported_output_configs(
&self,
) -> Result<Self::SupportedOutputConfigs, SupportedStreamConfigsError>
fn supported_output_configs( &self, ) -> Result<Self::SupportedOutputConfigs, SupportedStreamConfigsError>
An iterator yielding output stream formats that are supported by the device. Read more
Source§fn default_input_config(
&self,
) -> Result<SupportedStreamConfig, DefaultStreamConfigError>
fn default_input_config( &self, ) -> Result<SupportedStreamConfig, DefaultStreamConfigError>
The default input stream format for the device.
Source§fn default_output_config(
&self,
) -> Result<SupportedStreamConfig, DefaultStreamConfigError>
fn default_output_config( &self, ) -> Result<SupportedStreamConfig, DefaultStreamConfigError>
The default output stream format for the device.
Source§fn build_input_stream_raw<D, E>(
&self,
config: &StreamConfig,
sample_format: SampleFormat,
data_callback: D,
error_callback: E,
timeout: Option<Duration>,
) -> Result<Self::Stream, BuildStreamError>
fn build_input_stream_raw<D, E>( &self, config: &StreamConfig, sample_format: SampleFormat, data_callback: D, error_callback: E, timeout: Option<Duration>, ) -> Result<Self::Stream, BuildStreamError>
Create a dynamically typed input stream. Read more
Source§fn build_output_stream_raw<D, E>(
&self,
config: &StreamConfig,
sample_format: SampleFormat,
data_callback: D,
error_callback: E,
timeout: Option<Duration>,
) -> Result<Self::Stream, BuildStreamError>where
D: FnMut(&mut Data, &OutputCallbackInfo) + Send + 'static,
E: FnMut(StreamError) + Send + 'static,
fn build_output_stream_raw<D, E>(
&self,
config: &StreamConfig,
sample_format: SampleFormat,
data_callback: D,
error_callback: E,
timeout: Option<Duration>,
) -> Result<Self::Stream, BuildStreamError>where
D: FnMut(&mut Data, &OutputCallbackInfo) + Send + 'static,
E: FnMut(StreamError) + Send + 'static,
Create a dynamically typed output stream. Read more
Source§fn build_input_stream<T, D, E>(
&self,
config: &StreamConfig,
data_callback: D,
error_callback: E,
timeout: Option<Duration>,
) -> Result<Self::Stream, BuildStreamError>where
T: SizedSample,
D: FnMut(&[T], &InputCallbackInfo) + Send + 'static,
E: FnMut(StreamError) + Send + 'static,
fn build_input_stream<T, D, E>(
&self,
config: &StreamConfig,
data_callback: D,
error_callback: E,
timeout: Option<Duration>,
) -> Result<Self::Stream, BuildStreamError>where
T: SizedSample,
D: FnMut(&[T], &InputCallbackInfo) + Send + 'static,
E: FnMut(StreamError) + Send + 'static,
Create an input stream. Read more
Source§fn build_output_stream<T, D, E>(
&self,
config: &StreamConfig,
data_callback: D,
error_callback: E,
timeout: Option<Duration>,
) -> Result<Self::Stream, BuildStreamError>where
T: SizedSample,
D: FnMut(&mut [T], &OutputCallbackInfo) + Send + 'static,
E: FnMut(StreamError) + Send + 'static,
fn build_output_stream<T, D, E>(
&self,
config: &StreamConfig,
data_callback: D,
error_callback: E,
timeout: Option<Duration>,
) -> Result<Self::Stream, BuildStreamError>where
T: SizedSample,
D: FnMut(&mut [T], &OutputCallbackInfo) + Send + 'static,
E: FnMut(StreamError) + Send + 'static,
Create an output stream. Read more
Source§impl From<DeviceInner> for Device
impl From<DeviceInner> for Device
Source§fn from(d: DeviceInner) -> Self
fn from(d: DeviceInner) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Device
impl RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl UnsafeUnpin for Device
impl UnwindSafe for Device
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more