[][src]Trait salvo::http::BodyChunk

pub trait BodyChunk {
    pub fn split_into(self, idx: usize) -> (Self, Self);
pub fn as_slice(&self) -> &[u8]; pub fn slice<R>(&self, range: R) -> &<R as SliceIndex<[u8]>>::Output
    where
        R: SliceIndex<[u8]>
, { ... }
pub fn len(&self) -> usize { ... }
pub fn is_empty(&self) -> bool { ... }
pub fn into_vec(self) -> Vec<u8, Global> { ... } }

Required methods

pub fn split_into(self, idx: usize) -> (Self, Self)[src]

Split the chunk at idx, returning (self[..idx], self[idx..]).

pub fn as_slice(&self) -> &[u8][src]

Get the slice representing the data of this chunk.

Loading content...

Provided methods

pub fn slice<R>(&self, range: R) -> &<R as SliceIndex<[u8]>>::Output where
    R: SliceIndex<[u8]>, 
[src]

Slice the bytes in self according to the given range.

pub fn len(&self) -> usize[src]

Equivalent to self.as_slice().len()

pub fn is_empty(&self) -> bool[src]

Equivalent to self.as_slice().is_empty()

pub fn into_vec(self) -> Vec<u8, Global>[src]

Equivalent to self.as_slice().to_owned()

Implementors are welcome to override this if they can provide a cheaper conversion.

Loading content...

Implementations on Foreign Types

impl<'a> BodyChunk for &'a [u8][src]

impl BodyChunk for Vec<u8, Global>[src]

impl<'a> BodyChunk for Cow<'a, [u8]>[src]

impl BodyChunk for Bytes[src]

Loading content...

Implementors

Loading content...