pub unsafe trait Drain: Buffer {
    type Value;

    // Required method
    unsafe fn remove(&mut self, index: usize) -> Self::Value;
}
Expand description

Buffer whose values can be drained from.

Safety

Calling Drain::remove remove the value inserted at index index (see [InsertIntoBuffer::insert_into`])

Required Associated Types§

source

type Value

Value to be removed from the buffer

Required Methods§

source

unsafe fn remove(&mut self, index: usize) -> Self::Value

Removes a value from the buffer at a given index and return it.

Safety

A value must have been inserted at this index (see InsertIntoBuffer::insert_into) before calling this method.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> Drain for WriteVectoredVecBuffer<T>
where T: AsRef<[u8]>,

Available on crate features write and std only.
§

type Value = T

source§

impl<T> Drain for VecBuffer<T>

Available on crate feature std only.
§

type Value = T

source§

impl<T, const N: usize> Drain for WriteVectoredArrayBuffer<T, N>
where T: AsRef<[u8]>,

Available on crate features write and std only.
§

type Value = T

source§

impl<T, const N: usize> Drain for ArrayBuffer<T, N>

§

type Value = T