Type Alias ScopedString

Source
pub type ScopedString = Cow<'static, str>;
Expand description

An allocation-optimized string.

We specify ScopedString to attempt to get the best of both worlds: flexibility to provide a static or dynamic (owned) string, while retaining the performance benefits of being able to take ownership of owned strings and borrows of completely static strings.

Aliased Type§

pub enum ScopedString {
    Borrowed(&'static str),
    Owned(String),
}

Variants§

§1.0.0

Borrowed(&'static str)

Borrowed data.

§1.0.0

Owned(String)

Owned data.