#![cfg_attr(not(test), no_std)]
extern crate alloc;
pub mod btree;
mod macros;
mod storage;
pub mod vec;
pub trait IndexSet {
fn len(&self) -> usize;
fn is_empty(&self) -> bool;
fn insert(&mut self, index: usize);
fn remove(&mut self, index: usize);
fn contains(&self, index: usize) -> bool;
fn iter(&self) -> impl Iterator<Item = usize> + '_;
fn union(&mut self, other: &Self);
fn reserve(&mut self, _size: usize) {
}
}
#[inline]
fn safe_iter_reserve_cap<I>(iter: &I) -> usize
where
I: Iterator,
{
let (min_cap, _) = iter.size_hint();
min_cap.min(256)
}
#[inline]
const fn calculate_map_and_set_indices<S>(index: usize) -> (usize, usize)
where
S: storage::Storage,
{
let map_index = index / S::WIDTH;
let bit_set_index = index % S::WIDTH;
(map_index, bit_set_index)
}