StackBuffer

Type Alias StackBuffer 

Source
pub type StackBuffer<N> = CircularBuffer<Array<u8, N>>;
Available on crate feature hybrid-array only.
Expand description

A circular buffer backed by hybrid_array::Array.

This implementation is used when the hybrid-array feature is enabled. It allows for type-level sizes (e.g., U10) compatible with hybrid-array & typenum.

Aliased Type§

pub struct StackBuffer<N> { /* private fields */ }

Implementations§

Source§

impl<N: ArraySize> StackBuffer<N>

Source

pub fn new() -> Self

Creates a new buffer.

§Panics

Panics if array size is 0.

§Examples
use ringo_buff::{StackBuffer, ArraySize};
use hybrid_array::sizes::U128;

let buf: StackBuffer<U128> = StackBuffer::new();
assert_eq!(buf.capacity(), 128);