litrs

Trait Buffer

source
pub trait Buffer: Sealed + Deref<Target = str> {
    type Cow: From<String> + AsRef<str> + Borrow<str> + Deref<Target = str>;
    type ByteCow: From<Vec<u8>> + AsRef<[u8]> + Borrow<[u8]> + Deref<Target = [u8]>;
}
Expand description

A shared or owned string buffer. Implemented for String and &str. Implementation detail.

This is trait is implementation detail of this library, cannot be implemented in other crates and is not subject to semantic versioning. litrs only guarantees that this trait is implemented for String and for<'a> &'a str.

Required Associated Types§

source

type Cow: From<String> + AsRef<str> + Borrow<str> + Deref<Target = str>

This is Cow<'static, str> for String, and Cow<'a, str> for &'a str.

source

type ByteCow: From<Vec<u8>> + AsRef<[u8]> + Borrow<[u8]> + Deref<Target = [u8]>

This is Cow<'static, [u8]> for String, and Cow<'a, [u8]> for &'a str.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Buffer for String

source§

type Cow = Cow<'static, str>

source§

type ByteCow = Cow<'static, [u8]>

source§

impl<'a> Buffer for &'a str

source§

type Cow = Cow<'a, str>

source§

type ByteCow = Cow<'a, [u8]>

Implementors§