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
//! A pointer type for dynamically allocated memory.
//!
//! Similar to [`std::boxed::Box`](https://doc.rust-lang.org/std/boxed/index.html)
//! [`Box<T>`] is a pointer type that can deallocate memory when it goes out of
//! scope.
//!
//! This crate can also be used for pointer to statics because in contrast to
//! pointers [`Box<T>`] cannot be copied and an accidental drop can be caught.
//!
//! **Note:** in the current implementation the type is static, but de-/allocation
//! will be added with a dynamic memory allocation feature. The type should work
//! with pooled as well as heap allocators.
//!
//! # Examples
//!
//! Allocating a data structure in a static pool will return a boxed pointer to
//! the new value:
//! ```no_run
//! static POOL: ArrayPool<Node<MyStruct>, 10> = ArrayPool::new([None; 10]);
//! let boxed: Box<MyStruct> = POOL.insert(Node::new(MyStruct { id: 42 })).unwrap();
//! ```
use NonNull;
use ;
/// A pointer type for dynamically allocated memory.
///
/// For more details see [module-level documentation](../index.html)