Trait std::path::BytesContainerExperimental
[-]
[+]
[src]
pub trait BytesContainer: ?Sized {
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 Pathimpl BytesContainer for Pathimpl BytesContainer for strimpl BytesContainer for Stringimpl BytesContainer for [u8]impl BytesContainer for Vec<u8>impl BytesContainer for CStringimpl<'a> BytesContainer for MaybeOwned<'a>impl<'a, T: BytesContainer + ?Sized> BytesContainer for &'a T