flex_alloc/storage/
mod.rs1use const_default::ConstDefault;
4
5mod alloc;
6mod array;
7pub(crate) mod boxed;
8mod bytes;
9mod inline;
10pub(crate) mod insert;
11mod spill;
12pub(crate) mod utils;
13
14pub use self::{
15 alloc::{BufferHeader, FatBuffer, ThinBuffer},
16 array::ArrayStorage,
17 bytes::ByteStorage,
18 inline::{Inline, InlineBuffer},
19 spill::SpillStorage,
20};
21
22pub const fn array_storage<T, const N: usize>() -> ArrayStorage<T, N> {
24 ArrayStorage::DEFAULT
25}
26
27pub const fn byte_storage<const N: usize>() -> ByteStorage<u8, N> {
29 ByteStorage::DEFAULT
30}
31
32pub const fn aligned_byte_storage<T, const N: usize>() -> ByteStorage<T, N> {
35 ByteStorage::DEFAULT
36}
37
38pub trait RawBuffer: Sized {
40 type RawData: ?Sized;
42
43 fn data_ptr(&self) -> *const Self::RawData;
45
46 fn data_ptr_mut(&mut self) -> *mut Self::RawData;
48}