Enum ion_rs::types::Int

source ·
pub enum Int {
    I64(i64),
    BigInt(BigInt),
}
Expand description

Container for either an integer that can fit in a 64-bit word or an arbitrarily sized BigInt.

See IntAccess for common operations.

Variants§

§

I64(i64)

§

BigInt(BigInt)

Trait Implementations§

source§

impl Add<Int> for Int

§

type Output = Int

The resulting type after applying the + operator.
source§

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

Performs the + operation. Read more
source§

impl Clone for Int

source§

fn clone(&self) -> Int

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 Debug for Int

source§

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

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

impl Display for Int

source§

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

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

impl From<BigInt> for Int

source§

fn from(value: BigInt) -> Self

Converts to this type from the input type.
source§

impl From<BigUint> for Int

source§

fn from(value: BigUint) -> Self

Converts to this type from the input type.
source§

impl From<DecodedInt> for Int

source§

fn from(uint: DecodedInt) -> Self

Note that if the DecodedInt represents -0, converting it to an Integer will result in a 0. If negative zero is significant to your use case, check it using DecodedInt::is_negative_zero before converting it to an Integer.

source§

impl From<DecodedUInt> for Int

source§

fn from(uint: DecodedUInt) -> Self

Converts to this type from the input type.
source§

impl From<Int> for UInt

source§

fn from(value: Int) -> Self

Converts to this type from the input type.
source§

impl From<Int> for Value

source§

fn from(integer_val: Int) -> Self

Converts to this type from the input type.
source§

impl From<UInt> for Int

source§

fn from(value: UInt) -> Self

Converts to this type from the input type.
source§

impl From<i16> for Int

source§

fn from(value: i16) -> Int

Converts to this type from the input type.
source§

impl From<i32> for Int

source§

fn from(value: i32) -> Int

Converts to this type from the input type.
source§

impl From<i64> for Int

source§

fn from(value: i64) -> Int

Converts to this type from the input type.
source§

impl From<i8> for Int

source§

fn from(value: i8) -> Int

Converts to this type from the input type.
source§

impl From<isize> for Int

source§

fn from(value: isize) -> Int

Converts to this type from the input type.
source§

impl From<u16> for Int

source§

fn from(value: u16) -> Int

Converts to this type from the input type.
source§

impl From<u32> for Int

source§

fn from(value: u32) -> Int

Converts to this type from the input type.
source§

impl From<u64> for Int

source§

fn from(value: u64) -> Int

Converts to this type from the input type.
source§

impl From<u8> for Int

source§

fn from(value: u8) -> Int

Converts to this type from the input type.
source§

impl From<usize> for Int

source§

fn from(value: usize) -> Int

Converts to this type from the input type.
source§

impl IntAccess for Int

source§

fn as_i64(&self) -> Option<i64>

Returns the value as an i64 if it can be represented as such. Read more
source§

fn as_big_int(&self) -> Option<&BigInt>

Returns a reference as a BigInt if it is represented as such. Note that this method may return None if the underlying representation is not stored in a BigInt such as if it is represented as an i64 so it is somewhat asymmetric with respect to IntAccess::as_i64. Read more
source§

impl Neg for Int

§

type Output = Int

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl Ord for Int

source§

fn cmp(&self, other: &Self) -> 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 PartialEq<Int> for Int

source§

fn eq(&self, other: &Self) -> 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 PartialOrd<Int> for Int

source§

fn partial_cmp(&self, other: &Self) -> 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 Zero for Int

source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
source§

impl Eq for Int

Auto Trait Implementations§

§

impl RefUnwindSafe for Int

§

impl Send for Int

§

impl Sync for Int

§

impl Unpin for Int

§

impl UnwindSafe for Int

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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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<V> IntoAnnotatedElement for Vwhere V: Into<Value>,

source§

fn with_annotations<I: IntoAnnotations>(self, annotations: I) -> Element

Converts the value into an Element with the specified annotations.
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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. 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.
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.
source§

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

Performs the conversion.