mod amt;
mod diff;
mod error;
mod node;
mod root;
mod value_mut;
pub use self::amt::{Amt, Amtv0};
pub use self::diff::{diff, Change, ChangeType};
pub use self::error::Error;
pub(crate) use self::node::Node;
pub use self::value_mut::ValueMut;
const DEFAULT_BIT_WIDTH: u32 = 3;
const MAX_HEIGHT: u32 = 64;
pub const MAX_INDEX: u64 = std::u64::MAX - 1;
fn nodes_for_height(bit_width: u32, height: u32) -> u64 {
let height_log_two = bit_width as u64 * height as u64;
if height_log_two >= 64 {
return std::u64::MAX;
}
1 << height_log_two
}
fn init_sized_vec<V>(bit_width: u32) -> Vec<Option<V>> {
std::iter::repeat_with(|| None)
.take(1 << bit_width)
.collect()
}
fn bmap_bytes(bit_width: u32) -> usize {
if bit_width <= 3 {
1
} else {
1 << (bit_width - 3)
}
}