tux_owned_alloc/
lib.rs

1#![warn(missing_docs)]
2//! Owned Allocations. A crate to help reducing manual memory management errors.
3//!
4//! The idea is to use a type like `UninitAlloc` for uninitialized dynamic
5//! allocations. After initializing it, you have a `OwnedAlloc` which is pretty
6//! similar to a `Box`. However, unlike a `Box`, you may move the value out from
7//! the `OwnedAlloc` and getting an `UninitAlloc` back.
8//!
9//! For vec-like structures, a type `RawVec` is available, pretty similar to the
10//! one used by the standard library. Currently, no other help is provided for
11//! arrays/vectors.
12//!
13//! There is also a type `Cache`, which is actually more general than
14//! allocation, but may be useful for allocations. It can save unused
15//! allocations requested on a tight loop.
16
17mod uninit;
18mod owned;
19mod cache;
20mod raw_vec;
21mod maybe_uninit;
22mod err;
23
24pub use self::{
25    cache::Cache,
26    err::{AllocErr, LayoutErr, RawVecErr},
27    maybe_uninit::MaybeUninitAlloc,
28    owned::OwnedAlloc,
29    raw_vec::RawVec,
30    uninit::UninitAlloc,
31};