pub struct WriteVecBuffer<const HEADER_SIZE: usize = 0, const TRAILER_SIZE: usize = 0>(/* private fields */);
Available on crate features std and write only.
Expand description

A bytes buffer with a HEADER_SIZE-bytes header and a TRAILER_SIZE-bytes trailer.

Trait Implementations§

source§

impl<const HEADER_SIZE: usize, const TRAILER_SIZE: usize> Buffer for WriteVecBuffer<HEADER_SIZE, TRAILER_SIZE>

§

type Slice<'a> = BytesSlice<'a, HEADER_SIZE, TRAILER_SIZE>

The slice type returned by slice method.
source§

fn capacity(&self) -> usize

Returns the buffer’s capacity.
source§

unsafe fn slice(&mut self, range: Range<usize>) -> Self::Slice<'_>

Returns a slice of the buffer. Read more
source§

unsafe fn clear(&mut self, _range: Range<usize>)

Clears the buffer. Read more
source§

impl<const HEADER_SIZE: usize, const TRAILER_SIZE: usize> Default for WriteVecBuffer<HEADER_SIZE, TRAILER_SIZE>

source§

fn default() -> WriteVecBuffer<HEADER_SIZE, TRAILER_SIZE>

Returns the “default value” for a type. Read more
source§

impl<T, const HEADER_SIZE: usize, const TRAILER_SIZE: usize> InsertIntoBuffer<WriteVecBuffer<HEADER_SIZE, TRAILER_SIZE>> for T
where T: WriteBytesSlice,

source§

fn size(&self) -> usize

Returns the size taken by a value in the buffer.
source§

unsafe fn insert_into( self, buffer: &WriteVecBuffer<HEADER_SIZE, TRAILER_SIZE>, index: usize )

Inserts the value into the buffer at the given index. Read more
source§

impl<const HEADER_SIZE: usize, const TRAILER_SIZE: usize> Resize for WriteVecBuffer<HEADER_SIZE, TRAILER_SIZE>

source§

fn resize(&mut self, capacity: usize)

Resizes the buffer.

Auto Trait Implementations§

§

impl<const HEADER_SIZE: usize = 0, const TRAILER_SIZE: usize = 0> !RefUnwindSafe for WriteVecBuffer<HEADER_SIZE, TRAILER_SIZE>

§

impl<const HEADER_SIZE: usize, const TRAILER_SIZE: usize> Send for WriteVecBuffer<HEADER_SIZE, TRAILER_SIZE>

§

impl<const HEADER_SIZE: usize = 0, const TRAILER_SIZE: usize = 0> !Sync for WriteVecBuffer<HEADER_SIZE, TRAILER_SIZE>

§

impl<const HEADER_SIZE: usize, const TRAILER_SIZE: usize> Unpin for WriteVecBuffer<HEADER_SIZE, TRAILER_SIZE>

§

impl<const HEADER_SIZE: usize, const TRAILER_SIZE: usize> UnwindSafe for WriteVecBuffer<HEADER_SIZE, TRAILER_SIZE>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.