[−][src]Struct ketos::integer::Integer
Arbitrary precision signed integer
Methods
impl Integer
[src]
pub fn bits(&self) -> usize
[src]
Returns the number of bits required to represent the Integer
.
pub fn from_bytes_be(sign: Sign, bytes: &[u8]) -> Integer
[src]
Creates an Integer
from a sign and a series of big-endian bytes.
pub fn from_bytes_le(sign: Sign, bytes: &[u8]) -> Integer
[src]
Creates an Integer
from a sign and a series of little-endian bytes.
pub fn from_f64(f: f64) -> Option<Integer>
[src]
Creates an Integer
with the value of the given f64
.
Returns None
if the value cannot be converted.
pub fn from_i8(i: i8) -> Integer
[src]
Creates an Integer
with the value of the given i8
.
pub fn from_i16(i: i16) -> Integer
[src]
Creates an Integer
with the value of the given i16
.
pub fn from_i32(i: i32) -> Integer
[src]
Creates an Integer
with the value of the given i32
.
pub fn from_i64(i: i64) -> Integer
[src]
Creates an Integer
with the value of the given i64
.
pub fn from_isize(i: isize) -> Integer
[src]
Creates an Integer
with the value of the given isize
.
pub fn from_u8(i: u8) -> Integer
[src]
Creates an Integer
with the value of the given u8
.
pub fn from_u16(i: u16) -> Integer
[src]
Creates an Integer
with the value of the given u16
.
pub fn from_u32(i: u32) -> Integer
[src]
Creates an Integer
with the value of the given u32
.
pub fn from_u64(i: u64) -> Integer
[src]
Creates an Integer
with the value of the given u64
.
pub fn from_usize(u: usize) -> Integer
[src]
Creates an Integer
with the value of the given usize
.
pub fn from_str_radix(s: &str, radix: u32) -> Result<Integer, FromStrRadixError>
[src]
Returns an Integer
represented by a string in the given radix.
radix
must be in the range [2, 36]
.
pub fn to_bytes_be(&self) -> (Sign, Vec<u8>)
[src]
Returns integer sign and a series of big-endian bytes.
pub fn to_bytes_le(&self) -> (Sign, Vec<u8>)
[src]
Returns integer sign and a series of little-endian bytes.
pub fn to_str_radix(&self, radix: u32) -> String
[src]
Returns a string representation of the Integer
in the given radix.
radix
must be in the range [2, 36]
.
pub fn to_i8(&self) -> Option<i8>
[src]
Returns the Integer
as an i8
value.
pub fn to_i16(&self) -> Option<i16>
[src]
Returns the Integer
as an i16
value.
pub fn to_i32(&self) -> Option<i32>
[src]
Returns the Integer
as an i32
value.
pub fn to_i64(&self) -> Option<i64>
[src]
Returns the Integer
as an i64
value.
pub fn to_isize(&self) -> Option<isize>
[src]
Returns the Integer
as an isize
value.
pub fn to_u8(&self) -> Option<u8>
[src]
Returns the Integer
as an u8
value.
pub fn to_u16(&self) -> Option<u16>
[src]
Returns the Integer
as an u16
value.
pub fn to_u32(&self) -> Option<u32>
[src]
Returns the Integer
as an u32
value.
pub fn to_u64(&self) -> Option<u64>
[src]
Returns the Integer
as an u64
value.
pub fn to_usize(&self) -> Option<usize>
[src]
Returns the Integer
as an usize
value.
pub fn to_f32(&self) -> Option<f32>
[src]
Returns the Integer
as an f32
value.
pub fn to_f64(&self) -> Option<f64>
[src]
Returns the Integer
as an f64
value.
pub fn pow(self, exp: usize) -> Integer
[src]
Raises the value to the power of exp
.
pub fn abs(&self) -> Integer
[src]
Returns the absolute value of an Integer
.
pub fn is_multiple_of(&self, rhs: &Integer) -> bool
[src]
Returns whether self
is a multiple of rhs
.
pub fn is_negative(&self) -> bool
[src]
Returns whether the Integer
is less than zero.
pub fn is_positive(&self) -> bool
[src]
Returns whether the Integer
is greater than zero.
pub fn is_zero(&self) -> bool
[src]
Returns whether the Integer
is equal to zero.
pub fn zero() -> Integer
[src]
Returns an Integer
of the value zero.
pub fn is_one(&self) -> bool
[src]
Returns whether the Integer
is equal to one.
pub fn one() -> Integer
[src]
Returns an Integer
of the value one.
Trait Implementations
impl<'a> Add<&'a Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the +
operator.
fn add(self, rhs: &Integer) -> Integer
[src]
impl<'a, 'b> Add<&'b Integer> for &'a Integer
[src]
type Output = Integer
The resulting type after applying the +
operator.
fn add(self, rhs: &Integer) -> Integer
[src]
impl Add<Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the +
operator.
fn add(self, rhs: Integer) -> Integer
[src]
impl<'a> Add<Integer> for &'a Integer
[src]
type Output = Integer
The resulting type after applying the +
operator.
fn add(self, rhs: Integer) -> Integer
[src]
impl<'a> AddAssign<&'a Integer> for Integer
[src]
fn add_assign(&mut self, rhs: &Integer)
[src]
impl AddAssign<Integer> for Integer
[src]
fn add_assign(&mut self, rhs: Integer)
[src]
impl<'a> BitAnd<&'a Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the &
operator.
fn bitand(self, rhs: &Integer) -> Integer
[src]
impl<'a, 'b> BitAnd<&'b Integer> for &'a Integer
[src]
type Output = Integer
The resulting type after applying the &
operator.
fn bitand(self, rhs: &Integer) -> Integer
[src]
impl BitAnd<Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the &
operator.
fn bitand(self, rhs: Integer) -> Integer
[src]
impl<'a> BitAnd<Integer> for &'a Integer
[src]
type Output = Integer
The resulting type after applying the &
operator.
fn bitand(self, rhs: Integer) -> Integer
[src]
impl<'a> BitAndAssign<&'a Integer> for Integer
[src]
fn bitand_assign(&mut self, rhs: &Integer)
[src]
impl BitAndAssign<Integer> for Integer
[src]
fn bitand_assign(&mut self, rhs: Integer)
[src]
impl<'a> BitOr<&'a Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the |
operator.
fn bitor(self, rhs: &Integer) -> Integer
[src]
impl<'a, 'b> BitOr<&'b Integer> for &'a Integer
[src]
type Output = Integer
The resulting type after applying the |
operator.
fn bitor(self, rhs: &Integer) -> Integer
[src]
impl BitOr<Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the |
operator.
fn bitor(self, rhs: Integer) -> Integer
[src]
impl<'a> BitOr<Integer> for &'a Integer
[src]
type Output = Integer
The resulting type after applying the |
operator.
fn bitor(self, rhs: Integer) -> Integer
[src]
impl<'a> BitOrAssign<&'a Integer> for Integer
[src]
fn bitor_assign(&mut self, rhs: &Integer)
[src]
impl BitOrAssign<Integer> for Integer
[src]
fn bitor_assign(&mut self, rhs: Integer)
[src]
impl<'a> BitXor<&'a Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: &Integer) -> Integer
[src]
impl<'a, 'b> BitXor<&'b Integer> for &'a Integer
[src]
type Output = Integer
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: &Integer) -> Integer
[src]
impl BitXor<Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: Integer) -> Integer
[src]
impl<'a> BitXor<Integer> for &'a Integer
[src]
type Output = Integer
The resulting type after applying the ^
operator.
fn bitxor(self, rhs: Integer) -> Integer
[src]
impl<'a> BitXorAssign<&'a Integer> for Integer
[src]
fn bitxor_assign(&mut self, rhs: &Integer)
[src]
impl BitXorAssign<Integer> for Integer
[src]
fn bitxor_assign(&mut self, rhs: Integer)
[src]
impl Clone for Integer
[src]
impl Debug for Integer
[src]
impl Default for Integer
[src]
impl Display for Integer
[src]
impl<'a> Div<&'a Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the /
operator.
fn div(self, rhs: &Integer) -> Integer
[src]
impl<'a, 'b> Div<&'b Integer> for &'a Integer
[src]
type Output = Integer
The resulting type after applying the /
operator.
fn div(self, rhs: &Integer) -> Integer
[src]
impl Div<Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the /
operator.
fn div(self, rhs: Integer) -> Integer
[src]
impl<'a> Div<Integer> for &'a Integer
[src]
type Output = Integer
The resulting type after applying the /
operator.
fn div(self, rhs: Integer) -> Integer
[src]
impl<'a> DivAssign<&'a Integer> for Integer
[src]
fn div_assign(&mut self, rhs: &Integer)
[src]
impl DivAssign<Integer> for Integer
[src]
fn div_assign(&mut self, rhs: Integer)
[src]
impl Eq for Integer
[src]
impl From<Integer> for Value
[src]
impl FromStr for Integer
[src]
type Err = FromStrIntError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Integer, FromStrIntError>
[src]
impl FromValue for Integer
[src]
impl<'a> FromValueRef<'a> for &'a Integer
[src]
impl<'a> Mul<&'a Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the *
operator.
fn mul(self, rhs: &Integer) -> Integer
[src]
impl<'a, 'b> Mul<&'b Integer> for &'a Integer
[src]
type Output = Integer
The resulting type after applying the *
operator.
fn mul(self, rhs: &Integer) -> Integer
[src]
impl Mul<Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the *
operator.
fn mul(self, rhs: Integer) -> Integer
[src]
impl<'a> Mul<Integer> for &'a Integer
[src]
type Output = Integer
The resulting type after applying the *
operator.
fn mul(self, rhs: Integer) -> Integer
[src]
impl<'a> MulAssign<&'a Integer> for Integer
[src]
fn mul_assign(&mut self, rhs: &Integer)
[src]
impl MulAssign<Integer> for Integer
[src]
fn mul_assign(&mut self, rhs: Integer)
[src]
impl Neg for Integer
[src]
impl<'a> Neg for &'a Integer
[src]
impl Not for Integer
[src]
impl<'a> Not for &'a Integer
[src]
impl Ord for Integer
[src]
fn cmp(&self, other: &Integer) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Integer> for Integer
[src]
impl PartialEq<Integer> for Ratio
[src]
impl PartialEq<Ratio> for Integer
[src]
impl PartialOrd<Integer> for Integer
[src]
fn partial_cmp(&self, other: &Integer) -> Option<Ordering>
[src]
fn lt(&self, other: &Integer) -> bool
[src]
fn le(&self, other: &Integer) -> bool
[src]
fn gt(&self, other: &Integer) -> bool
[src]
fn ge(&self, other: &Integer) -> bool
[src]
impl<'a> Rem<&'a Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the %
operator.
fn rem(self, rhs: &Integer) -> Integer
[src]
impl<'a, 'b> Rem<&'b Integer> for &'a Integer
[src]
type Output = Integer
The resulting type after applying the %
operator.
fn rem(self, rhs: &Integer) -> Integer
[src]
impl Rem<Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the %
operator.
fn rem(self, rhs: Integer) -> Integer
[src]
impl<'a> Rem<Integer> for &'a Integer
[src]
type Output = Integer
The resulting type after applying the %
operator.
fn rem(self, rhs: Integer) -> Integer
[src]
impl<'a> RemAssign<&'a Integer> for Integer
[src]
fn rem_assign(&mut self, rhs: &Integer)
[src]
impl RemAssign<Integer> for Integer
[src]
fn rem_assign(&mut self, rhs: Integer)
[src]
impl Shl<usize> for Integer
[src]
type Output = Integer
The resulting type after applying the <<
operator.
fn shl(self, rhs: usize) -> Integer
[src]
impl<'a> Shl<usize> for &'a Integer
[src]
type Output = Integer
The resulting type after applying the <<
operator.
fn shl(self, rhs: usize) -> Integer
[src]
impl Shr<usize> for Integer
[src]
type Output = Integer
The resulting type after applying the >>
operator.
fn shr(self, rhs: usize) -> Integer
[src]
impl<'a> Shr<usize> for &'a Integer
[src]
type Output = Integer
The resulting type after applying the >>
operator.
fn shr(self, rhs: usize) -> Integer
[src]
impl StructuralEq for Integer
[src]
impl StructuralPartialEq for Integer
[src]
impl<'a> Sub<&'a Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the -
operator.
fn sub(self, rhs: &Integer) -> Integer
[src]
impl<'a, 'b> Sub<&'b Integer> for &'a Integer
[src]
type Output = Integer
The resulting type after applying the -
operator.
fn sub(self, rhs: &Integer) -> Integer
[src]
impl Sub<Integer> for Integer
[src]
type Output = Integer
The resulting type after applying the -
operator.
fn sub(self, rhs: Integer) -> Integer
[src]
impl<'a> Sub<Integer> for &'a Integer
[src]
type Output = Integer
The resulting type after applying the -
operator.
fn sub(self, rhs: Integer) -> Integer
[src]
impl<'a> SubAssign<&'a Integer> for Integer
[src]
fn sub_assign(&mut self, rhs: &Integer)
[src]
impl SubAssign<Integer> for Integer
[src]
fn sub_assign(&mut self, rhs: Integer)
[src]
impl Zero for Integer
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, Rhs> NumAssignOps<Rhs> for T where
T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,
[src]
T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,
impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
[src]
T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,
impl<T, Base> RefNum<Base> for T where
T: NumOps<Base, Base> + NumOps<&'r Base, Base>,
[src]
T: NumOps<Base, Base> + NumOps<&'r Base, Base>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
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>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
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>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,