pub trait StreamingAsrEngine: Send + Sync {
// Required method
fn begin_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
opts: &'life1 StreamingOptions,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn StreamingSession>, AsrError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
}Expand description
Streaming ASR engine — feeds audio incrementally.
The contract:
- Caller invokes
begin_streamonce. - Caller repeatedly invokes
transcribe_chunkwith successive audio buffers. - Caller invokes
finalize_streamonce at end-of-stream and discards the engine.
Engines that don’t support streaming do not implement this trait;
the crate::AsrEngine::transcribe whole-buffer fallback
remains available.
Required Methods§
Sourcefn begin_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
opts: &'life1 StreamingOptions,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn StreamingSession>, AsrError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn begin_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
opts: &'life1 StreamingOptions,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn StreamingSession>, AsrError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Start a new streaming session. Returns an opaque handle the caller passes to subsequent calls.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".