Struct rodio::Device[][src]

pub struct Device(_);
Expand description

The Device implementation associated with the platform’s dynamically dispatched Host type.

Trait Implementations

impl DeviceTrait for Device[src]

type SupportedInputConfigs = SupportedInputConfigs

The iterator type yielding supported input stream formats.

type SupportedOutputConfigs = SupportedOutputConfigs

The iterator type yielding supported output stream formats.

type Stream = Stream

The stream type created by build_input_stream_raw and build_output_stream_raw.

pub fn name(&self) -> Result<String, DeviceNameError>[src]

The human-readable name of the device.

pub fn supported_input_configs(
    &self
) -> Result<<Device as DeviceTrait>::SupportedInputConfigs, SupportedStreamConfigsError>
[src]

An iterator yielding formats that are supported by the backend. Read more

pub fn supported_output_configs(
    &self
) -> Result<<Device as DeviceTrait>::SupportedOutputConfigs, SupportedStreamConfigsError>
[src]

An iterator yielding output stream formats that are supported by the device. Read more

pub fn default_input_config(
    &self
) -> Result<SupportedStreamConfig, DefaultStreamConfigError>
[src]

The default input stream format for the device.

pub fn default_output_config(
    &self
) -> Result<SupportedStreamConfig, DefaultStreamConfigError>
[src]

The default output stream format for the device.

pub fn build_input_stream_raw<D, E>(
    &self,
    config: &StreamConfig,
    sample_format: SampleFormat,
    data_callback: D,
    error_callback: E
) -> Result<<Device as DeviceTrait>::Stream, BuildStreamError> where
    D: FnMut(&Data, &InputCallbackInfo) + Send + 'static,
    E: FnMut(StreamError) + Send + 'static, 
[src]

Create a dynamically typed input stream.

pub fn build_output_stream_raw<D, E>(
    &self,
    config: &StreamConfig,
    sample_format: SampleFormat,
    data_callback: D,
    error_callback: E
) -> Result<<Device as DeviceTrait>::Stream, BuildStreamError> where
    D: FnMut(&mut Data, &OutputCallbackInfo) + Send + 'static,
    E: FnMut(StreamError) + Send + 'static, 
[src]

Create a dynamically typed output stream.

fn build_input_stream<T, D, E>(
    &self,
    config: &StreamConfig,
    data_callback: D,
    error_callback: E
) -> Result<Self::Stream, BuildStreamError> where
    D: FnMut(&[T], &InputCallbackInfo) + Send + 'static,
    T: Sample,
    E: FnMut(StreamError) + Send + 'static, 
[src]

Create an input stream.

fn build_output_stream<T, D, E>(
    &self,
    config: &StreamConfig,
    data_callback: D,
    error_callback: E
) -> Result<Self::Stream, BuildStreamError> where
    D: FnMut(&mut [T], &OutputCallbackInfo) + Send + 'static,
    T: Sample,
    E: FnMut(StreamError) + Send + 'static, 
[src]

Create an output stream.

impl From<Device> for Device[src]

pub fn from(h: Device) -> Device[src]

Performs the conversion.

impl From<DeviceInner> for Device[src]

pub fn from(d: DeviceInner) -> Device[src]

Performs the conversion.

Auto Trait Implementations

impl !RefUnwindSafe for Device

impl Send for Device

impl Sync for Device

impl Unpin for Device

impl UnwindSafe for Device

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.