Trait AsyncCaptureBufferStream

Source
pub trait AsyncCaptureBufferStream: Send {
    // Required method
    fn next_capture_buffer<'a, 'life0, 'async_trait>(
        &'a mut self,
        _ex: &'life0 dyn AudioStreamsExecutor,
    ) -> Pin<Box<dyn Future<Output = Result<AsyncCaptureBuffer<'a>, BoxError>> + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn start(&mut self) -> Result<(), BoxError> { ... }
    fn stop(&mut self) -> Result<(), BoxError> { ... }
}

Required Methods§

Source

fn next_capture_buffer<'a, 'life0, 'async_trait>( &'a mut self, _ex: &'life0 dyn AudioStreamsExecutor, ) -> Pin<Box<dyn Future<Output = Result<AsyncCaptureBuffer<'a>, BoxError>> + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn start(&mut self) -> Result<(), BoxError>

Starts the capture stream.

For stream implementations that require explicit lifecycle management or authorization (e.g. AAudio on Android), this method is called to initiate the stream. It must return promptly and must not wait for external events (such as a user permission prompt), because no capture periods are produced while it runs. Default implementation is a no-op.

Source

fn stop(&mut self) -> Result<(), BoxError>

Stops the capture stream.

Like start(), it must return promptly. Default implementation is a no-op.

Implementations on Foreign Types§

Source§

impl<S: AsyncCaptureBufferStream + ?Sized> AsyncCaptureBufferStream for &mut S

Source§

fn next_capture_buffer<'a, 'life0, 'async_trait>( &'a mut self, ex: &'life0 dyn AudioStreamsExecutor, ) -> Pin<Box<dyn Future<Output = Result<AsyncCaptureBuffer<'a>, BoxError>> + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Source§

fn start(&mut self) -> Result<(), BoxError>

Source§

fn stop(&mut self) -> Result<(), BoxError>

Implementors§