Skip to main content

SharedBytes

Type Alias SharedBytes 

Source
pub type SharedBytes = FlexStr<'static, [u8], Arc<[u8]>>;
Available on crate feature bytes only.
Expand description

Shared [u8] type

Aliased Type§

pub enum SharedBytes {
    Borrowed(&'static [u8]),
    Inlined(InlineFlexStr<[u8]>),
    RefCounted(Arc<[u8]>),
    Boxed(Box<[u8]>),
}

Variants§

§

Borrowed(&'static [u8])

Borrowed string - borrowed strings are imported as &S

§

Inlined(InlineFlexStr<[u8]>)

Inline string - owned strings that are small enough to be stored inline

§

RefCounted(Arc<[u8]>)

Reference counted string - owned strings that are too large for inline storage

§

Boxed(Box<[u8]>)

Boxed string - heap allocated strings are imported as Box<S>