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)
Sets the bit at position
to value
.
The default implementation uses get_block
and set_block
.
Panics
Panics if position
is out of bounds.
fn set_block(&mut self, position: usize, value: Self::Block)
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)
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<'a, T: BitsMut + ?Sized> BitsMut for &'a mut T
impl<Block: BlockType> BitsMut for Box<BitsMut<Block = Block>>
[src]
impl<Block: BlockType> BitsMut for Box<BitsMut<Block = Block>>
impl<Block: BlockType> BitsMut for [Block]
[src]
impl<Block: BlockType> BitsMut for [Block]
impl BitsMut for [bool]
[src]
impl BitsMut for [bool]
impl BitsMut for Vec<bool>
[src]
impl BitsMut for Vec<bool>
impl<Block: BlockType> BitsMut for [Block; 0]
[src]
impl<Block: BlockType> BitsMut for [Block; 0]
impl BitsMut for [bool; 0]
[src]
impl BitsMut for [bool; 0]
impl<Block: BlockType> BitsMut for [Block; 1]
[src]
impl<Block: BlockType> BitsMut for [Block; 1]
impl BitsMut for [bool; 1]
[src]
impl BitsMut for [bool; 1]
impl<Block: BlockType> BitsMut for [Block; 2]
[src]
impl<Block: BlockType> BitsMut for [Block; 2]
impl BitsMut for [bool; 2]
[src]
impl BitsMut for [bool; 2]
impl<Block: BlockType> BitsMut for [Block; 3]
[src]
impl<Block: BlockType> BitsMut for [Block; 3]
impl BitsMut for [bool; 3]
[src]
impl BitsMut for [bool; 3]
impl<Block: BlockType> BitsMut for [Block; 4]
[src]
impl<Block: BlockType> BitsMut for [Block; 4]
impl BitsMut for [bool; 4]
[src]
impl BitsMut for [bool; 4]
impl<Block: BlockType> BitsMut for [Block; 5]
[src]
impl<Block: BlockType> BitsMut for [Block; 5]
impl BitsMut for [bool; 5]
[src]
impl BitsMut for [bool; 5]
impl<Block: BlockType> BitsMut for [Block; 6]
[src]
impl<Block: BlockType> BitsMut for [Block; 6]
impl BitsMut for [bool; 6]
[src]
impl BitsMut for [bool; 6]
impl<Block: BlockType> BitsMut for [Block; 7]
[src]
impl<Block: BlockType> BitsMut for [Block; 7]
impl BitsMut for [bool; 7]
[src]
impl BitsMut for [bool; 7]
impl<Block: BlockType> BitsMut for [Block; 8]
[src]
impl<Block: BlockType> BitsMut for [Block; 8]
impl BitsMut for [bool; 8]
[src]
impl BitsMut for [bool; 8]
impl<Block: BlockType> BitsMut for [Block; 9]
[src]
impl<Block: BlockType> BitsMut for [Block; 9]
impl BitsMut for [bool; 9]
[src]
impl BitsMut for [bool; 9]
impl<Block: BlockType> BitsMut for [Block; 10]
[src]
impl<Block: BlockType> BitsMut for [Block; 10]
impl BitsMut for [bool; 10]
[src]
impl BitsMut for [bool; 10]
impl<Block: BlockType> BitsMut for [Block; 11]
[src]
impl<Block: BlockType> BitsMut for [Block; 11]
impl BitsMut for [bool; 11]
[src]
impl BitsMut for [bool; 11]
impl<Block: BlockType> BitsMut for [Block; 12]
[src]
impl<Block: BlockType> BitsMut for [Block; 12]
impl BitsMut for [bool; 12]
[src]
impl BitsMut for [bool; 12]
impl<Block: BlockType> BitsMut for [Block; 13]
[src]
impl<Block: BlockType> BitsMut for [Block; 13]
impl BitsMut for [bool; 13]
[src]
impl BitsMut for [bool; 13]
impl<Block: BlockType> BitsMut for [Block; 14]
[src]
impl<Block: BlockType> BitsMut for [Block; 14]
impl BitsMut for [bool; 14]
[src]
impl BitsMut for [bool; 14]
impl<Block: BlockType> BitsMut for [Block; 15]
[src]
impl<Block: BlockType> BitsMut for [Block; 15]
impl BitsMut for [bool; 15]
[src]
impl BitsMut for [bool; 15]
impl<Block: BlockType> BitsMut for [Block; 16]
[src]
impl<Block: BlockType> BitsMut for [Block; 16]
impl BitsMut for [bool; 16]
[src]
impl BitsMut for [bool; 16]
impl<Block: BlockType> BitsMut for [Block; 17]
[src]
impl<Block: BlockType> BitsMut for [Block; 17]
impl BitsMut for [bool; 17]
[src]
impl BitsMut for [bool; 17]
impl<Block: BlockType> BitsMut for [Block; 18]
[src]
impl<Block: BlockType> BitsMut for [Block; 18]
impl BitsMut for [bool; 18]
[src]
impl BitsMut for [bool; 18]
impl<Block: BlockType> BitsMut for [Block; 19]
[src]
impl<Block: BlockType> BitsMut for [Block; 19]
impl BitsMut for [bool; 19]
[src]
impl BitsMut for [bool; 19]
impl<Block: BlockType> BitsMut for [Block; 20]
[src]
impl<Block: BlockType> BitsMut for [Block; 20]
impl BitsMut for [bool; 20]
[src]
impl BitsMut for [bool; 20]
impl<Block: BlockType> BitsMut for [Block; 21]
[src]
impl<Block: BlockType> BitsMut for [Block; 21]
impl BitsMut for [bool; 21]
[src]
impl BitsMut for [bool; 21]
impl<Block: BlockType> BitsMut for [Block; 22]
[src]
impl<Block: BlockType> BitsMut for [Block; 22]
impl BitsMut for [bool; 22]
[src]
impl BitsMut for [bool; 22]
impl<Block: BlockType> BitsMut for [Block; 23]
[src]
impl<Block: BlockType> BitsMut for [Block; 23]
impl BitsMut for [bool; 23]
[src]
impl BitsMut for [bool; 23]
impl<Block: BlockType> BitsMut for [Block; 24]
[src]
impl<Block: BlockType> BitsMut for [Block; 24]
impl BitsMut for [bool; 24]
[src]
impl BitsMut for [bool; 24]
impl<Block: BlockType> BitsMut for [Block; 25]
[src]
impl<Block: BlockType> BitsMut for [Block; 25]
impl BitsMut for [bool; 25]
[src]
impl BitsMut for [bool; 25]
impl<Block: BlockType> BitsMut for [Block; 26]
[src]
impl<Block: BlockType> BitsMut for [Block; 26]
impl BitsMut for [bool; 26]
[src]
impl BitsMut for [bool; 26]
impl<Block: BlockType> BitsMut for [Block; 27]
[src]
impl<Block: BlockType> BitsMut for [Block; 27]
impl BitsMut for [bool; 27]
[src]
impl BitsMut for [bool; 27]
impl<Block: BlockType> BitsMut for [Block; 28]
[src]
impl<Block: BlockType> BitsMut for [Block; 28]
impl BitsMut for [bool; 28]
[src]
impl BitsMut for [bool; 28]
impl<Block: BlockType> BitsMut for [Block; 29]
[src]
impl<Block: BlockType> BitsMut for [Block; 29]
impl BitsMut for [bool; 29]
[src]
impl BitsMut for [bool; 29]
impl<Block: BlockType> BitsMut for [Block; 30]
[src]
impl<Block: BlockType> BitsMut for [Block; 30]
impl BitsMut for [bool; 30]
[src]
impl BitsMut for [bool; 30]
impl<Block: BlockType> BitsMut for [Block; 31]
[src]
impl<Block: BlockType> BitsMut for [Block; 31]
impl BitsMut for [bool; 31]
[src]
impl BitsMut for [bool; 31]
impl BitsMut for u8
[src]
impl BitsMut for u8
impl BitsMut for u16
[src]
impl BitsMut for u16
impl BitsMut for u32
[src]
impl BitsMut for u32
impl BitsMut for u64
[src]
impl BitsMut for u64
impl BitsMut for u128
[src]
impl BitsMut for u128
impl BitsMut for usize
[src]
impl BitsMut for usize
Implementors
impl<'a, Block: BlockType> BitsMut for BitSliceMut<'a, Block>
impl<Block: BlockType> BitsMut for BitVec<Block>
impl<T: BitsMut> BitsMut for BitSliceAdapter<T>
impl<Block: BlockType> BitsMut for BoolAdapter<Block, Vec<bool>>
impl<'a, Block: BlockType> BitsMut for BoolAdapter<Block, &'a mut Vec<bool>>
impl<'a, Block: BlockType> BitsMut for BoolAdapter<Block, &'a mut [bool]>