ladata/list/array/
mod.rs

1// ladata::list::array
2//
3//! Arrays are random-access, sequentially allocated, statically sized,
4//! homogeneous data structures.
5//
6
7#[cfg(feature = "alloc")]
8use crate::mem::Boxed;
9use crate::mem::Storage;
10
11mod core_impls;
12mod methods;
13mod traits;
14
15/// An array, backed by the core primitive [`array`].
16pub struct Array<T, S: Storage, const LEN: usize> {
17    array: S::Stored<[T; LEN]>,
18}
19
20/// An [`Array`] stored in the heap.
21#[cfg(feature = "alloc")]
22#[cfg_attr(feature = "nightly", doc(cfg(feature = "alloc")))]
23pub type BoxedArray<T, const LEN: usize> = Array<T, Boxed, LEN>;
24
25/// An [`Array`] stored in the stack.
26pub type DirectArray<T, const LEN: usize> = Array<T, (), LEN>;
27
28pub use all::*;
29pub(crate) mod all {
30    #[doc(inline)]
31    #[cfg(feature = "alloc")]
32    pub use super::BoxedArray;
33
34    #[doc(inline)]
35    pub use super::{traits::DataArray, Array, DirectArray};
36}