pub unsafe trait Buffer: Default {
type Slice<'a>
where Self: 'a;
// Required methods
fn capacity(&self) -> usize;
unsafe fn slice(&mut self, range: Range<usize>) -> Self::Slice<'_>;
unsafe fn clear(&mut self, range: Range<usize>);
}
Expand description
Queue
buffer. It is used together with InsertIntoBuffer
.
§Safety
Buffer::clear
clears the inserted range from the buffer
(see InsertIntoBuffer::insert_into
), meaning new values can be inserted.
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl<T> Buffer for WriteVectoredVecBuffer<T>
Available on crate features write
and std
only.
impl<T> Buffer for WriteVectoredVecBuffer<T>
Available on crate features
write
and std
only.type Slice<'a> = VectoredSlice<'a> where T: 'a
Source§impl<T, const N: usize> Buffer for WriteVectoredArrayBuffer<T, N>
Available on crate features write
and std
only.
impl<T, const N: usize> Buffer for WriteVectoredArrayBuffer<T, N>
Available on crate features
write
and std
only.type Slice<'a> = VectoredSlice<'a> where T: 'a
Source§impl<T, const N: usize> Buffer for ArrayBuffer<T, N>
impl<T, const N: usize> Buffer for ArrayBuffer<T, N>
Source§impl<const HEADER_SIZE: usize, const TRAILER_SIZE: usize> Buffer for WriteVecBuffer<HEADER_SIZE, TRAILER_SIZE>
Available on crate features alloc
and write
only.
impl<const HEADER_SIZE: usize, const TRAILER_SIZE: usize> Buffer for WriteVecBuffer<HEADER_SIZE, TRAILER_SIZE>
Available on crate features
alloc
and write
only.