pub struct Output { /* private fields */ }Expand description
An open output. The callback runs until it is dropped.
Implementations§
Source§impl Output
impl Output
Sourcepub fn preferred_rate() -> Option<u32>
pub fn preferred_rate() -> Option<u32>
The rate the device runs at, if there is one to ask: a mix at that rate needs no conversion on its way out.
Sourcepub fn open(
config: OutputConfig,
callback: impl FnMut(&mut [i16]) + Send + 'static,
) -> Result<Self, OutputError>
pub fn open( config: OutputConfig, callback: impl FnMut(&mut [i16]) + Send + 'static, ) -> Result<Self, OutputError>
Opens the system’s output, or says why it can’t.
Sourcepub fn null(
config: OutputConfig,
callback: impl FnMut(&mut [i16]) + Send + 'static,
) -> Self
pub fn null( config: OutputConfig, callback: impl FnMut(&mut [i16]) + Send + 'static, ) -> Self
An output that calls callback on a timer and discards what it gives.
Sourcepub fn open_or_null(
config: OutputConfig,
callback: impl FnMut(&mut [i16]) + Send + 'static,
) -> (Self, Option<OutputError>)
pub fn open_or_null( config: OutputConfig, callback: impl FnMut(&mut [i16]) + Send + 'static, ) -> (Self, Option<OutputError>)
The system’s output, or, if it won’t open, null and why: no
sound rather than a crash, and the caller’s to say once.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Output
impl !UnwindSafe for Output
impl Freeze for Output
impl Send for Output
impl Sync for Output
impl Unpin for Output
impl UnsafeUnpin for Output
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