pub trait Interner {
// Required methods
fn is_empty(&self) -> bool;
fn len(&self) -> usize;
fn len_bytes(&self) -> usize;
fn capacity_bytes(&self) -> usize;
fn try_intern(&self, s: &str) -> Option<InternedString>;
}Expand description
A string interner.
Required Methods§
Sourcefn capacity_bytes(&self) -> usize
fn capacity_bytes(&self) -> usize
Returns the total number of bytes the interner can hold.
Sourcefn try_intern(&self, s: &str) -> Option<InternedString>
fn try_intern(&self, s: &str) -> Option<InternedString>
Attempts to intern the given string.
Returns None if the interner is full or the string can’t fit.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".