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 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_i32(&self) -> i32
👎Deprecated since 0.4.1: Use try_as_i32() or as_i32_saturating() instead to avoid panics
pub fn as_i32(&self) -> i32
Convert to i32.
§Panics
Panics if the value is outside the i32 range. Use try_as_i32() for a safe alternative.
Sourcepub fn as_u32(&self) -> u32
👎Deprecated since 0.4.1: Use try_as_u32() or as_u32_saturating() instead to avoid panics
pub fn as_u32(&self) -> u32
Convert to u32.
§Panics
Panics if the value is outside the u32 range. Use try_as_u32() for a safe alternative.
pub fn to_i32(&self) -> Option<i32>
pub fn to_u32(&self) -> Option<u32>
Trait Implementations§
Source§impl Add<&NeoInteger> for &NeoInteger
impl Add<&NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
+ operator.Source§impl Add<&NeoInteger> for NeoInteger
impl Add<&NeoInteger> for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
+ operator.Source§impl Add<NeoInteger> for &NeoInteger
impl Add<NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
+ operator.Source§impl Add for NeoInteger
impl Add for NeoInteger
Source§impl BitAnd<&NeoInteger> for &NeoInteger
impl BitAnd<&NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
& operator.Source§impl BitAnd<&NeoInteger> for NeoInteger
impl BitAnd<&NeoInteger> for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
& operator.Source§impl BitAnd<NeoInteger> for &NeoInteger
impl BitAnd<NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
& operator.Source§impl BitAnd for NeoInteger
impl BitAnd for NeoInteger
Source§impl BitOr<&NeoInteger> for &NeoInteger
impl BitOr<&NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
| operator.Source§impl BitOr<&NeoInteger> for NeoInteger
impl BitOr<&NeoInteger> for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
| operator.Source§impl BitOr<NeoInteger> for &NeoInteger
impl BitOr<NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
| operator.Source§impl BitOr for NeoInteger
impl BitOr for NeoInteger
Source§impl BitXor<&NeoInteger> for &NeoInteger
impl BitXor<&NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
^ operator.Source§impl BitXor<&NeoInteger> for NeoInteger
impl BitXor<&NeoInteger> for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
^ operator.Source§impl BitXor<NeoInteger> for &NeoInteger
impl BitXor<NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
^ operator.Source§impl BitXor for NeoInteger
impl BitXor for NeoInteger
Source§impl Clone for NeoInteger
impl Clone for NeoInteger
Source§fn clone(&self) -> NeoInteger
fn clone(&self) -> NeoInteger
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Div<&NeoInteger> for &NeoInteger
impl Div<&NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
/ operator.Source§impl Div<&NeoInteger> for NeoInteger
impl Div<&NeoInteger> for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
/ operator.Source§impl Div<NeoInteger> for &NeoInteger
impl Div<NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
/ operator.Source§impl Div for NeoInteger
impl Div 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
Converts to this type from the input type.
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<u32> for NeoInteger
impl From<u32> for NeoInteger
Source§impl Mul<&NeoInteger> for &NeoInteger
impl Mul<&NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
* operator.Source§impl Mul<&NeoInteger> for NeoInteger
impl Mul<&NeoInteger> for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
* operator.Source§impl Mul<NeoInteger> for &NeoInteger
impl Mul<NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
* operator.Source§impl Mul for NeoInteger
impl Mul for NeoInteger
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 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for NeoInteger
impl PartialEq for NeoInteger
Source§impl PartialOrd for NeoInteger
impl PartialOrd for NeoInteger
Source§impl Rem<&NeoInteger> for &NeoInteger
impl Rem<&NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
% operator.Source§impl Rem<&NeoInteger> for NeoInteger
impl Rem<&NeoInteger> for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
% operator.Source§impl Rem<NeoInteger> for &NeoInteger
impl Rem<NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
% operator.Source§impl Rem for NeoInteger
impl Rem for NeoInteger
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
Source§impl Sub<&NeoInteger> for &NeoInteger
impl Sub<&NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
- operator.Source§impl Sub<&NeoInteger> for NeoInteger
impl Sub<&NeoInteger> for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
- operator.Source§impl Sub<NeoInteger> for &NeoInteger
impl Sub<NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
- operator.Source§impl Sub for NeoInteger
impl Sub for NeoInteger
impl Eq for NeoInteger
impl StructuralPartialEq for NeoInteger
Auto Trait Implementations§
impl Freeze for NeoInteger
impl RefUnwindSafe for NeoInteger
impl Send for NeoInteger
impl Sync for NeoInteger
impl Unpin for NeoInteger
impl UnwindSafe for NeoInteger
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