pub struct ThreadSafeModelManager { /* private fields */ }Expand description
Thread-safe model manager for voice conversion
Implementations§
Source§impl ThreadSafeModelManager
impl ThreadSafeModelManager
Sourcepub async fn get_model(
&self,
conversion_type: &ConversionType,
) -> Result<Option<Arc<ConversionModel>>>
pub async fn get_model( &self, conversion_type: &ConversionType, ) -> Result<Option<Arc<ConversionModel>>>
Get model with thread-safe access and cache management
Sourcepub async fn get_stats(&self) -> ModelAccessStats
pub async fn get_stats(&self) -> ModelAccessStats
Get current model access statistics snapshot
Sourcepub async fn clear_cache(&self)
pub async fn clear_cache(&self)
Clear all cached models from memory and update statistics
Sourcepub async fn cleanup_unused_models(&self, max_idle_time: Duration)
pub async fn cleanup_unused_models(&self, max_idle_time: Duration)
Perform periodic cleanup of models that have been idle beyond specified duration
Auto Trait Implementations§
impl Freeze for ThreadSafeModelManager
impl !RefUnwindSafe for ThreadSafeModelManager
impl Send for ThreadSafeModelManager
impl Sync for ThreadSafeModelManager
impl Unpin for ThreadSafeModelManager
impl UnsafeUnpin for ThreadSafeModelManager
impl !UnwindSafe for ThreadSafeModelManager
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