Skip to main content

NeoInteger

Struct NeoInteger 

Source
pub struct NeoInteger(/* private fields */);
Expand description

Neo N3 Integer type (arbitrary precision)

Implementations§

Source§

impl NeoInteger

Source

pub fn new<T>(value: T) -> NeoInteger
where T: Into<BigInt>,

Source

pub fn zero() -> NeoInteger

Source

pub fn one() -> NeoInteger

Source

pub fn min_i32() -> NeoInteger

Source

pub fn max_i32() -> NeoInteger

Source

pub fn as_bigint(&self) -> &BigInt

Source

pub fn try_as_i32(&self) -> Option<i32>

Convert to i32, returning None if the value is out of range. This is the safe alternative to as_i32() that doesn’t panic.

Source

pub fn try_as_u32(&self) -> Option<u32>

Convert to u32, returning None if the value is out of range. This is the safe alternative to as_u32() that doesn’t panic.

Source

pub fn as_i32_saturating(&self) -> i32

Convert to i32, saturating at the boundaries if the value is out of range. This never panics.

Source

pub fn as_u32_saturating(&self) -> u32

Convert to u32, saturating at the boundaries if the value is out of range. This never panics.

Source

pub fn as_i32(&self) -> i32

👎Deprecated since 0.4.1: Use try_as_i32() or as_i32_saturating() instead to avoid panics

Convert to i32.

§Panics

Panics if the value is outside the i32 range. Use try_as_i32() for a safe alternative.

Source

pub fn as_u32(&self) -> u32

👎Deprecated since 0.4.1: Use try_as_u32() or as_u32_saturating() instead to avoid panics

Convert to u32.

§Panics

Panics if the value is outside the u32 range. Use try_as_u32() for a safe alternative.

Source

pub fn to_i32(&self) -> Option<i32>

Source

pub fn to_u32(&self) -> Option<u32>

Trait Implementations§

Source§

impl Add<&NeoInteger> for &NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &NeoInteger) -> <&NeoInteger as Add<&NeoInteger>>::Output

Performs the + operation. Read more
Source§

impl Add<&NeoInteger> for NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &NeoInteger) -> <NeoInteger as Add<&NeoInteger>>::Output

Performs the + operation. Read more
Source§

impl Add<NeoInteger> for &NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the + operator.
Source§

fn add(self, rhs: NeoInteger) -> <&NeoInteger as Add<NeoInteger>>::Output

Performs the + operation. Read more
Source§

impl Add for NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the + operator.
Source§

fn add(self, rhs: NeoInteger) -> <NeoInteger as Add>::Output

Performs the + operation. Read more
Source§

impl BitAnd<&NeoInteger> for &NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the & operator.
Source§

fn bitand( self, rhs: &NeoInteger, ) -> <&NeoInteger as BitAnd<&NeoInteger>>::Output

Performs the & operation. Read more
Source§

impl BitAnd<&NeoInteger> for NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &NeoInteger) -> <NeoInteger as BitAnd<&NeoInteger>>::Output

Performs the & operation. Read more
Source§

impl BitAnd<NeoInteger> for &NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: NeoInteger) -> <&NeoInteger as BitAnd<NeoInteger>>::Output

Performs the & operation. Read more
Source§

impl BitAnd for NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: NeoInteger) -> <NeoInteger as BitAnd>::Output

Performs the & operation. Read more
Source§

impl BitOr<&NeoInteger> for &NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &NeoInteger) -> <&NeoInteger as BitOr<&NeoInteger>>::Output

Performs the | operation. Read more
Source§

impl BitOr<&NeoInteger> for NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &NeoInteger) -> <NeoInteger as BitOr<&NeoInteger>>::Output

Performs the | operation. Read more
Source§

impl BitOr<NeoInteger> for &NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: NeoInteger) -> <&NeoInteger as BitOr<NeoInteger>>::Output

Performs the | operation. Read more
Source§

impl BitOr for NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: NeoInteger) -> <NeoInteger as BitOr>::Output

Performs the | operation. Read more
Source§

impl BitXor<&NeoInteger> for &NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the ^ operator.
Source§

fn bitxor( self, rhs: &NeoInteger, ) -> <&NeoInteger as BitXor<&NeoInteger>>::Output

Performs the ^ operation. Read more
Source§

impl BitXor<&NeoInteger> for NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &NeoInteger) -> <NeoInteger as BitXor<&NeoInteger>>::Output

Performs the ^ operation. Read more
Source§

impl BitXor<NeoInteger> for &NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: NeoInteger) -> <&NeoInteger as BitXor<NeoInteger>>::Output

Performs the ^ operation. Read more
Source§

impl BitXor for NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: NeoInteger) -> <NeoInteger as BitXor>::Output

Performs the ^ operation. Read more
Source§

impl Clone for NeoInteger

Source§

fn clone(&self) -> NeoInteger

Returns a duplicate 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 NeoInteger

Source§

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

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

impl Default for NeoInteger

Source§

fn default() -> NeoInteger

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

impl<'de> Deserialize<'de> for NeoInteger

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<NeoInteger, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Div<&NeoInteger> for &NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NeoInteger) -> <&NeoInteger as Div<&NeoInteger>>::Output

Performs the / operation. Read more
Source§

impl Div<&NeoInteger> for NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &NeoInteger) -> <NeoInteger as Div<&NeoInteger>>::Output

Performs the / operation. Read more
Source§

impl Div<NeoInteger> for &NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NeoInteger) -> <&NeoInteger as Div<NeoInteger>>::Output

Performs the / operation. Read more
Source§

impl Div for NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the / operator.
Source§

fn div(self, rhs: NeoInteger) -> <NeoInteger as Div>::Output

Performs the / operation. Read more
Source§

impl From<&BigInt> for NeoInteger

Source§

fn from(value: &BigInt) -> NeoInteger

Converts to this type from the input type.
Source§

impl From<BigInt> for NeoInteger

Source§

fn from(value: BigInt) -> NeoInteger

Converts to this type from the input type.
Source§

impl From<NeoInteger> for NeoValue

Source§

fn from(value: NeoInteger) -> NeoValue

Converts to this type from the input type.
Source§

impl From<i32> for NeoInteger

Source§

fn from(value: i32) -> NeoInteger

Converts to this type from the input type.
Source§

impl From<i64> for NeoInteger

Source§

fn from(value: i64) -> NeoInteger

Converts to this type from the input type.
Source§

impl From<u32> for NeoInteger

Source§

fn from(value: u32) -> NeoInteger

Converts to this type from the input type.
Source§

impl Mul<&NeoInteger> for &NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &NeoInteger) -> <&NeoInteger as Mul<&NeoInteger>>::Output

Performs the * operation. Read more
Source§

impl Mul<&NeoInteger> for NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &NeoInteger) -> <NeoInteger as Mul<&NeoInteger>>::Output

Performs the * operation. Read more
Source§

impl Mul<NeoInteger> for &NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: NeoInteger) -> <&NeoInteger as Mul<NeoInteger>>::Output

Performs the * operation. Read more
Source§

impl Mul for NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: NeoInteger) -> <NeoInteger as Mul>::Output

Performs the * operation. Read more
Source§

impl Not for NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the ! operator.
Source§

fn not(self) -> <NeoInteger as Not>::Output

Performs the unary ! operation. Read more
Source§

impl Ord for NeoInteger

Source§

fn cmp(&self, other: &NeoInteger) -> Ordering

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

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

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

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

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

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

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

impl PartialEq for NeoInteger

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for NeoInteger

Source§

fn partial_cmp(&self, other: &NeoInteger) -> 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

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

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

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Rem<&NeoInteger> for &NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NeoInteger) -> <&NeoInteger as Rem<&NeoInteger>>::Output

Performs the % operation. Read more
Source§

impl Rem<&NeoInteger> for NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: &NeoInteger) -> <NeoInteger as Rem<&NeoInteger>>::Output

Performs the % operation. Read more
Source§

impl Rem<NeoInteger> for &NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NeoInteger) -> <&NeoInteger as Rem<NeoInteger>>::Output

Performs the % operation. Read more
Source§

impl Rem for NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: NeoInteger) -> <NeoInteger as Rem>::Output

Performs the % operation. Read more
Source§

impl Serialize for NeoInteger

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Shl<u32> for &NeoInteger

Source§

type Output = NeoInteger

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

fn shl(self, rhs: u32) -> <&NeoInteger as Shl<u32>>::Output

Performs the << operation. Read more
Source§

impl Shl<u32> for NeoInteger

Source§

type Output = NeoInteger

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

fn shl(self, rhs: u32) -> <NeoInteger as Shl<u32>>::Output

Performs the << operation. Read more
Source§

impl Shr<u32> for &NeoInteger

Source§

type Output = NeoInteger

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

fn shr(self, rhs: u32) -> <&NeoInteger as Shr<u32>>::Output

Performs the >> operation. Read more
Source§

impl Shr<u32> for NeoInteger

Source§

type Output = NeoInteger

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

fn shr(self, rhs: u32) -> <NeoInteger as Shr<u32>>::Output

Performs the >> operation. Read more
Source§

impl Sub<&NeoInteger> for &NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &NeoInteger) -> <&NeoInteger as Sub<&NeoInteger>>::Output

Performs the - operation. Read more
Source§

impl Sub<&NeoInteger> for NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &NeoInteger) -> <NeoInteger as Sub<&NeoInteger>>::Output

Performs the - operation. Read more
Source§

impl Sub<NeoInteger> for &NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: NeoInteger) -> <&NeoInteger as Sub<NeoInteger>>::Output

Performs the - operation. Read more
Source§

impl Sub for NeoInteger

Source§

type Output = NeoInteger

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: NeoInteger) -> <NeoInteger as Sub>::Output

Performs the - operation. Read more
Source§

impl Eq for NeoInteger

Source§

impl StructuralPartialEq for NeoInteger

Auto Trait Implementations§

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

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>,

Source§

impl<T, Base> RefNum<Base> for T
where T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>,