fn new<A, O>(bits: &BitSlice<A::Store, O>) -> Result<(), Self>
	where
		O: BitOrder,
		A: BitViewSized,
	{
		let bitspan = bits.as_bitspan();
		let actual = bitspan.len();
		let expected = mem::bits_of::<A>();
		if actual != expected {
			return Err(Self::UnequalLen { actual, expected });
		}
		if bitspan.head() != BitIdx::<<A::Store as BitStore>::Mem>::MIN {
			return Err(Self::Misaligned);
		}
		Ok(())
	}
/// Checks whether a bit-slice is suitable to view as a bit-array.
Checks whether a bit-slice is suitable to view as a bit-array.
Checks whether a bit - slice is suitable to view as a bit - array .
fn new<A, O>(bits: &BitSlice<A::Store, O>) -> Result<(), Self>
	where
		O: BitOrder,
		A: BitViewSized,
	{
		let bitspan = bits.as_bitspan();
		let actual = bitspan.len();
		let expected = mem::bits_of::<A>();
		if actual != expected {
			return Err(Self::UnequalLen { actual, expected });
		}
		if bitspan.head() != BitIdx::<<A::Store as BitStore>::Mem>::MIN {
			return Err(Self::Misaligned);
		}
		Ok(())
	}
fn new < A , O > ( bits : & BitSlice < A :: Store , O > ) -> Result < ( ) , Self > where O : BitOrder , A : BitViewSized , { let bitspan = bits . as_bitspan ( ) ; let actual = bitspan . len ( ) ; let expected = mem :: bits_of :: < A > ( ) ; if actual != expected { return Err ( Self :: UnequalLen { actual , expected } ) ; } if bitspan . head ( ) != BitIdx :: < < A :: Store as BitStore > :: Mem > :: MIN { return Err ( Self :: Misaligned ) ; } Ok ( ( ) ) }
Checks whether a bit-slice is suitable to view as a bit-array.
Checks whether a bit - slice is suitable to view as a bit - array .
bits
&BitSlice<A::Store, O>
bits
&BitSlice<A::Store, O>