Skip to main content

BufExt

Trait BufExt 

Source
pub trait BufExt: Buf {
    // Provided method
    fn copy_or_reuse_bytes(&mut self, len: usize) -> Bytes { ... }
}

Provided Methods§

Source

fn copy_or_reuse_bytes(&mut self, len: usize) -> Bytes

Copy len Bytes from this (and advance the position), or reuse them from the underlying buffer if possible.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl BufExt for Cursor<Bytes>

Source§

fn copy_or_reuse_bytes(&mut self, len: usize) -> Bytes

Source§

impl<T: AsRef<[u8]> + ?Sized> BufExt for Cursor<&T>

Source§

impl<T: BufExt, U: BufExt> BufExt for Chain<T, U>

Implementors§