[−][src]Struct bytes::Bytes
A specialized ByteStr box.
Methods
impl Bytes[src]
pub fn from_slice(bytes: &[u8]) -> Bytes[src]
pub fn of<B: ByteStr>(bytes: B) -> Bytes[src]
pub fn empty() -> Bytes[src]
pub fn downcast_ref<'a, B: ByteStr>(&'a self) -> Option<&'a B>[src]
If the underlying ByteStr is of type B, returns a reference to it
otherwise None.
pub fn try_unwrap<B: ByteStr>(self) -> Result<B, Bytes>[src]
If the underlying ByteStr is of type B, returns the unwraped value,
otherwise, returns the original Bytes as Err.
Trait Implementations
impl<'a> Source for &'a Bytes[src]
impl ByteStr for Bytes[src]
type Buf = Box<dyn Buf + 'static>
fn buf(&self) -> Box<dyn Buf + 'static>[src]
fn concat<B: ByteStr>(&self, other: &B) -> Bytes[src]
fn len(&self) -> usize[src]
fn slice(&self, begin: usize, end: usize) -> Bytes[src]
fn split_at(&self, mid: usize) -> (Bytes, Bytes)[src]
fn is_empty(&self) -> bool[src]
fn slice_from(&self, begin: usize) -> Bytes[src]
fn slice_to(&self, end: usize) -> Bytes[src]
impl ToBytes for Bytes[src]
impl Send for Bytes[src]
impl Sync for Bytes[src]
impl Drop for Bytes[src]
impl Clone for Bytes[src]
impl Eq for Bytes[src]
impl<B: ByteStr> PartialEq<B> for Bytes[src]
impl Debug for Bytes[src]
impl Index<usize> for Bytes[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,