pub struct WriteArrayBuffer<const N: usize, const HEADER_SIZE: usize = 0, const TRAILER_SIZE: usize = 0>(/* private fields */);
Available on crate feature write only.
Expand description

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

The total size of the buffer is N + HEADER_SIZE + TRAILER_SIZE. This buffer is no_std.

Trait Implementations§

source§

impl<const N: usize, const HEADER_SIZE: usize, const TRAILER_SIZE: usize> Buffer for WriteArrayBuffer<N, 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 N: usize, const HEADER_SIZE: usize, const TRAILER_SIZE: usize> Default for WriteArrayBuffer<N, HEADER_SIZE, TRAILER_SIZE>

source§

fn default() -> WriteArrayBuffer<N, HEADER_SIZE, TRAILER_SIZE>

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

impl<T, const N: usize, const HEADER_SIZE: usize, const TRAILER_SIZE: usize> InsertIntoBuffer<WriteArrayBuffer<N, 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: &WriteArrayBuffer<N, HEADER_SIZE, TRAILER_SIZE>, index: usize )

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

Auto Trait Implementations§

§

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

§

impl<const N: usize, const HEADER_SIZE: usize, const TRAILER_SIZE: usize> Send for WriteArrayBuffer<N, HEADER_SIZE, TRAILER_SIZE>

§

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

§

impl<const N: usize, const HEADER_SIZE: usize, const TRAILER_SIZE: usize> Unpin for WriteArrayBuffer<N, HEADER_SIZE, TRAILER_SIZE>

§

impl<const N: usize, const HEADER_SIZE: usize, const TRAILER_SIZE: usize> UnwindSafe for WriteArrayBuffer<N, 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.