Trait bv::BitsMut[][src]

pub trait BitsMut: Bits {
    fn set_bit(&mut self, position: u64, value: bool) { ... }
fn set_block(&mut self, position: usize, value: Self::Block) { ... }
fn set_bits(&mut self, start: u64, count: usize, value: Self::Block) { ... } }
[]

Mutable bit vector operations that don’t affect the length.

Minimal complete definition is set_bit or set_block, since each is defined in terms of the other. Note that set_block in terms of set_bit is inefficient, and thus you should implement set_block directly if possible.

Provided methods

fn set_bit(&mut self, position: u64, value: bool)[src][]

Sets the bit at position to value.

The default implementation uses get_raw_block and set_block.

Panics

Panics if position is out of bounds.

fn set_block(&mut self, position: usize, value: Self::Block)[src][]

Sets the block at position to value.

The bits are laid out Block::nbits() per block, with the notional zeroth bit in the least significant position. If self.bit_len() is not a multiple of Block::nbits() then the last block will contain extra bits that are not part of the bit vector. Implementations of set_block should not change those trailing bits.

The default implementation sets a block by setting each of its bits in turn. Consider it a slow reference implementation, and override it.

Panics

Panics if position is out of bounds.

fn set_bits(&mut self, start: u64, count: usize, value: Self::Block)[src][]

Sets count bits starting at bit index start, interpreted as a little-endian integer.

Panics

Panics if the bit span goes out of bounds.

Implementations on Foreign Types

impl<'a, T: BitsMut + ?Sized> BitsMut for &'a mut T[src][]

impl<Block: BlockType> BitsMut for Box<dyn BitsMut<Block = Block>>[src][]

impl<Block: BlockType> BitsMut for [Block][src][]

impl<Block: BlockType> BitsMut for Vec<Block>[src][]

impl BitsMut for [bool][src][]

impl BitsMut for Vec<bool>[src][]

impl<Block: BlockType> BitsMut for [Block; 0][src][]

impl BitsMut for [bool; 0][src][]

impl<Block: BlockType> BitsMut for [Block; 1][src][]

impl BitsMut for [bool; 1][src][]

impl<Block: BlockType> BitsMut for [Block; 2][src][]

impl BitsMut for [bool; 2][src][]

impl<Block: BlockType> BitsMut for [Block; 3][src][]

impl BitsMut for [bool; 3][src][]

impl<Block: BlockType> BitsMut for [Block; 4][src][]

impl BitsMut for [bool; 4][src][]

impl<Block: BlockType> BitsMut for [Block; 5][src][]

impl BitsMut for [bool; 5][src][]

impl<Block: BlockType> BitsMut for [Block; 6][src][]

impl BitsMut for [bool; 6][src][]

impl<Block: BlockType> BitsMut for [Block; 7][src][]

impl BitsMut for [bool; 7][src][]

impl<Block: BlockType> BitsMut for [Block; 8][src][]

impl BitsMut for [bool; 8][src][]

impl<Block: BlockType> BitsMut for [Block; 9][src][]

impl BitsMut for [bool; 9][src][]

impl<Block: BlockType> BitsMut for [Block; 10][src][]

impl BitsMut for [bool; 10][src][]

impl<Block: BlockType> BitsMut for [Block; 11][src][]

impl BitsMut for [bool; 11][src][]

impl<Block: BlockType> BitsMut for [Block; 12][src][]

impl BitsMut for [bool; 12][src][]

impl<Block: BlockType> BitsMut for [Block; 13][src][]

impl BitsMut for [bool; 13][src][]

impl<Block: BlockType> BitsMut for [Block; 14][src][]

impl BitsMut for [bool; 14][src][]

impl<Block: BlockType> BitsMut for [Block; 15][src][]

impl BitsMut for [bool; 15][src][]

impl<Block: BlockType> BitsMut for [Block; 16][src][]

impl BitsMut for [bool; 16][src][]

impl<Block: BlockType> BitsMut for [Block; 17][src][]

impl BitsMut for [bool; 17][src][]

impl<Block: BlockType> BitsMut for [Block; 18][src][]

impl BitsMut for [bool; 18][src][]

impl<Block: BlockType> BitsMut for [Block; 19][src][]

impl BitsMut for [bool; 19][src][]

impl<Block: BlockType> BitsMut for [Block; 20][src][]

impl BitsMut for [bool; 20][src][]

impl<Block: BlockType> BitsMut for [Block; 21][src][]

impl BitsMut for [bool; 21][src][]

impl<Block: BlockType> BitsMut for [Block; 22][src][]

impl BitsMut for [bool; 22][src][]

impl<Block: BlockType> BitsMut for [Block; 23][src][]

impl BitsMut for [bool; 23][src][]

impl<Block: BlockType> BitsMut for [Block; 24][src][]

impl BitsMut for [bool; 24][src][]

impl<Block: BlockType> BitsMut for [Block; 25][src][]

impl BitsMut for [bool; 25][src][]

impl<Block: BlockType> BitsMut for [Block; 26][src][]

impl BitsMut for [bool; 26][src][]

impl<Block: BlockType> BitsMut for [Block; 27][src][]

impl BitsMut for [bool; 27][src][]

impl<Block: BlockType> BitsMut for [Block; 28][src][]

impl BitsMut for [bool; 28][src][]

impl<Block: BlockType> BitsMut for [Block; 29][src][]

impl BitsMut for [bool; 29][src][]

impl<Block: BlockType> BitsMut for [Block; 30][src][]

impl BitsMut for [bool; 30][src][]

impl<Block: BlockType> BitsMut for [Block; 31][src][]

impl BitsMut for [bool; 31][src][]

impl<Block: BlockType> BitsMut for [Block; 32][src][]

impl BitsMut for [bool; 32][src][]

impl<Block: BlockType> BitsMut for [Block; 64][src][]

impl BitsMut for [bool; 64][src][]

impl<Block: BlockType> BitsMut for [Block; 128][src][]

impl BitsMut for [bool; 128][src][]

impl<Block: BlockType> BitsMut for [Block; 256][src][]

impl BitsMut for [bool; 256][src][]

impl<Block: BlockType> BitsMut for [Block; 512][src][]

impl BitsMut for [bool; 512][src][]

impl<Block: BlockType> BitsMut for [Block; 1024][src][]

impl BitsMut for [bool; 1024][src][]

impl<Block: BlockType> BitsMut for [Block; 2048][src][]

impl BitsMut for [bool; 2048][src][]

impl<Block: BlockType> BitsMut for [Block; 4096][src][]

impl BitsMut for [bool; 4096][src][]

impl<Block: BlockType> BitsMut for [Block; 8192][src][]

impl BitsMut for [bool; 8192][src][]

impl<Block: BlockType> BitsMut for [Block; 16384][src][]

impl BitsMut for [bool; 16384][src][]

impl<Block: BlockType> BitsMut for [Block; 32768][src][]

impl BitsMut for [bool; 32768][src][]

impl<Block: BlockType> BitsMut for [Block; 65536][src][]

impl BitsMut for [bool; 65536][src][]

impl<Block: BlockType> BitsMut for [Block; 131072][src][]

impl BitsMut for [bool; 131072][src][]

impl<Block: BlockType> BitsMut for [Block; 262144][src][]

impl BitsMut for [bool; 262144][src][]

impl<Block: BlockType> BitsMut for [Block; 524288][src][]

impl BitsMut for [bool; 524288][src][]

impl<Block: BlockType> BitsMut for [Block; 1048576][src][]

impl BitsMut for [bool; 1048576][src][]

impl BitsMut for u8[src][]

impl BitsMut for u16[src][]

impl BitsMut for u32[src][]

impl BitsMut for u64[src][]

impl BitsMut for u128[src][]

impl BitsMut for usize[src][]

Implementors

impl<'a, Block: BlockType> BitsMut for BoolAdapter<Block, &'a mut Vec<bool>>[src][+]

impl<'a, Block: BlockType> BitsMut for BoolAdapter<Block, &'a mut [bool]>[src][+]

impl<'a, Block: BlockType> BitsMut for BitSliceMut<'a, Block>[src][+]

impl<Block: BlockType> BitsMut for BoolAdapter<Block, Vec<bool>>[src][+]

impl<Block: BlockType> BitsMut for BitVec<Block>[src][+]

impl<T: BitsMut> BitsMut for BitSliceAdapter<T>[src][+]