Bv

Struct Bv 

Source
pub struct Bv<S: Size + ?Sized> { /* private fields */ }
Expand description

An unsigned integer (bitvector), whose size is indicated by the type parameter S.

Implementations§

Source§

impl<S: Size> Bv<S>

Source

pub const ZERO: Self

Source

pub const ONE: Self

Source

pub const MAX: Self

Source§

impl<S: Size> Bv<S>

Source

pub fn overflowing_add(self, other: Bv<S>) -> (Bv<S>, bool)

Source

pub fn overflowing_sub(self, other: Bv<S>) -> (Bv<S>, bool)

Source

pub fn overflowing_mul(self, other: Bv<S>) -> (Bv<S>, bool)

Source

pub fn leading_zeros(self) -> u32

Trait Implementations§

Source§

impl<S: Size> Add for Bv<S>

Source§

type Output = Bv<S>

The resulting type after applying the + operator.
Source§

fn add(self, other: Bv<S>) -> Bv<S>

Performs the + operation. Read more
Source§

impl<S: Size> BitAnd for Bv<S>

Source§

type Output = Bv<S>

The resulting type after applying the & operator.
Source§

fn bitand(self, other: Bv<S>) -> Bv<S>

Performs the & operation. Read more
Source§

impl<S: Size> BitOr for Bv<S>

Source§

type Output = Bv<S>

The resulting type after applying the | operator.
Source§

fn bitor(self, other: Bv<S>) -> Bv<S>

Performs the | operation. Read more
Source§

impl<S: Size> BitXor for Bv<S>

Source§

type Output = Bv<S>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, other: Bv<S>) -> Bv<S>

Performs the ^ operation. Read more
Source§

impl<S: Size> Clone for Bv<S>

Source§

fn clone(&self) -> Bv<S>

Returns a duplicate of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
Source§

impl<S: Size> Div for Bv<S>

Source§

type Output = Bv<S>

The resulting type after applying the / operator.
Source§

fn div(self, other: Bv<S>) -> Bv<S>

Performs the / operation. Read more
Source§

impl<S: Size> From<Bv<S>> for i128

Source§

fn from(x: Bv<S>) -> i128

Converts to this type from the input type.
Source§

impl<S: Size> From<Bv<S>> for i16

Source§

fn from(x: Bv<S>) -> i16

Converts to this type from the input type.
Source§

impl<S: Size> From<Bv<S>> for i32

Source§

fn from(x: Bv<S>) -> i32

Converts to this type from the input type.
Source§

impl<S: Size> From<Bv<S>> for i64

Source§

fn from(x: Bv<S>) -> i64

Converts to this type from the input type.
Source§

impl<S: Size> From<Bv<S>> for i8

Source§

fn from(x: Bv<S>) -> i8

Converts to this type from the input type.
Source§

impl<S: Size> From<Bv<S>> for isize

Source§

fn from(x: Bv<S>) -> isize

Converts to this type from the input type.
Source§

impl<S: Size> From<Bv<S>> for u128

Source§

fn from(x: Bv<S>) -> u128

Converts to this type from the input type.
Source§

impl<S: Size> From<Bv<S>> for u16

Source§

fn from(x: Bv<S>) -> u16

Converts to this type from the input type.
Source§

impl<S: Size> From<Bv<S>> for u32

Source§

fn from(x: Bv<S>) -> u32

Converts to this type from the input type.
Source§

impl<S: Size> From<Bv<S>> for u64

Source§

fn from(x: Bv<S>) -> u64

Converts to this type from the input type.
Source§

impl<S: Size> From<Bv<S>> for u8

Source§

fn from(x: Bv<S>) -> u8

Converts to this type from the input type.
Source§

impl<S: Size> From<Bv<S>> for usize

Source§

fn from(x: Bv<S>) -> usize

Converts to this type from the input type.
Source§

impl From<Bv<_128>> for Bv<_256>

Source§

fn from(x: Bv<_128>) -> Bv<_256>

Converts to this type from the input type.
Source§

impl From<Bv<_128>> for Bv<_512>

Source§

fn from(x: Bv<_128>) -> Bv<_512>

Converts to this type from the input type.
Source§

impl From<Bv<_256>> for Bv<_128>

Source§

fn from(x: Bv<_256>) -> Bv<_128>

Converts to this type from the input type.
Source§

impl From<Bv<_256>> for Bv<_512>

Source§

fn from(x: Bv<_256>) -> Bv<_512>

Converts to this type from the input type.
Source§

impl From<Bv<_512>> for Bv<_128>

Source§

fn from(x: Bv<_512>) -> Bv<_128>

Converts to this type from the input type.
Source§

impl From<Bv<_512>> for Bv<_256>

Source§

fn from(x: Bv<_512>) -> Bv<_256>

Converts to this type from the input type.
Source§

impl<S: Size> From<i128> for Bv<S>

Source§

fn from(x: i128) -> Bv<S>

Converts to this type from the input type.
Source§

impl<S: Size> From<i16> for Bv<S>

Source§

fn from(x: i16) -> Bv<S>

Converts to this type from the input type.
Source§

impl<S: Size> From<i32> for Bv<S>

Source§

fn from(x: i32) -> Bv<S>

Converts to this type from the input type.
Source§

impl<S: Size> From<i64> for Bv<S>

Source§

fn from(x: i64) -> Bv<S>

Converts to this type from the input type.
Source§

impl<S: Size> From<i8> for Bv<S>

Source§

fn from(x: i8) -> Bv<S>

Converts to this type from the input type.
Source§

impl<S: Size> From<isize> for Bv<S>

Source§

fn from(x: isize) -> Bv<S>

Converts to this type from the input type.
Source§

impl<S: Size> From<u128> for Bv<S>

Source§

fn from(x: u128) -> Bv<S>

Converts to this type from the input type.
Source§

impl<S: Size> From<u16> for Bv<S>

Source§

fn from(x: u16) -> Bv<S>

Converts to this type from the input type.
Source§

impl<S: Size> From<u32> for Bv<S>

Source§

fn from(x: u32) -> Bv<S>

Converts to this type from the input type.
Source§

impl<S: Size> From<u64> for Bv<S>

Source§

fn from(x: u64) -> Bv<S>

Converts to this type from the input type.
Source§

impl<S: Size> From<u8> for Bv<S>

Source§

fn from(x: u8) -> Bv<S>

Converts to this type from the input type.
Source§

impl<S: Size> From<usize> for Bv<S>

Source§

fn from(x: usize) -> Bv<S>

Converts to this type from the input type.
Source§

impl<S: Size> Mul for Bv<S>

Source§

type Output = Bv<S>

The resulting type after applying the * operator.
Source§

fn mul(self, other: Bv<S>) -> Bv<S>

Performs the * operation. Read more
Source§

impl<S: Size> Not for Bv<S>

Source§

type Output = Bv<S>

The resulting type after applying the ! operator.
Source§

fn not(self) -> Bv<S>

Performs the unary ! operation. Read more
Source§

impl<S: Size> Ord for Bv<S>

Source§

fn cmp(&self, other: &Bv<S>) -> Ordering

This method returns an [Ordering] between self and other. Read more
1.21.0§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<S: Size> PartialEq for Bv<S>

Source§

fn eq(&self, other: &Bv<S>) -> bool

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

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<S: Size> PartialOrd for Bv<S>

Source§

fn partial_cmp(&self, other: &Bv<S>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
Source§

fn lt(&self, other: &Bv<S>) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<S: Size> Rem for Bv<S>

Source§

type Output = Bv<S>

The resulting type after applying the % operator.
Source§

fn rem(self, other: Bv<S>) -> Bv<S>

Performs the % operation. Read more
Source§

impl<S: Size> Shl<usize> for Bv<S>

Source§

type Output = Bv<S>

The resulting type after applying the << operator.
Source§

fn shl(self, shift: usize) -> Bv<S>

Performs the << operation. Read more
Source§

impl<S: Size> Shr<usize> for Bv<S>

Source§

type Output = Bv<S>

The resulting type after applying the >> operator.
Source§

fn shr(self, shift: usize) -> Bv<S>

Performs the >> operation. Read more
Source§

impl<S: Size> Sub for Bv<S>

Source§

type Output = Bv<S>

The resulting type after applying the - operator.
Source§

fn sub(self, other: Bv<S>) -> Bv<S>

Performs the - operation. Read more
Source§

impl<S: Size> Symbolic for Bv<S>

Source§

fn symbolic(desc: &str) -> Bv<S>

Create a new symbolic value of this type. desc is used to refer to this symbolic value when printing counterexamples.
Source§

fn symbolic_where<F: FnOnce(&Self) -> bool>(desc: &str, f: F) -> Self

Create a new symbolic value, subject to constraints. The result is a symbolic value of this type on which f returns true.
Source§

impl<S: Size> Copy for Bv<S>

Source§

impl<S: Size> Eq for Bv<S>

Auto Trait Implementations§

§

impl<S> Freeze for Bv<S>
where S: ?Sized,

§

impl<S> RefUnwindSafe for Bv<S>
where S: RefUnwindSafe + ?Sized,

§

impl<S> Send for Bv<S>
where S: Send + ?Sized,

§

impl<S> Sync for Bv<S>
where S: Sync + ?Sized,

§

impl<S> Unpin for Bv<S>
where S: Unpin + ?Sized,

§

impl<S> UnwindSafe for Bv<S>
where S: UnwindSafe + ?Sized,

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

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

§

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
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.