[][src]Struct string_interner::backend::BucketBackend

pub struct BucketBackend<S> { /* fields omitted */ }

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.

ScenarioRating
Fillgood
Resolveok
Allocationsgood
Footprintok
Supports get_or_intern_staticyes
Send + Syncyes

Trait Implementations

impl<S> Backend<S> for BucketBackend<S> where
    S: Symbol
[src]

impl<S> Clone for BucketBackend<S> where
    S: Symbol
[src]

impl<S: Debug> Debug for BucketBackend<S>[src]

impl<S> Default for BucketBackend<S>[src]

impl<S> Eq for BucketBackend<S> where
    S: Symbol
[src]

impl<'a, S> IntoIterator for &'a BucketBackend<S> where
    S: Symbol
[src]

type Item = (S, &'a str)

The type of the elements being iterated over.

type IntoIter = Iter<'a, S>

Which kind of iterator are we turning this into?

impl<S> PartialEq<BucketBackend<S>> for BucketBackend<S> where
    S: Symbol
[src]

impl<S> Send for BucketBackend<S> where
    S: Symbol
[src]

Safety

The bucket backend requires a manual Send impl because it is self referential. When cloning a bucket backend a deep clone is performed and all references to itself are updated for the clone.

impl<S> Sync for BucketBackend<S> where
    S: Symbol
[src]

Safety

The bucket backend requires a manual Send impl because it is self referential. Those references won't escape its own scope and also the bucket backend has no interior mutability.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.