Trait BitSet

Source
pub trait BitSet {
    const UPPER_BOUND: u32;

    // Required methods
    fn get(&self, index: u32) -> bool;
    fn find_set(&self, lower_bound: u32) -> Option<u32>;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Expand description

Common trait for all bitsets in bitseto crate.

Required Associated Constantsยง

Source

const UPPER_BOUND: u32

๐Ÿ‘ŽDeprecated: use bitsetium crate instead

Upper bound for this bitset indices. Implementation is expected to panic if index equal to or greter than UPPER_BOUND is speicifed.

Required Methodsยง

Source

fn get(&self, index: u32) -> bool

๐Ÿ‘ŽDeprecated: use bitsetium crate instead

Returns bit state at specified index.

ยงPanics

This function may panic if index is equal to or greter than UPPER_BOUND.

Source

fn find_set(&self, lower_bound: u32) -> Option<u32>

๐Ÿ‘ŽDeprecated: use bitsetium crate instead

Returns index of first set bit at index equal to or greter than specified.

ยงPanics

This function may panic if index is equal to or greter than UPPER_BOUND.

Provided Methodsยง

Source

fn is_empty(&self) -> bool

๐Ÿ‘ŽDeprecated: use bitsetium crate instead

Returns true if no bit is set.

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.

Implementations on Foreign Typesยง

Sourceยง

impl BitSet for u8

Sourceยง

const UPPER_BOUND: u32 = 8u32

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

fn get(&self, index: u32) -> bool

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

fn find_set(&self, lower_bound: u32) -> Option<u32>

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

impl BitSet for u16

Sourceยง

const UPPER_BOUND: u32 = 16u32

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

fn get(&self, index: u32) -> bool

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

fn find_set(&self, lower_bound: u32) -> Option<u32>

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

impl BitSet for u32

Sourceยง

const UPPER_BOUND: u32 = 32u32

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

fn get(&self, index: u32) -> bool

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

fn find_set(&self, lower_bound: u32) -> Option<u32>

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

impl BitSet for u64

Sourceยง

const UPPER_BOUND: u32 = 64u32

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

fn get(&self, index: u32) -> bool

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

fn find_set(&self, lower_bound: u32) -> Option<u32>

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

impl BitSet for u128

Sourceยง

const UPPER_BOUND: u32 = 128u32

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

fn get(&self, index: u32) -> bool

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

fn find_set(&self, lower_bound: u32) -> Option<u32>

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

impl<T> BitSet for Option<T>
where T: BitSet,

Sourceยง

const UPPER_BOUND: u32 = T::UPPER_BOUND

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

fn get(&self, index: u32) -> bool

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

fn find_set(&self, lower_bound: u32) -> Option<u32>

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

impl<T> BitSet for &T
where T: BitSet,

Sourceยง

const UPPER_BOUND: u32 = T::UPPER_BOUND

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

fn get(&self, index: u32) -> bool

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

fn find_set(&self, lower_bound: u32) -> Option<u32>

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

impl<T> BitSet for &mut T
where T: BitSet,

Sourceยง

const UPPER_BOUND: u32 = T::UPPER_BOUND

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

fn get(&self, index: u32) -> bool

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

fn find_set(&self, lower_bound: u32) -> Option<u32>

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

impl<T> BitSet for Box<T>
where T: BitSet,

Sourceยง

const UPPER_BOUND: u32 = T::UPPER_BOUND

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

fn get(&self, index: u32) -> bool

๐Ÿ‘ŽDeprecated: use bitsetium crate instead
Sourceยง

fn find_set(&self, lower_bound: u32) -> Option<u32>

๐Ÿ‘ŽDeprecated: use bitsetium crate instead

Implementorsยง

Sourceยง

impl<T, B, const N: usize> BitSet for Layered<T, B, N>
where T: BitSet, B: BitSet,