Trait bitmaps::BitOps

source ·
pub trait BitOps {
Show 18 methods // Required methods fn get(bits: &Self, index: usize) -> bool; fn set(bits: &mut Self, index: usize, value: bool) -> bool; fn len(bits: &Self) -> usize; fn first_index(bits: &Self) -> Option<usize>; fn first_false_index(bits: &Self) -> Option<usize>; fn last_index(bits: &Self) -> Option<usize>; fn last_false_index(bits: &Self) -> Option<usize>; fn next_index(bits: &Self, index: usize) -> Option<usize>; fn next_false_index(bits: &Self, index: usize) -> Option<usize>; fn prev_index(bits: &Self, index: usize) -> Option<usize>; fn prev_false_index(bits: &Self, index: usize) -> Option<usize>; fn bit_and(bits: &mut Self, other_bits: &Self); fn bit_or(bits: &mut Self, other_bits: &Self); fn bit_xor(bits: &mut Self, other_bits: &Self); fn invert(bits: &mut Self); fn make_mask(shift: usize) -> Self; fn bit_size() -> usize; fn to_hex(bits: &Self) -> String;
}
Expand description

A trait that defines generalised operations on a Bits::Store type.

Required Methods§

source

fn get(bits: &Self, index: usize) -> bool

source

fn set(bits: &mut Self, index: usize, value: bool) -> bool

source

fn len(bits: &Self) -> usize

source

fn first_index(bits: &Self) -> Option<usize>

source

fn first_false_index(bits: &Self) -> Option<usize>

source

fn last_index(bits: &Self) -> Option<usize>

source

fn last_false_index(bits: &Self) -> Option<usize>

source

fn next_index(bits: &Self, index: usize) -> Option<usize>

source

fn next_false_index(bits: &Self, index: usize) -> Option<usize>

source

fn prev_index(bits: &Self, index: usize) -> Option<usize>

source

fn prev_false_index(bits: &Self, index: usize) -> Option<usize>

source

fn bit_and(bits: &mut Self, other_bits: &Self)

source

fn bit_or(bits: &mut Self, other_bits: &Self)

source

fn bit_xor(bits: &mut Self, other_bits: &Self)

source

fn invert(bits: &mut Self)

source

fn make_mask(shift: usize) -> Self

source

fn bit_size() -> usize

source

fn to_hex(bits: &Self) -> String

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl BitOps for bool

source§

impl BitOps for u8

source§

impl BitOps for u16

source§

impl BitOps for u32

source§

impl BitOps for u64

source§

impl BitOps for u128

source§

impl BitOps for [u128; 2]

source§

impl BitOps for [u128; 3]

source§

impl BitOps for [u128; 4]

source§

impl BitOps for [u128; 5]

source§

impl BitOps for [u128; 6]

source§

impl BitOps for [u128; 7]

source§

impl BitOps for [u128; 8]

Implementors§