pub struct SttContextPool { /* private fields */ }Expand description
STT context residency + singleflight loader (JOE-1784).
Own one per crate::AurumEngine, or share via process_global_stt_pool.
Implementations§
Source§impl SttContextPool
impl SttContextPool
pub fn new() -> Self
Sourcepub fn resident_len(&self) -> usize
pub fn resident_len(&self) -> usize
Number of resident (loaded) contexts in this pool.
Sourcepub fn get_or_load_pin(
&self,
model_path: &Path,
model_name: &str,
gov: &Arc<ResourceGovernor>,
) -> Result<RegistryPin<WhisperContext>>
pub fn get_or_load_pin( &self, model_path: &Path, model_name: &str, gov: &Arc<ResourceGovernor>, ) -> Result<RegistryPin<WhisperContext>>
Load or reuse a context and return an active registry pin held for the whole operation (JOE-1646). No unpinned Arc is returned to callers.
pub fn get_or_load( &self, model_path: &Path, model_name: &str, gov: &Arc<ResourceGovernor>, ) -> Result<Arc<WhisperContext>>
pub fn contains(&self, model_path: &Path, model_name: &str) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SttContextPool
impl RefUnwindSafe for SttContextPool
impl Send for SttContextPool
impl Sync for SttContextPool
impl Unpin for SttContextPool
impl UnsafeUnpin for SttContextPool
impl UnwindSafe for SttContextPool
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more