ringbuf/
alias.rs

1#[cfg(feature = "alloc")]
2use super::storage::Heap;
3use super::{
4    rb::SharedRb,
5    storage::Array,
6    wrap::{CachingCons, CachingProd},
7};
8#[cfg(feature = "alloc")]
9use alloc::sync::Arc;
10
11/// Stack-allocated ring buffer with static capacity.
12///
13/// *Capacity (`N`) must be greater than zero.*
14pub type StaticRb<T, const N: usize> = SharedRb<Array<T, N>>;
15
16/// Alias for [`StaticRb`] producer.
17pub type StaticProd<'a, T, const N: usize> = CachingProd<&'a StaticRb<T, N>>;
18
19/// Alias for [`StaticRb`] consumer.
20pub type StaticCons<'a, T, const N: usize> = CachingCons<&'a StaticRb<T, N>>;
21
22/// Heap-allocated ring buffer.
23#[cfg(feature = "alloc")]
24pub type HeapRb<T> = SharedRb<Heap<T>>;
25
26#[cfg(feature = "alloc")]
27/// Alias for [`HeapRb`] producer.
28pub type HeapProd<T> = CachingProd<Arc<HeapRb<T>>>;
29
30#[cfg(feature = "alloc")]
31/// Alias for [`HeapRb`] consumer.
32pub type HeapCons<T> = CachingCons<Arc<HeapRb<T>>>;