pub struct Integer(pub Vec<Bit>);
Tuple Fields§
§0: Vec<Bit>
Implementations§
source§impl Integer
impl Integer
pub fn to_ext_bits(&self, length: usize) -> Vec<Bit>
pub fn to_ext_bytes(&self, length: usize) -> Vec<u8>
source§impl Integer
impl Integer
pub fn from_bin(str: &str) -> Result<Self, Box<dyn Error>>
pub fn to_bin(&self) -> String
pub fn from_dec(str: &str) -> Result<Self, Box<dyn Error>>
pub fn to_dec(&self) -> String
pub fn to_hex(&self) -> String
pub fn from_hex(arg: &str) -> Result<Self, Box<dyn Error>>
Trait Implementations§
source§impl AddAssign<&Integer> for Fraction
impl AddAssign<&Integer> for Fraction
source§fn add_assign(&mut self, b: &Integer)
fn add_assign(&mut self, b: &Integer)
Performs the
+=
operation. Read moresource§impl AddAssign<&Integer> for Integer
impl AddAssign<&Integer> for Integer
source§fn add_assign(&mut self, b: &Integer)
fn add_assign(&mut self, b: &Integer)
Performs the
+=
operation. Read moresource§impl AddAssign<&u128> for Integer
impl AddAssign<&u128> for Integer
source§fn add_assign(&mut self, b: &u128)
fn add_assign(&mut self, b: &u128)
Performs the
+=
operation. Read moresource§impl AddAssign<&u16> for Integer
impl AddAssign<&u16> for Integer
source§fn add_assign(&mut self, b: &u16)
fn add_assign(&mut self, b: &u16)
Performs the
+=
operation. Read moresource§impl AddAssign<&u32> for Integer
impl AddAssign<&u32> for Integer
source§fn add_assign(&mut self, b: &u32)
fn add_assign(&mut self, b: &u32)
Performs the
+=
operation. Read moresource§impl AddAssign<&u64> for Integer
impl AddAssign<&u64> for Integer
source§fn add_assign(&mut self, b: &u64)
fn add_assign(&mut self, b: &u64)
Performs the
+=
operation. Read moresource§impl AddAssign<&u8> for Integer
impl AddAssign<&u8> for Integer
source§fn add_assign(&mut self, b: &u8)
fn add_assign(&mut self, b: &u8)
Performs the
+=
operation. Read moresource§impl AddAssign<&usize> for Integer
impl AddAssign<&usize> for Integer
source§fn add_assign(&mut self, b: &usize)
fn add_assign(&mut self, b: &usize)
Performs the
+=
operation. Read moresource§impl AddAssign<Integer> for Integer
impl AddAssign<Integer> for Integer
source§fn add_assign(&mut self, b: Self)
fn add_assign(&mut self, b: Self)
Performs the
+=
operation. Read moresource§impl MulAssign<&Integer> for Fraction
impl MulAssign<&Integer> for Fraction
source§fn mul_assign(&mut self, b: &Integer)
fn mul_assign(&mut self, b: &Integer)
Performs the
*=
operation. Read moresource§impl MulAssign<&Integer> for Integer
impl MulAssign<&Integer> for Integer
source§fn mul_assign(&mut self, b: &Integer)
fn mul_assign(&mut self, b: &Integer)
Performs the
*=
operation. Read moresource§impl MulAssign<&u128> for Integer
impl MulAssign<&u128> for Integer
source§fn mul_assign(&mut self, b: &u128)
fn mul_assign(&mut self, b: &u128)
Performs the
*=
operation. Read moresource§impl MulAssign<&u16> for Integer
impl MulAssign<&u16> for Integer
source§fn mul_assign(&mut self, b: &u16)
fn mul_assign(&mut self, b: &u16)
Performs the
*=
operation. Read moresource§impl MulAssign<&u32> for Integer
impl MulAssign<&u32> for Integer
source§fn mul_assign(&mut self, b: &u32)
fn mul_assign(&mut self, b: &u32)
Performs the
*=
operation. Read moresource§impl MulAssign<&u64> for Integer
impl MulAssign<&u64> for Integer
source§fn mul_assign(&mut self, b: &u64)
fn mul_assign(&mut self, b: &u64)
Performs the
*=
operation. Read moresource§impl MulAssign<&u8> for Integer
impl MulAssign<&u8> for Integer
source§fn mul_assign(&mut self, b: &u8)
fn mul_assign(&mut self, b: &u8)
Performs the
*=
operation. Read moresource§impl MulAssign<&usize> for Integer
impl MulAssign<&usize> for Integer
source§fn mul_assign(&mut self, b: &usize)
fn mul_assign(&mut self, b: &usize)
Performs the
*=
operation. Read moresource§impl MulAssign<Integer> for Integer
impl MulAssign<Integer> for Integer
source§fn mul_assign(&mut self, b: Self)
fn mul_assign(&mut self, b: Self)
Performs the
*=
operation. Read moresource§impl Ord for Integer
impl Ord for Integer
source§impl PartialOrd<Integer> for Integer
impl PartialOrd<Integer> for Integer
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl ShlAssign<&Integer> for Integer
impl ShlAssign<&Integer> for Integer
source§fn shl_assign(&mut self, shifts: &Integer)
fn shl_assign(&mut self, shifts: &Integer)
Performs the
<<=
operation. Read moresource§impl ShlAssign<&usize> for Integer
impl ShlAssign<&usize> for Integer
source§fn shl_assign(&mut self, shifts: &usize)
fn shl_assign(&mut self, shifts: &usize)
Performs the
<<=
operation. Read moresource§impl ShrAssign<&Integer> for Integer
impl ShrAssign<&Integer> for Integer
source§fn shr_assign(&mut self, shifts: &Integer)
fn shr_assign(&mut self, shifts: &Integer)
Performs the
>>=
operation. Read moresource§impl ShrAssign<&usize> for Integer
impl ShrAssign<&usize> for Integer
source§fn shr_assign(&mut self, shifts: &usize)
fn shr_assign(&mut self, shifts: &usize)
Performs the
>>=
operation. Read moresource§impl SubAssign<&Integer> for Fraction
impl SubAssign<&Integer> for Fraction
source§fn sub_assign(&mut self, b: &Integer)
fn sub_assign(&mut self, b: &Integer)
Performs the
-=
operation. Read moresource§impl SubAssign<&Integer> for Integer
impl SubAssign<&Integer> for Integer
source§fn sub_assign(&mut self, b: &Self)
fn sub_assign(&mut self, b: &Self)
Performs the
-=
operation. Read moresource§impl SubAssign<&u128> for Integer
impl SubAssign<&u128> for Integer
source§fn sub_assign(&mut self, b: &u128)
fn sub_assign(&mut self, b: &u128)
Performs the
-=
operation. Read moresource§impl SubAssign<&u16> for Integer
impl SubAssign<&u16> for Integer
source§fn sub_assign(&mut self, b: &u16)
fn sub_assign(&mut self, b: &u16)
Performs the
-=
operation. Read moresource§impl SubAssign<&u32> for Integer
impl SubAssign<&u32> for Integer
source§fn sub_assign(&mut self, b: &u32)
fn sub_assign(&mut self, b: &u32)
Performs the
-=
operation. Read moresource§impl SubAssign<&u64> for Integer
impl SubAssign<&u64> for Integer
source§fn sub_assign(&mut self, b: &u64)
fn sub_assign(&mut self, b: &u64)
Performs the
-=
operation. Read moresource§impl SubAssign<&u8> for Integer
impl SubAssign<&u8> for Integer
source§fn sub_assign(&mut self, b: &u8)
fn sub_assign(&mut self, b: &u8)
Performs the
-=
operation. Read moresource§impl SubAssign<&usize> for Integer
impl SubAssign<&usize> for Integer
source§fn sub_assign(&mut self, b: &usize)
fn sub_assign(&mut self, b: &usize)
Performs the
-=
operation. Read moresource§impl SubAssign<Integer> for Integer
impl SubAssign<Integer> for Integer
source§fn sub_assign(&mut self, b: Self)
fn sub_assign(&mut self, b: Self)
Performs the
-=
operation. Read moreimpl Eq for Integer
Auto Trait Implementations§
impl RefUnwindSafe for Integer
impl Send for Integer
impl Sync for Integer
impl Unpin for Integer
impl UnwindSafe for Integer
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more