Skip to main content

Tnum

Struct Tnum 

Source
pub struct Tnum { /* private fields */ }
Expand description

Tracking number

Tracks on a bit-by-bit level whether we know the value of a bit & what that value is (if known).

References:

Implementations§

Source§

impl Tnum

Source

pub const fn empty() -> Self

The empty set.

Source

pub const fn from_parts(value: u64, mask: u64) -> Self

Construct a tracking number from its known value and unknown-bit mask.

Value bits covered by the mask are cleared to maintain the canonical value & mask == 0 representation.

Source

pub const fn from_value(value: u64) -> Self

Source

pub const fn parts(&self) -> Option<(u64, u64)>

Return the canonical (known_value, unknown_mask) representation.

Source

pub const fn is_const(&self) -> bool

Source

pub const fn value(&self) -> Option<u64>

Source

pub const fn contains_value(&self, value: u64) -> bool

Whether this abstract value includes value.

Source

pub const fn union(self, other: Self) -> Self

Return the least tracking number containing both operands.

Source

pub const fn intersection(self, other: Self) -> Self

Return the values represented by both operands.

Source

pub const fn is_defined(&self) -> bool

Source

pub const fn contains(&self, other: Self) -> bool

Whether this tracking number includes every value in other.

Source

pub const fn has_value(&self) -> bool

Source

pub const fn min_value(&self) -> Option<u64>

Source

pub const fn max_value(&self) -> Option<u64>

Source

pub const fn unsigned_bounds(&self) -> (u64, u64)

Source

pub const fn signed_bounds(&self) -> (i64, i64)

Source

pub const fn bit_not(self) -> Self

Source

pub const fn bit_or(self, other: Self) -> Self

Source

pub const fn bit_and(self, other: Self) -> Self

Source

pub const fn bit_xor(self, other: Self) -> Self

Source

pub const fn shift_left(self, shift: u8) -> Self

Source

pub const fn shift_right(self, shift: u8) -> Self

Source

pub const fn add(self, other: Self) -> Self

Trait Implementations§

Source§

impl Add for Tnum

Source§

type Output = Tnum

The resulting type after applying the + operator.
Source§

fn add(self, other: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl BitAnd for Tnum

Source§

type Output = Tnum

The resulting type after applying the & operator.
Source§

fn bitand(self, other: Self) -> Self

Performs the & operation. Read more
Source§

impl BitOr for Tnum

Source§

type Output = Tnum

The resulting type after applying the | operator.
Source§

fn bitor(self, other: Self) -> Self

Performs the | operation. Read more
Source§

impl BitXor for Tnum

Source§

type Output = Tnum

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, other: Self) -> Self

Performs the ^ operation. Read more
Source§

impl Clone for Tnum

Source§

fn clone(&self) -> Tnum

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Tnum

Source§

impl Debug for Tnum

Source§

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

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

impl Default for Tnum

Source§

fn default() -> Self

Default is a completely unknown value

Source§

impl Eq for Tnum

Source§

impl Not for Tnum

Source§

type Output = Tnum

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self

Performs the unary ! operation. Read more
Source§

impl PartialEq for Tnum

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Shl<u8> for Tnum

Source§

type Output = Tnum

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

fn shl(self, shift: u8) -> Self

Performs the << operation. Read more
Source§

impl Shr<u8> for Tnum

Source§

type Output = Tnum

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

fn shr(self, shift: u8) -> Self

Performs the >> operation. Read more
Source§

impl StructuralPartialEq for Tnum

Auto Trait Implementations§

§

impl Freeze for Tnum

§

impl RefUnwindSafe for Tnum

§

impl Send for Tnum

§

impl Sync for Tnum

§

impl Unpin for Tnum

§

impl UnsafeUnpin for Tnum

§

impl UnwindSafe for Tnum

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.