1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! A proof-of-concept implementation of (one version of) the storages proposal.
//!
//! Describing the raw storage API, we have:
//!
//! - [`Storage`]: a storage that manages a single memory allocation
//! - [`MultipleStorage`]: a storage that can manage multiple handles
//! - [`SharedMutabilityStorage`] and [`PinningStorage`] for advanced use
//!
//! Providing a safe wrapper around `Storage` use (up to uninit memory):
//!
//! - [`RawBox`]: a raw (uninit payload) version of std `Box`
//! - [`RawVec`]: a raw (uninit payload) version of std `Vec`
//!
//! Useful implementations of [`Storage`]:
//!
//! - [`InlineStorage`]: single storage located in the storage's bytes
//! - [`AllocStorage`]: full-featured storage via allocation
//! - [`SmallStorage`]: inline storage with a fallback to allocation
//! - [`BorrowedStorage`]: single storage located in someone else's memory

#![no_std]
#![feature(
    allocator_api,
    dropck_eyepatch,
    extern_types,
    generic_const_exprs,
    layout_for_ptr,
    let_chains,
    maybe_uninit_array_assume_init,
    specialization,
    ptr_metadata
)]
#![allow(
    clippy::len_without_is_empty,
    clippy::missing_safety_doc,
    clippy::mut_from_ref,
    clippy::new_without_default,
    clippy::should_implement_trait,
    incomplete_features,
    unused_unsafe
)]

mod alloc;
mod borrowed;
mod dynamic;
mod inline;
mod polyfill;
mod raw_box;
mod raw_vec;
mod small;
mod traits;

#[doc(inline)]
pub use crate::{
    alloc::{AllocHandle, AllocStorage},
    borrowed::BorrowedStorage,
    dynamic::DynStorage,
    inline::InlineStorage,
    raw_box::{Box, RawBox},
    raw_vec::RawVec,
    small::SmallStorage,
    traits::{Memory, MultipleStorage, PinningStorage, SharedMutabilityStorage, Storage},
};