Trait multistr::StrLike [−][src]
pub trait StrLike: Len + ToOwned + DefaultRef + 'static { type Data: ?Sized + StrData + ToOwned<Owned = Self::OwnedData> + 'static; type OwnedData: OwnsStrData<Self::Data> + Borrow<Self::Data>; type ConvError: Display; fn to_data(&self) -> &Self::Data; fn from_data(data: &Self::Data) -> Result<&Self, Self::ConvError>; unsafe fn from_data_unchecked(data: &Self::Data) -> &Self; }
String-like container.
Associated Types
type Data: ?Sized + StrData + ToOwned<Owned = Self::OwnedData> + 'static
Data backing this string.
type OwnedData: OwnsStrData<Self::Data> + Borrow<Self::Data>
Owned data.
type ConvError: Display
Error that comes up when converting data back into a string.
Required Methods
fn to_data(&self) -> &Self::Data
Converts this string into its data backend.
fn from_data(data: &Self::Data) -> Result<&Self, Self::ConvError>
Coerces a string from its backend data, performing validation if necessary.
unsafe fn from_data_unchecked(data: &Self::Data) -> &Self
Similar to from_data
, ignoring validity checking.
Implementations on Foreign Types
impl<T: 'static + Copy> StrLike for [T]
[src]
impl<T: 'static + Copy> StrLike for [T]
impl StrLike for str
[src]
impl StrLike for str
impl StrLike for CStr
[src]
impl StrLike for CStr