pub struct ConversionCacheSystem { /* private fields */ }Expand description
Multi-level cache system for voice conversion operations
Implementations§
Source§impl ConversionCacheSystem
impl ConversionCacheSystem
Sourcepub fn with_config(config: CacheConfig) -> Self
pub fn with_config(config: CacheConfig) -> Self
Create a new cache system with custom configuration
Sourcepub fn store(
&self,
key: String,
data: CachedData,
item_type: CacheItemType,
) -> Result<()>
pub fn store( &self, key: String, data: CachedData, item_type: CacheItemType, ) -> Result<()>
Store an item in the cache
Sourcepub fn retrieve(&self, key: &str) -> Option<CachedData>
pub fn retrieve(&self, key: &str) -> Option<CachedData>
Retrieve an item from the cache
Sourcepub fn get_statistics(&self) -> CacheStatistics
pub fn get_statistics(&self) -> CacheStatistics
Get cache statistics
Sourcepub fn create_cache_key(
&self,
conversion_type: &ConversionType,
audio_hash: u64,
target_hash: u64,
quality_level: u8,
) -> String
pub fn create_cache_key( &self, conversion_type: &ConversionType, audio_hash: u64, target_hash: u64, quality_level: u8, ) -> String
Create a cache key from conversion parameters
Sourcepub fn hash_audio_data(&self, audio: &[f32]) -> u64
pub fn hash_audio_data(&self, audio: &[f32]) -> u64
Generate hash for audio data
Trait Implementations§
Source§impl Debug for ConversionCacheSystem
impl Debug for ConversionCacheSystem
Auto Trait Implementations§
impl Freeze for ConversionCacheSystem
impl RefUnwindSafe for ConversionCacheSystem
impl Send for ConversionCacheSystem
impl Sync for ConversionCacheSystem
impl Unpin for ConversionCacheSystem
impl UnsafeUnpin for ConversionCacheSystem
impl UnwindSafe for ConversionCacheSystem
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