mulch::bitmap

Trait Bitmap

Source
pub trait Bitmap: Sized {
    // Required methods
    fn alloc(&mut self, n: usize) -> Option<usize>;
    fn free(&mut self, index: usize, n: usize);
}

Required Methods§

Source

fn alloc(&mut self, n: usize) -> Option<usize>

Find n consecutive unset bits, set them and return the index of the first bit.

Source

fn free(&mut self, index: usize, n: usize)

Free n previously allocated bits, starting at index.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T> Bitmap for T
where T: PrimInt + BitField + Debug,