BitVecValueRef

Struct BitVecValueRef 

Source
pub struct BitVecValueRef<'a>(/* private fields */);
Expand description

Bit-vector value that does not own its storage.

Implementations§

Source§

impl<'a> BitVecValueRef<'a>

Source

pub fn new(words: &'a [Word], width: WidthInt) -> Self

Trait Implementations§

Source§

impl BitVecOps for BitVecValueRef<'_>

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_bit_str_signed(&self) -> String

Convert to a string of 1s and 0s with a - if the value is negative.
Source§

fn to_hex_str(&self) -> String

Convert to a string of hex characters
Source§

fn to_dec_str(&self) -> String

Convert to a string of a decimal number. No leading zeros.
Source§

fn to_hex_str_signed(&self) -> String

Convert to a string of hex characters with a - if the value is negative.
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_true(&self) -> bool

Source§

fn is_false(&self) -> bool

Source§

fn is_zero(&self) -> bool

Source§

fn is_one(&self) -> bool

Source§

fn is_all_ones(&self) -> bool

Source§

fn is_negative(&self) -> bool

Source§

fn is_pow_2(&self) -> Option<WidthInt>

Source§

fn min_width(&self) -> WidthInt

Computes the minimum number of bits that are necessary to represent the current value. This corresponds to the position of the most significant 1 plus one.
Source§

fn bit_set_intervals(&self) -> Vec<Range<WidthInt>>

Computes all ranges for which the bits are one.
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 is_bit_set(&self, pos: WidthInt) -> bool

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<'a> Borrow<BitVecValueRef<'a>> for BitVecValue

Source§

fn borrow(&self) -> &BitVecValueRef<'a>

Immutably borrows from an owned value. Read more
Source§

impl<'a> Clone for BitVecValueRef<'a>

Source§

fn clone(&self) -> BitVecValueRef<'a>

Returns a duplicate 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 BitVecValueRef<'_>

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<BitVecValueRef<'a>> for BitVecValue

Source§

fn from(value: BitVecValueRef<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> Hash for BitVecValueRef<'a>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a, I> IndexToRef<I, BitVecValueRef<'a>> for &'a [Word]

Source§

fn get_ref(self, index: I) -> BitVecValueRef<'a>

Source§

impl<O: BitVecOps> PartialEq<O> for BitVecValueRef<'_>

Source§

fn eq(&self, other: &O) -> 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<'a> Copy for BitVecValueRef<'a>

Source§

impl Eq for BitVecValueRef<'_>

Auto Trait Implementations§

§

impl<'a> Freeze for BitVecValueRef<'a>

§

impl<'a> RefUnwindSafe for BitVecValueRef<'a>

§

impl<'a> Send for BitVecValueRef<'a>

§

impl<'a> Sync for BitVecValueRef<'a>

§

impl<'a> Unpin for BitVecValueRef<'a>

§

impl<'a> UnwindSafe for BitVecValueRef<'a>

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.