pub struct DistributionCache { /* private fields */ }Expand description
Cache for distribution sampling operations
Implementations§
Source§impl DistributionCache
impl DistributionCache
Sourcepub fn get_or_compute_samples<F>(
&self,
id: Uuid,
sample_count: usize,
compute: F,
) -> Vec<f64>
pub fn get_or_compute_samples<F>( &self, id: Uuid, sample_count: usize, compute: F, ) -> Vec<f64>
Cache samples for reuse
Sourcepub fn get_or_compute_pdf_kde<F>(
&self,
id: Uuid,
sample_count: usize,
x: f64,
bandwidth: f64,
compute: F,
) -> f64
pub fn get_or_compute_pdf_kde<F>( &self, id: Uuid, sample_count: usize, x: f64, bandwidth: f64, compute: F, ) -> f64
Cache PDF KDE computation
Sourcepub fn cleanup_all_expired(&self)
pub fn cleanup_all_expired(&self)
Clean up expired entries
Sourcepub fn overall_stats(&self) -> CacheStats
pub fn overall_stats(&self) -> CacheStats
Get overall cache statistics across all distribution caches
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DistributionCache
impl RefUnwindSafe for DistributionCache
impl Send for DistributionCache
impl Sync for DistributionCache
impl Unpin for DistributionCache
impl UnsafeUnpin for DistributionCache
impl UnwindSafe for DistributionCache
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