pub struct BaseUInt<const BITS: usize> { /* private fields */ }
Expand description

| Template base class for unsigned big | integers. |

Implementations§

source§

impl<const BITS: usize> BaseUInt<BITS>

source

pub const WIDTH: usize = _

source

pub fn new_from_other(b: &BaseUInt<BITS>) -> Self

source

pub fn assign_from_other(&mut self, b: &BaseUInt<BITS>) -> &mut BaseUInt<BITS>

source

pub fn new_from_u64(b: u64) -> Self

source

pub fn assign_from_u64(&mut self, b: u64) -> &mut BaseUInt<BITS>

source

pub fn prefix_increment(&mut self) -> &mut BaseUInt<BITS>

source

pub fn postfix_increment(&mut self, _0: i32) -> BaseUInt<BITS>

source

pub fn prefix_decrement(&mut self) -> &mut BaseUInt<BITS>

source

pub fn postfix_decrement(&mut self, _0: i32) -> BaseUInt<BITS>

source

pub fn size(&self) -> u32

source

pub fn get_low64(&self) -> u64

source§

impl<const BITS: usize> BaseUInt<BITS>

source

pub fn compare_to(&self, b: &BaseUInt<BITS>) -> i32

source

pub fn equal_to(&self, b: u64) -> bool

source

pub fn getdouble(&self) -> f64

source

pub fn get_hex(&self) -> String

source

pub fn set_hex(&mut self, psz: *const u8)

source

pub fn set_hex_with_str(&mut self, str_: &str)

source

pub fn to_string(&self) -> String

source

pub fn bits(&self) -> u32

| Returns the position of the highest | bit set plus one, or zero if the value | is zero. |

Trait Implementations§

source§

impl<const BITS: usize> Add<&BaseUInt<BITS>> for BaseUInt<BITS>

§

type Output = BaseUInt<BITS>

The resulting type after applying the + operator.
source§

fn add(self, other: &BaseUInt<BITS>) -> Self::Output

Performs the + operation. Read more
source§

impl<const BITS: usize> AddAssign<&BaseUInt<BITS>> for BaseUInt<BITS>

source§

fn add_assign(&mut self, other: &BaseUInt<BITS>)

Performs the += operation. Read more
source§

impl<const BITS: usize> AddAssign<u64> for BaseUInt<BITS>

source§

fn add_assign(&mut self, other: u64)

Performs the += operation. Read more
source§

impl<const BITS: usize> BitAnd<&BaseUInt<BITS>> for BaseUInt<BITS>

§

type Output = BaseUInt<BITS>

The resulting type after applying the & operator.
source§

fn bitand(self, other: &BaseUInt<BITS>) -> Self::Output

Performs the & operation. Read more
source§

impl<const BITS: usize> BitAndAssign<&BaseUInt<BITS>> for BaseUInt<BITS>

source§

fn bitand_assign(&mut self, b: &BaseUInt<BITS>)

Performs the &= operation. Read more
source§

impl<const BITS: usize> BitOr<&BaseUInt<BITS>> for BaseUInt<BITS>

§

type Output = BaseUInt<BITS>

The resulting type after applying the | operator.
source§

fn bitor(self, other: &BaseUInt<BITS>) -> Self::Output

Performs the | operation. Read more
source§

impl<const BITS: usize> BitOrAssign<&BaseUInt<BITS>> for BaseUInt<BITS>

source§

fn bitor_assign(&mut self, b: &BaseUInt<BITS>)

Performs the |= operation. Read more
source§

impl<const BITS: usize> BitOrAssign<u64> for BaseUInt<BITS>

source§

fn bitor_assign(&mut self, b: u64)

Performs the |= operation. Read more
source§

impl<const BITS: usize> BitXor<&BaseUInt<BITS>> for BaseUInt<BITS>

§

type Output = BaseUInt<BITS>

The resulting type after applying the ^ operator.
source§

fn bitxor(self, other: &BaseUInt<BITS>) -> Self::Output

Performs the ^ operation. Read more
source§

impl<const BITS: usize> BitXorAssign<&BaseUInt<BITS>> for BaseUInt<BITS>

source§

fn bitxor_assign(&mut self, b: &BaseUInt<BITS>)

Performs the ^= operation. Read more
source§

impl<const BITS: usize> BitXorAssign<u64> for BaseUInt<BITS>

source§

fn bitxor_assign(&mut self, b: u64)

Performs the ^= operation. Read more
source§

impl<const BITS: usize> Clone for BaseUInt<BITS>

source§

fn clone(&self) -> BaseUInt<BITS>

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<const BITS: usize> Debug for BaseUInt<BITS>

source§

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

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

impl<const BITS: usize> Default for BaseUInt<BITS>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<const BITS: usize> Div<&BaseUInt<BITS>> for BaseUInt<BITS>

§

type Output = BaseUInt<BITS>

The resulting type after applying the / operator.
source§

fn div(self, other: &BaseUInt<BITS>) -> Self::Output

Performs the / operation. Read more
source§

impl<const BITS: usize> DivAssign<&BaseUInt<BITS>> for BaseUInt<BITS>

source§

fn div_assign(&mut self, b: &BaseUInt<BITS>)

Performs the /= operation. Read more
source§

impl From<&BaseUInt<256>> for ArithU256

source§

fn from(b: &BaseUInt<256>) -> Self

Converts to this type from the input type.
source§

impl<const BITS: usize> From<&str> for BaseUInt<BITS>

source§

fn from(str_: &str) -> Self

Converts to this type from the input type.
source§

impl<const BITS: usize> Mul<&BaseUInt<BITS>> for BaseUInt<BITS>

§

type Output = BaseUInt<BITS>

The resulting type after applying the * operator.
source§

fn mul(self, other: &BaseUInt<BITS>) -> Self::Output

Performs the * operation. Read more
source§

impl<const BITS: usize> MulAssign<&BaseUInt<BITS>> for BaseUInt<BITS>

source§

fn mul_assign(&mut self, b: &BaseUInt<BITS>)

Performs the *= operation. Read more
source§

impl<const BITS: usize> MulAssign<u32> for BaseUInt<BITS>

source§

fn mul_assign(&mut self, b32: u32)

Performs the *= operation. Read more
source§

impl<const BITS: usize> Neg for BaseUInt<BITS>

§

type Output = BaseUInt<BITS>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl<const BITS: usize> Not for BaseUInt<BITS>

§

type Output = BaseUInt<BITS>

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl<const BITS: usize> Ord for BaseUInt<BITS>

source§

fn cmp(&self, other: &BaseUInt<BITS>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

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

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

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

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

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

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

impl<const BITS: usize> PartialEq<BaseUInt<BITS>> for BaseUInt<BITS>

source§

fn eq(&self, other: &BaseUInt<BITS>) -> bool

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

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

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

impl<const BITS: usize> PartialOrd<BaseUInt<BITS>> for BaseUInt<BITS>

source§

fn partial_cmp(&self, other: &BaseUInt<BITS>) -> Option<Ordering>

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

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<const BITS: usize> Shl<&BaseUInt<BITS>> for BaseUInt<BITS>

§

type Output = BaseUInt<BITS>

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

fn shl(self, rhs: &BaseUInt<BITS>) -> Self::Output

Performs the << operation. Read more
source§

impl<const BITS: usize> ShlAssign<u32> for BaseUInt<BITS>

source§

fn shl_assign(&mut self, shift: u32)

Performs the <<= operation. Read more
source§

impl<const BITS: usize> Shr<&BaseUInt<BITS>> for BaseUInt<BITS>

§

type Output = BaseUInt<BITS>

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

fn shr(self, rhs: &BaseUInt<BITS>) -> Self::Output

Performs the >> operation. Read more
source§

impl<const BITS: usize> ShrAssign<u32> for BaseUInt<BITS>

source§

fn shr_assign(&mut self, shift: u32)

Performs the >>= operation. Read more
source§

impl<const BITS: usize> Sub<&BaseUInt<BITS>> for BaseUInt<BITS>

§

type Output = BaseUInt<BITS>

The resulting type after applying the - operator.
source§

fn sub(self, other: &BaseUInt<BITS>) -> Self::Output

Performs the - operation. Read more
source§

impl<const BITS: usize> SubAssign<&BaseUInt<BITS>> for BaseUInt<BITS>

source§

fn sub_assign(&mut self, other: &BaseUInt<BITS>)

Performs the -= operation. Read more
source§

impl<const BITS: usize> SubAssign<u64> for BaseUInt<BITS>

source§

fn sub_assign(&mut self, other: u64)

Performs the -= operation. Read more
source§

impl<const BITS: usize> Eq for BaseUInt<BITS>

Auto Trait Implementations§

§

impl<const BITS: usize> RefUnwindSafe for BaseUInt<BITS>

§

impl<const BITS: usize> Send for BaseUInt<BITS>

§

impl<const BITS: usize> Sync for BaseUInt<BITS>

§

impl<const BITS: usize> Unpin for BaseUInt<BITS>

§

impl<const BITS: usize> UnwindSafe for BaseUInt<BITS>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
§

impl<T, U> CastInto<U> for Twhere U: CastFrom<T>,

§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> StaticUpcast<T> for T

§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V