Struct astral_string::Subsystem
pub struct Subsystem<H = BuildHasherDefault<Murmur3>> { /* private fields */ }
Expand description
Manages optimized string allocation.
See the module-level documentation for more.
Implementations
impl Subsystem<BuildHasherDefault<Murmur3>>
impl Subsystem<BuildHasherDefault<Murmur3>>
impl<H> Subsystem<H>where
H: BuildHasher,
impl<H> Subsystem<H>where
H: BuildHasher,
pub fn with_hasher(max_strings: usize, parent_logger: &Logger, hasher: H) -> Self
pub fn with_hasher(max_strings: usize, parent_logger: &Logger, hasher: H) -> Self
Initialize the string subsystem with the specified capacity for unique strings, and a hasher.
Example
use std::hash::BuildHasherDefault;
use astral::{
util::hash::Murmur3,
string::{self, Text},
};
let hasher = BuildHasherDefault::<Murmur3>::default();
let string_subsystem = string::Subsystem::with_hasher(64, &logger, hasher);
let text = Text::new("foo", &string_subsystem);
assert_eq!(text, "foo");
Trait Implementations
Auto Trait Implementations
impl<H = BuildHasherDefault<Murmur3>> !RefUnwindSafe for Subsystem<H>
impl<H> Unpin for Subsystem<H>where
H: Unpin,
impl<H> UnwindSafe for Subsystem<H>where
H: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more