pub unsafe trait InsertIntoBuffer<B: Buffer> {
    // Required methods
    fn size(&self) -> usize;
    unsafe fn insert_into(self, buffer: &B, index: usize);
}
Expand description

Buffer value.

Safety

Range index..index+value.size() is considered inserted into the buffer after calling InsertIntoBuffer::insert_into (see Buffer::slice/Buffer::clear)

Required Methods§

source

fn size(&self) -> usize

Returns the size taken by a value in the buffer.

source

unsafe fn insert_into(self, buffer: &B, index: usize)

Inserts the value into the buffer at the given index.

Safety

For every call to this method, the inserted range index..index+self.size() must not overlap with a previously inserted one.

Implementations on Foreign Types§

source§

impl<B, T, const N: usize> InsertIntoBuffer<B> for [T; N]
where B: CellBuffer<T>,

source§

fn size(&self) -> usize

source§

unsafe fn insert_into(self, buffer: &B, index: usize)

Implementors§

source§

impl<B, I, T> InsertIntoBuffer<B> for ValueIter<I>
where B: CellBuffer<T>, I: Iterator<Item = T> + ExactSizeIterator,

source§

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

Available on crate features std and write only.
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,

Available on crate feature write only.