pub struct NeoInteger(/* private fields */);Expand description
Neo N3 Integer type (arbitrary precision)
Implementations§
Source§impl NeoInteger
impl NeoInteger
pub fn new<T: Into<BigInt>>(value: T) -> Self
pub fn zero() -> Self
pub fn one() -> Self
pub fn min_i32() -> Self
pub fn max_i32() -> Self
pub fn as_bigint(&self) -> &BigInt
Sourcepub fn try_as_i32(&self) -> Option<i32>
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.
Sourcepub fn try_as_u32(&self) -> Option<u32>
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.
Sourcepub fn try_as_i64(&self) -> Option<i64>
pub fn try_as_i64(&self) -> Option<i64>
Convert to i64, returning None if the value is out of range.
Sourcepub fn try_as_u64(&self) -> Option<u64>
pub fn try_as_u64(&self) -> Option<u64>
Convert to u64, returning None if the value is out of range.
Sourcepub fn try_into_i32(&self) -> NeoResult<i32>
pub fn try_into_i32(&self) -> NeoResult<i32>
Convert to i32, returning Result for ergonomic ? usage.
Sourcepub fn try_into_u32(&self) -> NeoResult<u32>
pub fn try_into_u32(&self) -> NeoResult<u32>
Convert to u32, returning Result for ergonomic ? usage.
Sourcepub fn try_into_i64(&self) -> NeoResult<i64>
pub fn try_into_i64(&self) -> NeoResult<i64>
Convert to i64, returning Result for ergonomic ? usage.
Sourcepub fn try_into_u64(&self) -> NeoResult<u64>
pub fn try_into_u64(&self) -> NeoResult<u64>
Convert to u64, returning Result for ergonomic ? usage.
Sourcepub fn as_i32_saturating(&self) -> i32
pub fn as_i32_saturating(&self) -> i32
Convert to i32, saturating at the boundaries if the value is out of range. This never panics.
Sourcepub fn as_u32_saturating(&self) -> u32
pub fn as_u32_saturating(&self) -> u32
Convert to u32, saturating at the boundaries if the value is out of range. This never panics.
Sourcepub fn as_i64_saturating(&self) -> i64
pub fn as_i64_saturating(&self) -> i64
Convert to i64, saturating at the boundaries if the value is out of range. This never panics.
Sourcepub fn as_i32(&self) -> i32
👎Deprecated since 0.1.0: Use try_as_i32() or as_i32_saturating() explicitly
pub fn as_i32(&self) -> i32
Use try_as_i32() or as_i32_saturating() explicitly
Deprecated compatibility helper that converts to i32 using saturating semantics.
Sourcepub fn as_u32(&self) -> u32
👎Deprecated since 0.1.0: Use try_as_u32() or as_u32_saturating() explicitly
pub fn as_u32(&self) -> u32
Use try_as_u32() or as_u32_saturating() explicitly
Deprecated compatibility helper that converts to u32 using saturating semantics.
Sourcepub fn to_i32(&self) -> Option<i32>
👎Deprecated since 0.1.0: Use try_as_i32() instead
pub fn to_i32(&self) -> Option<i32>
Use try_as_i32() instead
Deprecated: use try_as_i32() instead.
Trait Implementations§
Source§impl Add for NeoInteger
impl Add for NeoInteger
Source§impl Add<&NeoInteger> for NeoInteger
impl Add<&NeoInteger> for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
+ operator.Source§impl Add<&NeoInteger> for &NeoInteger
impl Add<&NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
+ operator.Source§impl Add<NeoInteger> for &NeoInteger
impl Add<NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
+ operator.Source§impl BitAnd for NeoInteger
impl BitAnd for NeoInteger
Source§impl BitAnd<&NeoInteger> for NeoInteger
impl BitAnd<&NeoInteger> for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
& operator.Source§impl BitAnd<&NeoInteger> for &NeoInteger
impl BitAnd<&NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
& operator.Source§impl BitAnd<NeoInteger> for &NeoInteger
impl BitAnd<NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
& operator.Source§impl BitOr for NeoInteger
impl BitOr for NeoInteger
Source§impl BitOr<&NeoInteger> for NeoInteger
impl BitOr<&NeoInteger> for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
| operator.Source§impl BitOr<&NeoInteger> for &NeoInteger
impl BitOr<&NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
| operator.Source§impl BitOr<NeoInteger> for &NeoInteger
impl BitOr<NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
| operator.Source§impl BitXor for NeoInteger
impl BitXor for NeoInteger
Source§impl BitXor<&NeoInteger> for NeoInteger
impl BitXor<&NeoInteger> for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
^ operator.Source§impl BitXor<&NeoInteger> for &NeoInteger
impl BitXor<&NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
^ operator.Source§impl BitXor<NeoInteger> for &NeoInteger
impl BitXor<NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
^ operator.Source§impl Clone for NeoInteger
impl Clone for NeoInteger
Source§fn clone(&self) -> NeoInteger
fn clone(&self) -> NeoInteger
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NeoInteger
impl Debug for NeoInteger
Source§impl Default for NeoInteger
impl Default for NeoInteger
Source§impl<'de> Deserialize<'de> for NeoInteger
impl<'de> Deserialize<'de> for NeoInteger
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for NeoInteger
impl Display for NeoInteger
Source§impl Div for NeoInteger
impl Div for NeoInteger
Source§impl Div<&NeoInteger> for NeoInteger
impl Div<&NeoInteger> for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
/ operator.Source§impl Div<&NeoInteger> for &NeoInteger
impl Div<&NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
/ operator.Source§impl Div<NeoInteger> for &NeoInteger
impl Div<NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
/ operator.impl Eq for NeoInteger
Source§impl From<&BigInt> for NeoInteger
impl From<&BigInt> for NeoInteger
Source§impl From<BigInt> for NeoInteger
impl From<BigInt> for NeoInteger
Source§impl From<NeoInteger> for NeoValue
impl From<NeoInteger> for NeoValue
Source§fn from(value: NeoInteger) -> Self
fn from(value: NeoInteger) -> Self
Source§impl From<i8> for NeoInteger
impl From<i8> for NeoInteger
Source§impl From<i16> for NeoInteger
impl From<i16> for NeoInteger
Source§impl From<i32> for NeoInteger
impl From<i32> for NeoInteger
Source§impl From<i64> for NeoInteger
impl From<i64> for NeoInteger
Source§impl From<i128> for NeoInteger
impl From<i128> for NeoInteger
Source§impl From<u8> for NeoInteger
impl From<u8> for NeoInteger
Source§impl From<u16> for NeoInteger
impl From<u16> for NeoInteger
Source§impl From<u32> for NeoInteger
impl From<u32> for NeoInteger
Source§impl From<u64> for NeoInteger
impl From<u64> for NeoInteger
Source§impl From<u128> for NeoInteger
impl From<u128> for NeoInteger
Source§impl Mul for NeoInteger
impl Mul for NeoInteger
Source§impl Mul<&NeoInteger> for NeoInteger
impl Mul<&NeoInteger> for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
* operator.Source§impl Mul<&NeoInteger> for &NeoInteger
impl Mul<&NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
* operator.Source§impl Mul<NeoInteger> for &NeoInteger
impl Mul<NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
* operator.Source§impl Not for NeoInteger
impl Not for NeoInteger
Source§impl Ord for NeoInteger
impl Ord for NeoInteger
Source§fn cmp(&self, other: &NeoInteger) -> Ordering
fn cmp(&self, other: &NeoInteger) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for NeoInteger
impl PartialEq for NeoInteger
Source§fn eq(&self, other: &NeoInteger) -> bool
fn eq(&self, other: &NeoInteger) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for NeoInteger
impl PartialOrd for NeoInteger
Source§impl Rem for NeoInteger
impl Rem for NeoInteger
Source§impl Rem<&NeoInteger> for NeoInteger
impl Rem<&NeoInteger> for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
% operator.Source§impl Rem<&NeoInteger> for &NeoInteger
impl Rem<&NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
% operator.Source§impl Rem<NeoInteger> for &NeoInteger
impl Rem<NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
% operator.Source§impl Serialize for NeoInteger
impl Serialize for NeoInteger
Source§impl Shl<u32> for NeoInteger
impl Shl<u32> for NeoInteger
Source§impl Shl<u32> for &NeoInteger
impl Shl<u32> for &NeoInteger
Source§impl Shr<u32> for NeoInteger
impl Shr<u32> for NeoInteger
Source§impl Shr<u32> for &NeoInteger
impl Shr<u32> for &NeoInteger
impl StructuralPartialEq for NeoInteger
Source§impl Sub for NeoInteger
impl Sub for NeoInteger
Source§impl Sub<&NeoInteger> for NeoInteger
impl Sub<&NeoInteger> for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
- operator.Source§impl Sub<&NeoInteger> for &NeoInteger
impl Sub<&NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
- operator.Source§impl Sub<NeoInteger> for &NeoInteger
impl Sub<NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
- operator.