pub struct StreamHandle { /* private fields */ }Expand description
A handle to an opened RtAudio stream.
When this struct is dropped, the stream will automatically be stopped and closed.
Only one stream can exist at a time.
Implementations§
Source§impl StreamHandle
impl StreamHandle
Sourcepub fn info(&self) -> &StreamInfo
pub fn info(&self) -> &StreamInfo
Information about the stream.
Sourcepub fn has_started(&self) -> bool
pub fn has_started(&self) -> bool
Returns true if the stream has been started.
Sourcepub fn start<F>(&mut self, data_callback: F) -> Result<(), RtAudioError>
pub fn start<F>(&mut self, data_callback: F) -> Result<(), RtAudioError>
Start the stream.
data_callback- This gets called whenever there are new buffers to process.
If an error is returned, then it means that the stream failed to start.
§Panics
Panics if the stream has already been started. (Use
StreamHandle::has_started to check if it has been started already.)
Trait Implementations§
Source§impl Drop for StreamHandle
impl Drop for StreamHandle
Auto Trait Implementations§
impl !RefUnwindSafe for StreamHandle
impl !Send for StreamHandle
impl !Sync for StreamHandle
impl !UnwindSafe for StreamHandle
impl Freeze for StreamHandle
impl Unpin for StreamHandle
impl UnsafeUnpin for StreamHandle
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