StringInternerTrait

Trait StringInternerTrait 

Source
pub trait StringInternerTrait {
    // Required method
    fn get_or_intern(&self, s: &str) -> Arc<str>;
}
Expand description

Trait for string interning functionality.

This trait abstracts over string interner implementations, allowing MessageMetadata to work with any interner type. The streamweave-graph package provides a concrete StringInterner implementation that implements this trait.

Required Methods§

Source

fn get_or_intern(&self, s: &str) -> Arc<str>

Get an interned string, or intern a new one if it doesn’t exist.

§Arguments
  • s - The string to intern or retrieve
§Returns

An Arc<str> containing the interned string

Implementors§