pub fn fill_uninitialized(&mut self, value: bool) {
		let (_, head, bits) = self.bitspan.raw_parts();
		let head = head.into_inner() as usize;
		let tail = head + bits;
		let all = self.as_raw_mut_slice().view_bits_mut::<O>();
		unsafe {
			all.get_unchecked_mut(.. head).fill(value);
			all.get_unchecked_mut(tail ..).fill(value);
		}
	}
/// Sets the unused bits outside the `BitBox` buffer to a fixed value.
///
/// This method modifies all bits that the allocated buffer owns but which
/// are outside the `self.as_bitslice()` view. `bitvec` guarantees that all
/// owned bits are initialized to *some* value, but does not guarantee
/// *which* value. This method can be used to make all such unused bits have
/// a known value after the call, so that viewing the underlying memory
/// directly has consistent results.
///
/// Note that the crate implementation guarantees that all bits owned by its
/// handles are stably initialized according to the language and compiler
/// rules! `bitvec` will never cause UB by using uninitialized memory.
///
/// ## Examples
///
/// ```rust
/// use bitvec::prelude::*;
///
/// let bits = 0b1011_0101u8.view_bits::<Msb0>();
/// let mut bb = BitBox::from_bitslice(&bits[2 .. 6]);
/// assert_eq!(bb.count_ones(), 3);
/// // Remember, the two bits on each edge are unspecified, and cannot be
/// // observed! They must be masked away for the test to be meaningful.
/// assert_eq!(bb.as_raw_slice()[0] & 0x3C, 0b00_1101_00u8);
///
/// bb.fill_uninitialized(false);
/// assert_eq!(bb.as_raw_slice(), &[0b00_1101_00u8]);
///
/// bb.fill_uninitialized(true);
/// assert_eq!(bb.as_raw_slice(), &[0b11_1101_11u8]);
/// ```
Sets the unused bits outside the `BitBox` buffer to a fixed value.
This method modifies all bits that the allocated buffer owns but which
are outside the `self.as_bitslice()` view. `bitvec` guarantees that all
owned bits are initialized to *some* value, but does not guarantee
which* value. This method can be used to make all such unused bits have
a known value after the call, so that viewing the underlying memory
directly has consistent results.

Note that the crate implementation guarantees that all bits owned by its
handles are stably initialized according to the language and compiler
rules. `bitvec` will never cause UB by using uninitialized memory.
Sets the unused bits outside the ` BitBox ` buffer to a fixed value . This method modifies all bits that the allocated buffer owns but which are outside the ` self . as_bitslice () ` view . ` bitvec ` guarantees that all owned bits are initialized to * some * value but does not guarantee which * value . This method can be used to make all such unused bits have a known value after the call so that viewing the underlying memory directly has consistent results . Note that the crate implementation guarantees that all bits owned by its handles are stably initialized according to the language and compiler rules . ` bitvec ` will never cause UB by using uninitialized memory .
pub fn fill_uninitialized(&mut self, value: bool) {
		let (_, head, bits) = self.bitspan.raw_parts();
		let head = head.into_inner() as usize;
		let tail = head + bits;
		let all = self.as_raw_mut_slice().view_bits_mut::<O>();
		unsafe {
			all.get_unchecked_mut(.. head).fill(value);
			all.get_unchecked_mut(tail ..).fill(value);
		}
	}
pub fn fill_uninitialized ( & mut self , value : bool ) { let ( _ , head , bits ) = self . bitspan . raw_parts ( ) ; let head = head . into_inner ( ) as usize ; let tail = head + bits ; let all = self . as_raw_mut_slice ( ) . view_bits_mut :: < O > ( ) ; unsafe { all . get_unchecked_mut ( .. head ) . fill ( value ) ; all . get_unchecked_mut ( tail .. ) . fill ( value ) ; } }
Sets the unused bits outside the `BitBox` buffer to a fixed value.
Sets the unused bits outside the ` BitBox ` buffer to a fixed value .
&mut self
value
bool
&mut self
value
bool
examples
```rust
use bitvec::prelude::*.






` ` ` rust use bitvec :: prelude :: * .