Struct baa::BitVecValue

source ·
pub struct BitVecValue { /* private fields */ }
Expand description

Owned bit-vector value.

Implementations§

source§

impl BitVecValue

source

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.

source

pub fn from_u64(value: u64, width: WidthInt) -> Self

source

pub fn from_i64(value: i64, width: WidthInt) -> Self

source

pub fn from_bool(value: bool) -> Self

source

pub fn from_bytes_le(bytes: &[u8], bits: WidthInt) -> Self

source

pub fn zero(width: WidthInt) -> Self

source

pub fn ones(width: WidthInt) -> Self

source

pub fn tru() -> Self

source

pub fn fals() -> Self

Trait Implementations§

source§

impl<V: BitVecOps> Add<&V> for &BitVecValue

source§

type Output = BitVecValue

The resulting type after applying the + operator.
source§

fn add(self, rhs: &V) -> Self::Output

Performs the + operation. Read more
source§

impl BitVecMutOps for BitVecValue

source§

fn words_mut(&mut self) -> &mut [Word]

source§

fn assign<'a>(&mut self, value: impl Into<BitVecValueRef<'a>>)

source§

fn mask_msb(&mut self)

ensures that all unused bits in the most significant word are set to zero
source§

fn clear(&mut self)

sets all bits to zero
source§

fn assign_ones(&mut self)

sets all bits to one
source§

fn assign_from_u64(&mut self, value: u64)

source§

fn assign_from_i64(&mut self, value: i64)

source§

fn assign_from_str_radix( &mut self, value: &str, radix: u32, ) -> Result<WidthInt, ParseIntError>

source§

impl BitVecOps for BitVecValue

source§

fn width(&self) -> WidthInt

source§

fn words(&self) -> &[Word]

source§

fn to_bit_str(&self) -> String

Convert to a string of 1s and 0s.
source§

fn to_bytes_le(&self) -> Vec<u8>

source§

fn to_bool(&self) -> Option<bool>

Returns value as a bool iff the value is a 1-bit value.
source§

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>

Returns the value as a 64-bit signed integer if the value can be represented
source§

fn is_zero(&self) -> bool

source§

fn is_negative(&self) -> bool

source§

fn add<R: BitVecOps>(&self, rhs: &R) -> BitVecValue

source§

fn sub<R: BitVecOps>(&self, rhs: &R) -> BitVecValue

source§

fn shift_left<R: BitVecOps>(&self, rhs: &R) -> BitVecValue

source§

fn shift_right<R: BitVecOps>(&self, rhs: &R) -> BitVecValue

source§

fn arithmetic_shift_right<R: BitVecOps>(&self, rhs: &R) -> BitVecValue

source§

fn mul<R: BitVecOps>(&self, rhs: &R) -> BitVecValue

source§

fn and<R: BitVecOps>(&self, rhs: &R) -> BitVecValue

source§

fn or<R: BitVecOps>(&self, rhs: &R) -> BitVecValue

source§

fn xor<R: BitVecOps>(&self, rhs: &R) -> BitVecValue

source§

fn is_equal<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool

source§

fn is_not_equal<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool

source§

fn is_greater<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool

source§

fn is_greater_or_equal<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool

source§

fn is_less<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool

source§

fn is_less_or_equal<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool

source§

fn is_greater_signed<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool

source§

fn is_greater_or_equal_signed<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool

source§

fn is_less_signed<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool

source§

fn is_less_or_equal_signed<R: BitVecOps + ?Sized>(&self, rhs: &R) -> bool

source§

fn slice(&self, msb: WidthInt, lsb: WidthInt) -> BitVecValue

source§

fn sign_extend(&self, by: WidthInt) -> BitVecValue

source§

fn zero_extend(&self, by: WidthInt) -> BitVecValue

source§

fn not(&self) -> BitVecValue

source§

fn negate(&self) -> BitVecValue

source§

fn concat<R: BitVecOps + ?Sized>(&self, rhs: &R) -> BitVecValue

source§

impl Clone for BitVecValue

source§

fn clone(&self) -> BitVecValue

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BitVecValue

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> From<&'a BitVecValue> for BitVecValueRef<'a>

source§

fn from(value: &'a BitVecValue) -> Self

Converts to this type from the input type.
source§

impl<'a> From<&'a mut BitVecValue> for BitVecValueMutRef<'a>

source§

fn from(value: &'a mut BitVecValue) -> Self

Converts to this type from the input type.
source§

impl From<bool> for BitVecValue

source§

fn from(value: bool) -> Self

Converts to this type from the input type.
source§

impl<V: BitVecOps> PartialEq<V> for BitVecValue

source§

fn eq(&self, other: &V) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<V: BitVecOps> Sub<&V> for &BitVecValue

source§

type Output = BitVecValue

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &V) -> Self::Output

Performs the - operation. Read more
source§

impl Eq for BitVecValue

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.