StringStorage

Trait StringStorage 

Source
pub trait StringStorage: Clone + Display {
    type Span: Copy + Debug + PartialEq + Eq + Hash;
}
Expand description

Trait for string storage types.

This trait abstracts over different string storage strategies, enabling both zero-copy parsing (with borrowed data) and owned data representations.

§Implementors

  • String - Owned string data
  • Segments<'src> - Zero-copy borrowed segments

Required Associated Types§

Source

type Span: Copy + Debug + PartialEq + Eq + Hash

The span type used by this storage.

For zero-copy parsing (Segments), this is Span representing source positions. For owned data (String), this is () since span information is not preserved.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl StringStorage for String

Source§

impl<T: StringStorage> StringStorage for &T

Implementors§