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
64
65
66
67
68
69
70
71
72
73
//!
//! Fixed-size arrays structs with vec-like semantics.
//!
//! [`BankArr<T, C>`] is a fixed-size, array struct, storing items on the stack up to `C`.
//!
//! [`BankVec<T, C>`] is a fixed-size as well, but can exceed `C`, reallocating onto the
//! heap when doing so.
//!
//!
//! # Performance
//!
//! `BankArr` is about as fast as a stack-allocated array. `BankVec` is generally
//! faster than vec as well, but only while its capacity is equal or less than its
//! generic `C`. Once `BankVec` has reallocated to the heap its generally on par
//! with a Vec, but in some cases slower.
//!
//! # Time Complexity
//!
//! You should prefer `BankArr` when you have an upper limit you know you wont exceed,
//! and only considering `BankVec` when your data may occasionally spill over.
//!
//! In general `BankVec` will be *almost* as fast as `BankArr`, but has performance overhead for
//! managing its variants but especially when tranforming into a heap allocation. Spilling over `C` requires
//! *O*(`C`) time complexity to move over to the heap.
//!
//! # Similar Crates
//!
//! This crate was inspired heavily from a few existing crate with similar intent,
//! namely [`SmallVec`](<https://crates.io/crates/smallvec>) and
//! [`ArrayVec`](<https://crates.io/crates/arrayvec>).
//!
//! Comparing `BankArr` with `ArrayVec` and `BankVec` with `SmallVec`, performance
//! is generally equivalent, but in some cases this crate is favored.
//!
//!
pub
pub use BankArr;
pub use BankVec;