pub struct IRI_INTERNER { /* private fields */ }Expand description
Global interner for IRI strings
Methods from Deref<Target = StringInterner>§
Sourcepub fn intern(&self, s: &str) -> Arc<str>
pub fn intern(&self, s: &str) -> Arc<str>
Intern a string, returning an Arc<str> that can be cheaply cloned and compared
This operation is tracked with SciRS2 metrics:
- Cache hits/misses
- Operation timing
- String length distribution
Sourcepub fn intern_with_id(&self, s: &str) -> (Arc<str>, u32)
pub fn intern_with_id(&self, s: &str) -> (Arc<str>, u32)
Intern a string and return both the Arc<str> and its numeric ID
Sourcepub fn get_all_mappings(&self) -> Vec<(u32, Arc<str>)>
pub fn get_all_mappings(&self) -> Vec<(u32, Arc<str>)>
Get all ID mappings (useful for serialization/debugging)
Sourcepub fn cleanup(&self) -> usize
pub fn cleanup(&self) -> usize
Clean up expired weak references to save memory
Returns the number of entries cleaned up
Sourcepub fn stats(&self) -> InternerStats
pub fn stats(&self) -> InternerStats
Get current statistics
Sourcepub fn id_mapping_count(&self) -> usize
pub fn id_mapping_count(&self) -> usize
Get the number of strings with ID mappings
Sourcepub fn intern_batch(&self, strings: &[&str]) -> Vec<Arc<str>>
pub fn intern_batch(&self, strings: &[&str]) -> Vec<Arc<str>>
Batch intern multiple strings for improved performance
Returns a Vec of Arc<str> in the same order as input
Sourcepub fn prefetch(&self, strings: &[&str])
pub fn prefetch(&self, strings: &[&str])
Prefetch strings into the interner cache for improved performance This is useful when you know you’ll need certain strings soon
Sourcepub fn memory_usage(&self) -> MemoryUsage
pub fn memory_usage(&self) -> MemoryUsage
Get memory usage statistics for performance monitoring
Sourcepub fn get_metrics(&self) -> InternerMetrics
pub fn get_metrics(&self) -> InternerMetrics
Get comprehensive performance metrics from SciRS2
Returns detailed statistics including:
- Cache hit/miss counts and ratios
- Operation timing statistics
- String length distribution
- Memory usage patterns
Trait Implementations§
Source§impl Deref for IRI_INTERNER
impl Deref for IRI_INTERNER
Source§type Target = StringInterner
type Target = StringInterner
Source§fn deref(&self) -> &StringInterner
fn deref(&self) -> &StringInterner
impl LazyStatic for IRI_INTERNER
Auto Trait Implementations§
impl Freeze for IRI_INTERNER
impl RefUnwindSafe for IRI_INTERNER
impl Send for IRI_INTERNER
impl Sync for IRI_INTERNER
impl Unpin for IRI_INTERNER
impl UnsafeUnpin for IRI_INTERNER
impl UnwindSafe for IRI_INTERNER
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
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>
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>
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