pub struct ArrayBuf<T, A>where
    A: AsMut<[T]> + AsRef<[T]> + RealArray<T>,
{ /* private fields */ }
Expand description

An array-backed Ring Buffer

A is the type of the backing array. The backing array must be a real array. In order to verify this it must satisfy the RealArray constraint. In order to create a Ring Buffer backed by an array of 5 integer elements, the following code can be utilized:

use futures_intrusive::buffer::{ArrayBuf, RingBuf};

type Buffer5 = ArrayBuf<i32, [i32; 5]>;
let buffer = Buffer5::new();

Trait Implementations

Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more
The type of stored items inside the Ring Buffer
Creates a new instance of the Ring Buffer
Creates a new instance of the Ring Buffer with the given capacity. RingBuf implementations are allowed to ignore the capacity hint and utilize their default capacity. Read more
The capacity of the buffer
The amount of stored items in the buffer
Returns true if there is enough space in the buffer to store another item. Read more
Stores the item at the end of the buffer. Panics if there is not enough free space. Read more
Returns the oldest item inside the buffer. Panics if there is no available item. Read more
Returns true if no item is stored inside the buffer.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.