Struct rodio::OutputStream
source · pub struct OutputStream { /* private fields */ }
Expand description
cpal::Stream
container. Also see the more useful OutputStreamHandle
.
If this is dropped playback will end & attached OutputStreamHandle
s will no longer work.
Implementations§
source§impl OutputStream
impl OutputStream
sourcepub fn try_from_device(
device: &Device
) -> Result<(Self, OutputStreamHandle), StreamError>
pub fn try_from_device( device: &Device ) -> Result<(Self, OutputStreamHandle), StreamError>
Returns a new stream & handle using the given output device and the default output configuration.
sourcepub fn try_from_device_config(
device: &Device,
config: SupportedStreamConfig
) -> Result<(Self, OutputStreamHandle), StreamError>
pub fn try_from_device_config( device: &Device, config: SupportedStreamConfig ) -> Result<(Self, OutputStreamHandle), StreamError>
Returns a new stream & handle using the given device and stream config.
If the supplied SupportedStreamConfig
is invalid for the device this function will
fail to create an output stream and instead return a StreamError
sourcepub fn try_default() -> Result<(Self, OutputStreamHandle), StreamError>
pub fn try_default() -> Result<(Self, OutputStreamHandle), StreamError>
Return a new stream & handle using the default output device.
On failure will fallback to trying any non-default output devices.
Auto Trait Implementations§
impl !RefUnwindSafe for OutputStream
impl !Send for OutputStream
impl !Sync for OutputStream
impl Unpin for OutputStream
impl !UnwindSafe for OutputStream
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