pub fn with_capacity_and_blocks<I: IntoIterator<Item = Block>>(bits: usize, blocks: I) -> Self {
        let (mut n_blocks, rem) = div_rem(bits, BITS);
        n_blocks += (rem > 0) as usize;
        let mut data: Vec<Block> = blocks.into_iter().collect();
        // Pad data with zeros if smaller or truncate if larger
        if data.len() != n_blocks {
            data.resize(n_blocks, 0);
        }
        // Disable bits in blocks beyond capacity
        let end = data.len() * 32;
        for (block, mask) in Masks::new(bits..end, end) {
            unsafe {
                *data.get_unchecked_mut(block) &= !mask;
            }
        }
        FixedBitSet { data, length: bits }
    }
/// Create a new **FixedBitSet** with a specific number of bits,
/// initialized from provided blocks.
///
/// If the blocks are not the exact size needed for the capacity
/// they will be padded with zeros (if shorter) or truncated to
/// the capacity (if longer).
///
/// For example:
/// ```
/// let data = vec![4];
/// let bs = fixedbitset::FixedBitSet::with_capacity_and_blocks(4, data);
/// assert_eq!(format!("{:b}", bs), "0010");
/// ```
Create a new **FixedBitSet** with a specific number of bits,
initialized from provided blocks.

If the blocks are not the exact size needed for the capacity
they will be padded with zeros (if shorter) or truncated to
the capacity (if longer).


Create a new ** FixedBitSet ** with a specific number of bits initialized from provided blocks . If the blocks are not the exact size needed for the capacity they will be padded with zeros ( if shorter ) or truncated to the capacity ( if longer ) .
pub fn with_capacity_and_blocks<I: IntoIterator<Item = Block>>(bits: usize, blocks: I) -> Self {
        let (mut n_blocks, rem) = div_rem(bits, BITS);
        n_blocks += (rem > 0) as usize;
        let mut data: Vec<Block> = blocks.into_iter().collect();
        // Pad data with zeros if smaller or truncate if larger
        if data.len() != n_blocks {
            data.resize(n_blocks, 0);
        }
        // Disable bits in blocks beyond capacity
        let end = data.len() * 32;
        for (block, mask) in Masks::new(bits..end, end) {
            unsafe {
                *data.get_unchecked_mut(block) &= !mask;
            }
        }
        FixedBitSet { data, length: bits }
    }
pub fn with_capacity_and_blocks < I : IntoIterator < Item = Block > > ( bits : usize , blocks : I ) -> Self { let ( mut n_blocks , rem ) = div_rem ( bits , BITS ) ; n_blocks += ( rem > 0 ) as usize ; let mut data : Vec < Block > = blocks . into_iter ( ) . collect ( ) ; // Pad data with zeros if smaller or truncate if larger if data . len ( ) != n_blocks { data . resize ( n_blocks , 0 ) ; } // Disable bits in blocks beyond capacity let end = data . len ( ) * 32 ; for ( block , mask ) in Masks :: new ( bits .. end , end ) { unsafe { * data . get_unchecked_mut ( block ) &= ! mask ; } } FixedBitSet { data , length : bits } }
Create a new **FixedBitSet** with a specific number of bits,
initialized from provided blocks.
Create a new ** FixedBitSet ** with a specific number of bits initialized from provided blocks .
bits
usize
blocks
I
bits
usize
blocks
I