pub struct Bytes<S> { /* private fields */ }Expand description
Bytes with a statically selected storage policy and no wrapper overhead.
Implementations§
Source§impl Bytes<Retained>
impl Bytes<Retained>
pub fn copy_from_slice(slice: &[u8]) -> Bytes<Retained>
pub fn get(self, range: Range<usize>) -> Option<Bytes<Retained>>
pub fn try_advance(&mut self, n: usize) -> bool
pub fn try_consume_prefix( &mut self, amount: usize, ) -> Result<ValidatedPrefix<'_, Bytes<Retained>, impl FnOnce(&mut Bytes<Retained>, usize)>, CapacityError>
pub fn consume_prefix_up_to(&mut self, requested: usize) -> usize
pub fn consume_all(&mut self) -> usize
Source§impl<S> Bytes<S>where
Bytes<S>: RetainBytes,
impl<S> Bytes<S>where
Bytes<S>: RetainBytes,
pub fn into_retained(self) -> Bytes<Retained>
Trait Implementations§
Source§impl AdvanceSegment for Bytes<Retained>
impl AdvanceSegment for Bytes<Retained>
fn try_advance(&mut self, amount: usize) -> bool
impl<S> Copy for Bytes<S>where
S: Copy,
impl<S> Eq for Bytes<S>where
S: Storage,
Source§impl<S> PrefixLength for Bytes<S>where
S: Storage,
impl<S> PrefixLength for Bytes<S>where
S: Storage,
fn prefix_len(&self) -> usize
Source§impl RecvCursor for Bytes<Retained>
impl RecvCursor for Bytes<Retained>
Source§impl RetainBytes for Bytes<Borrowed<'_>>
impl RetainBytes for Bytes<Borrowed<'_>>
fn into_retained(self) -> Bytes<Retained>
Source§impl RetainBytes for Bytes<Leased>
impl RetainBytes for Bytes<Leased>
fn into_retained(self) -> Bytes<Retained>
fn into_retained(self) -> Bytes<Retained>
Source§impl RetainBytes for Bytes<Retained>
impl RetainBytes for Bytes<Retained>
fn into_retained(self) -> Bytes<Retained>
Auto Trait Implementations§
impl<S> Freeze for Bytes<S>where
S: Freeze,
impl<S> RefUnwindSafe for Bytes<S>where
S: RefUnwindSafe,
impl<S> Send for Bytes<S>where
S: Send,
impl<S> Sync for Bytes<S>where
S: Sync,
impl<S> Unpin for Bytes<S>where
S: Unpin,
impl<S> UnsafeUnpin for Bytes<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for Bytes<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more