Struct string_interner::backend::BucketBackend [−][src]
pub struct BucketBackend<S> { /* fields omitted */ }
Expand description
An interner backend that reduces memory allocations by using string buckets.
Note
Implementation inspired by matklad’s blog post that can be found here: https://matklad.github.io/2020/03/22/fast-simple-rust-interner.html
Usage
- Fill: Efficiency of filling an empty string interner.
- Resolve: Efficiency of interned string look-up given a symbol.
- Allocations: The number of allocations performed by the backend.
- Footprint: The total heap memory consumed by the backend.
Rating varies between bad, ok and good.
Scenario | Rating |
---|---|
Fill | good |
Resolve | ok |
Allocations | good |
Footprint | ok |
Supports get_or_intern_static | yes |
Send + Sync | yes |
Trait Implementations
Creates a new backend for the given capacity. Read more
Interns the given string and returns its interned ref and symbol. Read more
Interns the given static string and returns its interned ref and symbol. Read more
Shrink backend capacity to fit interned symbols exactly.
Resolves the given symbol to its original string contents.
Resolves the given symbol to its original string contents. Read more
Auto Trait Implementations
impl<S> RefUnwindSafe for BucketBackend<S>
impl<S> Unpin for BucketBackend<S>
impl<S> UnwindSafe for BucketBackend<S>
Blanket Implementations
Mutably borrows from an owned value. Read more