pub struct BitVec<'st, const M: usize>(/* private fields */);Expand description
A bit-vec is a fixed size sequence of boolean values. You can read more about it here, among other places.
Implementations§
Source§impl<'st, const M: usize> BitVec<'st, M>
impl<'st, const M: usize> BitVec<'st, M>
Sourcepub fn new(
st: &'st Storage,
value: impl IntoWithStorage<'st, BitVec<'st, M>>,
) -> BitVec<'st, M>
pub fn new( st: &'st Storage, value: impl IntoWithStorage<'st, BitVec<'st, M>>, ) -> BitVec<'st, M>
Construct a new bit-vec.
value can be either [bool; M] or i64 to enable usage with integer
literals.
Note: new_prim can be used with multiple integer types instead.
Sourcepub fn new_prim(st: &'st Storage, value: impl PrimInt<M>) -> BitVec<'st, M>
pub fn new_prim(st: &'st Storage, value: impl PrimInt<M>) -> BitVec<'st, M>
Construct a new bit-vec from a primitive integer (e.g. u8, u32,
u64).
Sourcepub fn try_into_prim<T: PrimInt<M>>(&self) -> Result<T, ParseIntError>
pub fn try_into_prim<T: PrimInt<M>>(&self) -> Result<T, ParseIntError>
Try to convert this bit-vec back into a primitive integer. Returns an error if the underlying term is not a bit-vector literal.
Sourcepub fn extract_<const O: usize>(self, i: usize, j: usize) -> BitVec<'st, O>
pub fn extract_<const O: usize>(self, i: usize, j: usize) -> BitVec<'st, O>
Extract a slice of the bit-vec.
The constraints i, j, M, and O are:
M > i >= j
O = j - i + 1Note: This is a version of BitVec::extract that does not depend on
unstable feature generic_const_exprs. If you’re using nightly
consider enabling "const-bit-vec" feature flag and
use BitVec::extract instead.
Sourcepub fn repeat_<const O: usize>(self, count: usize) -> BitVec<'st, O>
pub fn repeat_<const O: usize>(self, count: usize) -> BitVec<'st, O>
Concatenate count copies of self to a new bit-vec
Note: This is a version of BitVec::repeat that does not depend on
unstable feature generic_const_exprs. If you’re using nightly
consider enabling "const-bit-vec" feature flag and
use BitVec::repeat instead.
Sourcepub fn concat_<const N: usize, const O: usize>(
self,
other: impl Into<BitVec<'st, N>>,
) -> BitVec<'st, O>
pub fn concat_<const N: usize, const O: usize>( self, other: impl Into<BitVec<'st, N>>, ) -> BitVec<'st, O>
Concatenates self and other bit-vecs to a single contiguous bit-vec
with length N + M
Note: This is a version of BitVec::concat that does not depend on
unstable feature generic_const_exprs. If you’re using nightly
consider enabling "const-bit-vec" feature flag and
use BitVec::concat instead.
Sourcepub fn zero_extend_<const O: usize>(self, n: usize) -> BitVec<'st, O>
pub fn zero_extend_<const O: usize>(self, n: usize) -> BitVec<'st, O>
Extend the bit-vec with zeros to the left.
Note: This is a version of BitVec::zero_extend that does not depend on
unstable feature generic_const_exprs. If you’re using nightly
consider enabling "const-bit-vec" feature flag and
use BitVec::zero_extend instead.
Sourcepub fn sign_extend_<const O: usize>(self, n: usize) -> BitVec<'st, O>
pub fn sign_extend_<const O: usize>(self, n: usize) -> BitVec<'st, O>
Extend the bit-vec with the sign bit to the left.
Note: This is a version of BitVec::sign_extend that does not depend on
unstable feature generic_const_exprs. If you’re using nightly
consider enabling "const-bit-vec" feature flag and
use BitVec::sign_extend instead.
Sourcepub fn rotate_left(self, n: usize) -> Self
pub fn rotate_left(self, n: usize) -> Self
Rotate the bit-vec to the left.
Sourcepub fn rotate_right(self, n: usize) -> Self
pub fn rotate_right(self, n: usize) -> Self
Rotate the bit-vec to the right.
Sourcepub fn bvnand(self, other: impl Into<Self>) -> Self
pub fn bvnand(self, other: impl Into<Self>) -> Self
Calls (bvnand self other) i.e. bitwise nand
Sourcepub fn bvxnor(self, other: impl Into<Self>) -> Self
pub fn bvxnor(self, other: impl Into<Self>) -> Self
Calls (bvxnor self other) i.e. bitwise xnor
Sourcepub fn bvcomp(self, other: impl Into<Self>) -> BitVec<'st, 1>
pub fn bvcomp(self, other: impl Into<Self>) -> BitVec<'st, 1>
Calls (bvcomp self other) i.e. bitwise comparison
Sourcepub fn bvsdiv(self, other: impl Into<Self>) -> Self
pub fn bvsdiv(self, other: impl Into<Self>) -> Self
Calls (bvsdiv self other) i.e. signed division
Sourcepub fn bvsrem(self, other: impl Into<Self>) -> Self
pub fn bvsrem(self, other: impl Into<Self>) -> Self
Calls (bvsrem self other) i.e. signed remainder
(sign follows dividend)
Sourcepub fn bvsmod(self, other: impl Into<Self>) -> Self
pub fn bvsmod(self, other: impl Into<Self>) -> Self
Calls (bvsmod self other) i.e. signed remainder
(sign follows divisor)
Sourcepub fn bvashr(self, other: impl Into<Self>) -> Self
pub fn bvashr(self, other: impl Into<Self>) -> Self
Calls (bvashr self other) i.e. arithmetic shift right
Sourcepub fn bvule(self, other: impl Into<Self>) -> Bool<'st>
pub fn bvule(self, other: impl Into<Self>) -> Bool<'st>
Calls (bvule self other) i.e. unsigned less or equal
Sourcepub fn bvugt(self, other: impl Into<Self>) -> Bool<'st>
pub fn bvugt(self, other: impl Into<Self>) -> Bool<'st>
Calls (bvugt self other) i.e. unsigned greater than
Sourcepub fn bvuge(self, other: impl Into<Self>) -> Bool<'st>
pub fn bvuge(self, other: impl Into<Self>) -> Bool<'st>
Calls (bvuge self other) i.e. unsigned greater or equal
Sourcepub fn bvslt(self, other: impl Into<Self>) -> Bool<'st>
pub fn bvslt(self, other: impl Into<Self>) -> Bool<'st>
Calls (bvslt self other) i.e. signed less than
Sourcepub fn bvsle(self, other: impl Into<Self>) -> Bool<'st>
pub fn bvsle(self, other: impl Into<Self>) -> Bool<'st>
Calls (bvsle self other) i.e. signed less or equal
Trait Implementations§
Source§impl<'st, const M: usize, R> AddAssign<R> for BitVec<'st, M>
impl<'st, const M: usize, R> AddAssign<R> for BitVec<'st, M>
Source§fn add_assign(&mut self, rhs: R)
fn add_assign(&mut self, rhs: R)
+= operation. Read moreSource§impl<'st, const M: usize, R> BitAndAssign<R> for BitVec<'st, M>
impl<'st, const M: usize, R> BitAndAssign<R> for BitVec<'st, M>
Source§fn bitand_assign(&mut self, rhs: R)
fn bitand_assign(&mut self, rhs: R)
&= operation. Read moreSource§impl<'st, const M: usize, R> BitOrAssign<R> for BitVec<'st, M>
impl<'st, const M: usize, R> BitOrAssign<R> for BitVec<'st, M>
Source§fn bitor_assign(&mut self, rhs: R)
fn bitor_assign(&mut self, rhs: R)
|= operation. Read moreSource§impl<'st, const M: usize, R> BitXorAssign<R> for BitVec<'st, M>
impl<'st, const M: usize, R> BitXorAssign<R> for BitVec<'st, M>
Source§fn bitxor_assign(&mut self, rhs: R)
fn bitxor_assign(&mut self, rhs: R)
^= operation. Read moreimpl<'st, const M: usize> Copy for BitVec<'st, M>
Source§impl<'st, const M: usize, R> DivAssign<R> for BitVec<'st, M>
impl<'st, const M: usize, R> DivAssign<R> for BitVec<'st, M>
Source§fn div_assign(&mut self, rhs: R)
fn div_assign(&mut self, rhs: R)
/= operation. Read moreSource§impl<'st, const M: usize> IntoWithStorage<'st, BitVec<'st, M>> for [bool; M]
impl<'st, const M: usize> IntoWithStorage<'st, BitVec<'st, M>> for [bool; M]
Source§fn into_with_storage(self, st: &'st Storage) -> BitVec<'st, M>
fn into_with_storage(self, st: &'st Storage) -> BitVec<'st, M>
STerm with the presence of StorageSource§impl<'st, const M: usize> IntoWithStorage<'st, BitVec<'st, M>> for i64
impl<'st, const M: usize> IntoWithStorage<'st, BitVec<'st, M>> for i64
Source§fn into_with_storage(self, st: &'st Storage) -> BitVec<'st, M>
fn into_with_storage(self, st: &'st Storage) -> BitVec<'st, M>
STerm with the presence of StorageSource§impl<'st, const M: usize, R> MulAssign<R> for BitVec<'st, M>
impl<'st, const M: usize, R> MulAssign<R> for BitVec<'st, M>
Source§fn mul_assign(&mut self, rhs: R)
fn mul_assign(&mut self, rhs: R)
*= operation. Read moreSource§impl<'st, const M: usize, R> RemAssign<R> for BitVec<'st, M>
impl<'st, const M: usize, R> RemAssign<R> for BitVec<'st, M>
Source§fn rem_assign(&mut self, rhs: R)
fn rem_assign(&mut self, rhs: R)
%= operation. Read moreSource§impl<'st, const M: usize, R> ShlAssign<R> for BitVec<'st, M>
impl<'st, const M: usize, R> ShlAssign<R> for BitVec<'st, M>
Source§fn shl_assign(&mut self, rhs: R)
fn shl_assign(&mut self, rhs: R)
<<= operation. Read moreSource§impl<'st, const M: usize, R> ShrAssign<R> for BitVec<'st, M>
impl<'st, const M: usize, R> ShrAssign<R> for BitVec<'st, M>
Source§fn shr_assign(&mut self, rhs: R)
fn shr_assign(&mut self, rhs: R)
>>= operation. Read moreSource§impl<'st, const M: usize> StaticSorted<'st> for BitVec<'st, M>
impl<'st, const M: usize> StaticSorted<'st> for BitVec<'st, M>
Source§type Inner = BitVec<'st, M>
type Inner = BitVec<'st, M>
Const<'st, T>
where the inner type is T.Source§impl<'st, const M: usize, R> SubAssign<R> for BitVec<'st, M>
impl<'st, const M: usize, R> SubAssign<R> for BitVec<'st, M>
Source§fn sub_assign(&mut self, rhs: R)
fn sub_assign(&mut self, rhs: R)
-= operation. Read moreAuto Trait Implementations§
impl<'st, const M: usize> !RefUnwindSafe for BitVec<'st, M>
impl<'st, const M: usize> !Send for BitVec<'st, M>
impl<'st, const M: usize> !Sync for BitVec<'st, M>
impl<'st, const M: usize> !UnwindSafe for BitVec<'st, M>
impl<'st, const M: usize> Freeze for BitVec<'st, M>
impl<'st, const M: usize> Unpin for BitVec<'st, M>
impl<'st, const M: usize> UnsafeUnpin for BitVec<'st, M>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<'st, T> IntoWithStorage<'st, T> for T
impl<'st, T> IntoWithStorage<'st, T> for T
Source§fn into_with_storage(self, _st: &'st Storage) -> T
fn into_with_storage(self, _st: &'st Storage) -> T
STerm with the presence of StorageSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read moreSource§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Source§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
Source§impl<'st, T> Sorted<'st> for Twhere
T: StaticSorted<'st>,
impl<'st, T> Sorted<'st> for Twhere
T: StaticSorted<'st>,
Source§type Inner = <T as StaticSorted<'st>>::Inner
type Inner = <T as StaticSorted<'st>>::Inner
Const<'st, T>
where the inner type is T.Source§fn sterm(self) -> STerm<'st>
fn sterm(self) -> STerm<'st>
Source§fn from_dynamic(d: Dynamic<'st>) -> Self
fn from_dynamic(d: Dynamic<'st>) -> Self
Source§fn try_from_dynamic(d: Dynamic<'st>) -> Option<Self>
fn try_from_dynamic(d: Dynamic<'st>) -> Option<Self>
Source§fn into_dynamic(self) -> Dynamic<'st>
fn into_dynamic(self) -> Dynamic<'st>
Source§fn _eq(self, other: impl IntoWithStorage<'st, Self::Inner>) -> Bool<'st>
fn _eq(self, other: impl IntoWithStorage<'st, Self::Inner>) -> Bool<'st>
(= self other)