pub struct Subsystem<H = BuildHasherDefault<Murmur3>> { /* private fields */ }
Expand description

Manages optimized string allocation.

See the module-level documentation for more.

Implementations

Initialize the string subsystem with the specified capacity for unique strings.

Example
use astral::string;

let string_subsystem = string::Subsystem::new(64, &logger);

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");

Returns the logger of this string subsystem.

Example
use slog::info;

use astral::string;

let string_subsystem = string::Subsystem::new(64, &logger);

info!(string_subsystem.logger(), "foo bar"; "additional" => "information");

Trait Implementations

Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.