Trait std::old_path::BytesContainerUnstable
[-] [+]
[src]
pub trait BytesContainer { fn container_as_bytes<'a>(&'a self) -> &'a [u8]; fn container_as_str<'a>(&'a self) -> Option<&'a str> { ... } fn is_str(_: Option<&Self>) -> bool { ... } }
A trait that represents something bytes-like (e.g. a &[u8] or a &str)
Required Methods
fn container_as_bytes<'a>(&'a self) -> &'a [u8]
Returns a &[u8] representing the receiver
Provided Methods
fn container_as_str<'a>(&'a self) -> Option<&'a str>
Returns the receiver interpreted as a utf-8 string, if possible
fn is_str(_: Option<&Self>) -> bool
Returns whether .container_as_str() is guaranteed to not fail
Implementors
impl BytesContainer for Path
impl BytesContainer for Path
impl BytesContainer for str
impl BytesContainer for String
impl BytesContainer for [u8]
impl BytesContainer for Vec<u8>
impl BytesContainer for CString
impl<'a, T: ?Sized + BytesContainer> BytesContainer for &'a T