[−][src]Trait rodio::DeviceTrait
A device that is capable of audio input and/or output.
Please note that Device
s may become invalid if they get disconnected. Therefore all the
methods that involve a device return a Result
allowing the user to handle this case.
Associated Types
type SupportedInputFormats: Iterator
The iterator type yielding supported input stream formats.
type SupportedOutputFormats: Iterator
The iterator type yielding supported output stream formats.
Required methods
fn name(&self) -> Result<String, DeviceNameError>
The human-readable name of the device.
fn supported_input_formats(
&self
) -> Result<Self::SupportedInputFormats, SupportedFormatsError>
&self
) -> Result<Self::SupportedInputFormats, SupportedFormatsError>
An iterator yielding formats that are supported by the backend.
Can return an error if the device is no longer valid (eg. it has been disconnected).
fn supported_output_formats(
&self
) -> Result<Self::SupportedOutputFormats, SupportedFormatsError>
&self
) -> Result<Self::SupportedOutputFormats, SupportedFormatsError>
An iterator yielding output stream formats that are supported by the device.
Can return an error if the device is no longer valid (eg. it has been disconnected).
fn default_input_format(&self) -> Result<Format, DefaultFormatError>
The default input stream format for the device.
fn default_output_format(&self) -> Result<Format, DefaultFormatError>
The default output stream format for the device.
Implementations on Foreign Types
impl DeviceTrait for Device
[src]
type SupportedInputFormats = IntoIter<SupportedFormat>
type SupportedOutputFormats = IntoIter<SupportedFormat>
fn name(&self) -> Result<String, DeviceNameError>
[src]
fn supported_input_formats(
&self
) -> Result<<Device as DeviceTrait>::SupportedInputFormats, SupportedFormatsError>
[src]
&self
) -> Result<<Device as DeviceTrait>::SupportedInputFormats, SupportedFormatsError>
fn supported_output_formats(
&self
) -> Result<<Device as DeviceTrait>::SupportedOutputFormats, SupportedFormatsError>
[src]
&self
) -> Result<<Device as DeviceTrait>::SupportedOutputFormats, SupportedFormatsError>
fn default_input_format(&self) -> Result<Format, DefaultFormatError>
[src]
fn default_output_format(&self) -> Result<Format, DefaultFormatError>
[src]
Implementors
impl DeviceTrait for rodio::Device
[src]
type SupportedInputFormats = SupportedInputFormats
type SupportedOutputFormats = SupportedOutputFormats
fn name(&self) -> Result<String, DeviceNameError>
[src]
fn supported_input_formats(
&self
) -> Result<<Device as DeviceTrait>::SupportedInputFormats, SupportedFormatsError>
[src]
&self
) -> Result<<Device as DeviceTrait>::SupportedInputFormats, SupportedFormatsError>
fn supported_output_formats(
&self
) -> Result<<Device as DeviceTrait>::SupportedOutputFormats, SupportedFormatsError>
[src]
&self
) -> Result<<Device as DeviceTrait>::SupportedOutputFormats, SupportedFormatsError>