Trait std::path::BytesContainer
pub trait BytesContainer { fn container_as_bytes<'a>(&'a self) -> &'a [u8]; fn container_into_owned_bytes(self) -> ~[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_into_owned_bytes(self) -> ~[u8]
Consumes the receiver and converts it into ~[u8]
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
MaybeOwned<'a>
CString
Path
Path
impl<'a> BytesContainer for &'a Path
impl<'a> BytesContainer for &'a Path
impl<'a> BytesContainer for &'a str
impl BytesContainer for ~str
impl<'a> BytesContainer for &'a [u8]
impl BytesContainer for ~[u8]