1#![doc(html_root_url="https://docs.rs/arrayvec/0.7/")]
23#![cfg_attr(not(feature="std"), no_std)]
24
25#[cfg(feature="serde")]
26extern crate serde;
27
28#[cfg(not(feature="std"))]
29extern crate core as std;
30
31#[cfg(not(target_pointer_width = "16"))]
32pub(crate) type LenUint = u32;
33
34#[cfg(target_pointer_width = "16")]
35pub(crate) type LenUint = u16;
36
37macro_rules! assert_capacity_limit {
38 ($cap:expr) => {
39 if std::mem::size_of::<usize>() > std::mem::size_of::<LenUint>() {
40 if $cap > LenUint::MAX as usize {
41 #[cfg(not(target_pointer_width = "16"))]
42 panic!("ArrayVec: largest supported capacity is u32::MAX");
43 #[cfg(target_pointer_width = "16")]
44 panic!("ArrayVec: largest supported capacity is u16::MAX");
45 }
46 }
47 }
48}
49
50macro_rules! assert_capacity_limit_const {
51 ($cap:expr) => {
52 if std::mem::size_of::<usize>() > std::mem::size_of::<LenUint>() {
53 if $cap > LenUint::MAX as usize {
54 [][$cap]
55 }
56 }
57 }
58}
59
60mod arrayvec;
61mod array_string;
62mod char;
63mod errors;
64mod utils;
65
66pub use crate::array_string::ArrayString;
67pub use crate::errors::CapacityError;
68
69pub use crate::arrayvec::{ArrayVec, IntoIter, Drain};