Struct baa::BitVecValue
source · pub struct BitVecValue { /* private fields */ }Expand description
Owned bit-vector value.
Implementations§
source§impl BitVecValue
impl BitVecValue
sourcepub fn from_bit_str(value: &str) -> Self
pub fn from_bit_str(value: &str) -> Self
Parse a string of 1s and 0s. The width of the resulting value is the number of digits.
pub fn from_u64(value: u64, width: WidthInt) -> Self
pub fn from_i64(value: i64, width: WidthInt) -> Self
pub fn from_bool(value: bool) -> Self
pub fn from_bytes_le(bytes: &[u8], bits: WidthInt) -> Self
pub fn zero(width: WidthInt) -> Self
pub fn ones(width: WidthInt) -> Self
pub fn tru() -> Self
pub fn fals() -> Self
Trait Implementations§
source§impl BitVecMutOps for BitVecValue
impl BitVecMutOps for BitVecValue
fn words_mut(&mut self) -> &mut [Word]
fn assign<'a>(&mut self, value: impl Into<BitVecValueRef<'a>>)
source§fn mask_msb(&mut self)
fn mask_msb(&mut self)
ensures that all unused bits in the most significant word are set to zero
source§fn assign_ones(&mut self)
fn assign_ones(&mut self)
sets all bits to one
fn assign_from_u64(&mut self, value: u64)
fn assign_from_i64(&mut self, value: i64)
fn assign_from_str_radix( &mut self, value: &str, radix: u32, ) -> Result<WidthInt, ParseIntError>
source§impl BitVecOps for BitVecValue
impl BitVecOps for BitVecValue
fn width(&self) -> WidthInt
fn words(&self) -> &[Word]
source§fn to_bit_str(&self) -> String
fn to_bit_str(&self) -> String
Convert to a string of 1s and 0s.
fn to_bytes_le(&self) -> Vec<u8>
source§fn to_u64(&self) -> Option<u64>
fn to_u64(&self) -> Option<u64>
Returns the value as a 64-bit unsigned integer if the value can be represented
source§fn to_i64(&self) -> Option<i64>
fn to_i64(&self) -> Option<i64>
Returns the value as a 64-bit signed integer if the value can be represented
fn is_zero(&self) -> bool
fn is_negative(&self) -> bool
fn add<R: BitVecOps>(&self, rhs: &R) -> BitVecValue
fn sub<R: BitVecOps>(&self, rhs: &R) -> BitVecValue
fn shift_left<R: BitVecOps>(&self, rhs: &R) -> BitVecValue
fn shift_right<R: BitVecOps>(&self, rhs: &R) -> BitVecValue
fn arithmetic_shift_right<R: BitVecOps>(&self, rhs: &R) -> BitVecValue
fn mul<R: BitVecOps>(&self, rhs: &R) -> BitVecValue
fn and<R: BitVecOps>(&self, rhs: &R) -> BitVecValue
fn or<R: BitVecOps>(&self, rhs: &R) -> BitVecValue
fn xor<R: BitVecOps>(&self, rhs: &R) -> BitVecValue
fn is_equal<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool
fn is_not_equal<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool
fn is_greater<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool
fn is_greater_or_equal<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool
fn is_less<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool
fn is_less_or_equal<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool
fn is_greater_signed<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool
fn is_greater_or_equal_signed<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool
fn is_less_signed<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool
fn is_less_or_equal_signed<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool
fn slice(&self, msb: WidthInt, lsb: WidthInt) -> BitVecValue
fn sign_extend(&self, by: WidthInt) -> BitVecValue
fn zero_extend(&self, by: WidthInt) -> BitVecValue
fn not(&self) -> BitVecValue
fn negate(&self) -> BitVecValue
fn concat<R: BitVecOps + ?Sized>(&self, rhs: &R) -> BitVecValue
source§impl Clone for BitVecValue
impl Clone for BitVecValue
source§fn clone(&self) -> BitVecValue
fn clone(&self) -> BitVecValue
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for BitVecValue
impl Debug for BitVecValue
source§impl<'a> From<&'a BitVecValue> for BitVecValueRef<'a>
impl<'a> From<&'a BitVecValue> for BitVecValueRef<'a>
source§fn from(value: &'a BitVecValue) -> Self
fn from(value: &'a BitVecValue) -> Self
Converts to this type from the input type.
source§impl<'a> From<&'a mut BitVecValue> for BitVecValueMutRef<'a>
impl<'a> From<&'a mut BitVecValue> for BitVecValueMutRef<'a>
source§fn from(value: &'a mut BitVecValue) -> Self
fn from(value: &'a mut BitVecValue) -> Self
Converts to this type from the input type.
source§impl From<bool> for BitVecValue
impl From<bool> for BitVecValue
source§impl<V: BitVecOps> PartialEq<V> for BitVecValue
impl<V: BitVecOps> PartialEq<V> for BitVecValue
impl Eq for BitVecValue
Auto Trait Implementations§
impl Freeze for BitVecValue
impl RefUnwindSafe for BitVecValue
impl Send for BitVecValue
impl Sync for BitVecValue
impl Unpin for BitVecValue
impl UnwindSafe for BitVecValue
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)