Trait std::path::BytesContainer[src]
pub trait BytesContainer {
fn container_as_bytes<'a>(&'a self) -> &'a [u8];
fn container_into_owned_bytes(self) -> Vec<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) -> Vec<u8>
Consumes the receiver and converts it into Vec
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 Pathimpl<'a> BytesContainer for &'a Pathimpl BytesContainer for Pathimpl<'a> BytesContainer for &'a Pathimpl<'a> BytesContainer for &'a strimpl BytesContainer for Stringimpl<'a> BytesContainer for &'a [u8]impl BytesContainer for Vec<u8>impl BytesContainer for CStringimpl<'a> BytesContainer for MaybeOwned<'a>