pub struct NeoInteger(/* private fields */);Expand description
Neo N3 Integer type (arbitrary precision)
Implementations§
Source§impl NeoInteger
impl NeoInteger
pub fn new<T>(value: T) -> NeoInteger
pub fn zero() -> NeoInteger
pub fn one() -> NeoInteger
pub fn min_i32() -> NeoInteger
pub fn max_i32() -> NeoInteger
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§fn add(self, rhs: &NeoInteger) -> <&NeoInteger as Add<&NeoInteger>>::Output
fn add(self, rhs: &NeoInteger) -> <&NeoInteger as Add<&NeoInteger>>::Output
Performs the
+ operation. Read moreSource§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§fn add(self, rhs: &NeoInteger) -> <NeoInteger as Add<&NeoInteger>>::Output
fn add(self, rhs: &NeoInteger) -> <NeoInteger as Add<&NeoInteger>>::Output
Performs the
+ operation. Read moreSource§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§fn add(self, rhs: NeoInteger) -> <&NeoInteger as Add<NeoInteger>>::Output
fn add(self, rhs: NeoInteger) -> <&NeoInteger as Add<NeoInteger>>::Output
Performs the
+ operation. Read moreSource§impl Add for NeoInteger
impl Add for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
+ operator.Source§fn add(self, rhs: NeoInteger) -> <NeoInteger as Add>::Output
fn add(self, rhs: NeoInteger) -> <NeoInteger as Add>::Output
Performs the
+ operation. Read moreSource§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§fn bitand(
self,
rhs: &NeoInteger,
) -> <&NeoInteger as BitAnd<&NeoInteger>>::Output
fn bitand( self, rhs: &NeoInteger, ) -> <&NeoInteger as BitAnd<&NeoInteger>>::Output
Performs the
& operation. Read moreSource§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§fn bitand(self, rhs: &NeoInteger) -> <NeoInteger as BitAnd<&NeoInteger>>::Output
fn bitand(self, rhs: &NeoInteger) -> <NeoInteger as BitAnd<&NeoInteger>>::Output
Performs the
& operation. Read moreSource§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§fn bitand(self, rhs: NeoInteger) -> <&NeoInteger as BitAnd<NeoInteger>>::Output
fn bitand(self, rhs: NeoInteger) -> <&NeoInteger as BitAnd<NeoInteger>>::Output
Performs the
& operation. Read moreSource§impl BitAnd for NeoInteger
impl BitAnd for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
& operator.Source§fn bitand(self, rhs: NeoInteger) -> <NeoInteger as BitAnd>::Output
fn bitand(self, rhs: NeoInteger) -> <NeoInteger as BitAnd>::Output
Performs the
& operation. Read moreSource§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§fn bitor(self, rhs: &NeoInteger) -> <&NeoInteger as BitOr<&NeoInteger>>::Output
fn bitor(self, rhs: &NeoInteger) -> <&NeoInteger as BitOr<&NeoInteger>>::Output
Performs the
| operation. Read moreSource§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§fn bitor(self, rhs: &NeoInteger) -> <NeoInteger as BitOr<&NeoInteger>>::Output
fn bitor(self, rhs: &NeoInteger) -> <NeoInteger as BitOr<&NeoInteger>>::Output
Performs the
| operation. Read moreSource§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§fn bitor(self, rhs: NeoInteger) -> <&NeoInteger as BitOr<NeoInteger>>::Output
fn bitor(self, rhs: NeoInteger) -> <&NeoInteger as BitOr<NeoInteger>>::Output
Performs the
| operation. Read moreSource§impl BitOr for NeoInteger
impl BitOr for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
| operator.Source§fn bitor(self, rhs: NeoInteger) -> <NeoInteger as BitOr>::Output
fn bitor(self, rhs: NeoInteger) -> <NeoInteger as BitOr>::Output
Performs the
| operation. Read moreSource§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§fn bitxor(
self,
rhs: &NeoInteger,
) -> <&NeoInteger as BitXor<&NeoInteger>>::Output
fn bitxor( self, rhs: &NeoInteger, ) -> <&NeoInteger as BitXor<&NeoInteger>>::Output
Performs the
^ operation. Read moreSource§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§fn bitxor(self, rhs: &NeoInteger) -> <NeoInteger as BitXor<&NeoInteger>>::Output
fn bitxor(self, rhs: &NeoInteger) -> <NeoInteger as BitXor<&NeoInteger>>::Output
Performs the
^ operation. Read moreSource§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§fn bitxor(self, rhs: NeoInteger) -> <&NeoInteger as BitXor<NeoInteger>>::Output
fn bitxor(self, rhs: NeoInteger) -> <&NeoInteger as BitXor<NeoInteger>>::Output
Performs the
^ operation. Read moreSource§impl BitXor for NeoInteger
impl BitXor for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
^ operator.Source§fn bitxor(self, rhs: NeoInteger) -> <NeoInteger as BitXor>::Output
fn bitxor(self, rhs: NeoInteger) -> <NeoInteger as BitXor>::Output
Performs the
^ operation. Read moreSource§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§fn default() -> NeoInteger
fn default() -> NeoInteger
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for NeoInteger
impl<'de> Deserialize<'de> for NeoInteger
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<NeoInteger, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
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
impl Div<&NeoInteger> for &NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
/ operator.Source§fn div(self, rhs: &NeoInteger) -> <&NeoInteger as Div<&NeoInteger>>::Output
fn div(self, rhs: &NeoInteger) -> <&NeoInteger as Div<&NeoInteger>>::Output
Performs the
/ operation. Read moreSource§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§fn div(self, rhs: &NeoInteger) -> <NeoInteger as Div<&NeoInteger>>::Output
fn div(self, rhs: &NeoInteger) -> <NeoInteger as Div<&NeoInteger>>::Output
Performs the
/ operation. Read moreSource§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§fn div(self, rhs: NeoInteger) -> <&NeoInteger as Div<NeoInteger>>::Output
fn div(self, rhs: NeoInteger) -> <&NeoInteger as Div<NeoInteger>>::Output
Performs the
/ operation. Read moreSource§impl Div for NeoInteger
impl Div for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
/ operator.Source§fn div(self, rhs: NeoInteger) -> <NeoInteger as Div>::Output
fn div(self, rhs: NeoInteger) -> <NeoInteger as Div>::Output
Performs the
/ operation. Read moreSource§impl From<&BigInt> for NeoInteger
impl From<&BigInt> for NeoInteger
Source§fn from(value: &BigInt) -> NeoInteger
fn from(value: &BigInt) -> NeoInteger
Converts to this type from the input type.
Source§impl From<BigInt> for NeoInteger
impl From<BigInt> for NeoInteger
Source§fn from(value: BigInt) -> NeoInteger
fn from(value: BigInt) -> NeoInteger
Converts to this type from the input type.
Source§impl From<NeoInteger> for NeoValue
impl From<NeoInteger> for NeoValue
Source§fn from(value: NeoInteger) -> NeoValue
fn from(value: NeoInteger) -> NeoValue
Converts to this type from the input type.
Source§impl From<i32> for NeoInteger
impl From<i32> for NeoInteger
Source§fn from(value: i32) -> NeoInteger
fn from(value: i32) -> NeoInteger
Converts to this type from the input type.
Source§impl From<i64> for NeoInteger
impl From<i64> for NeoInteger
Source§fn from(value: i64) -> NeoInteger
fn from(value: i64) -> NeoInteger
Converts to this type from the input type.
Source§impl From<u32> for NeoInteger
impl From<u32> for NeoInteger
Source§fn from(value: u32) -> NeoInteger
fn from(value: u32) -> NeoInteger
Converts to this type from the input type.
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§fn mul(self, rhs: &NeoInteger) -> <&NeoInteger as Mul<&NeoInteger>>::Output
fn mul(self, rhs: &NeoInteger) -> <&NeoInteger as Mul<&NeoInteger>>::Output
Performs the
* operation. Read moreSource§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§fn mul(self, rhs: &NeoInteger) -> <NeoInteger as Mul<&NeoInteger>>::Output
fn mul(self, rhs: &NeoInteger) -> <NeoInteger as Mul<&NeoInteger>>::Output
Performs the
* operation. Read moreSource§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§fn mul(self, rhs: NeoInteger) -> <&NeoInteger as Mul<NeoInteger>>::Output
fn mul(self, rhs: NeoInteger) -> <&NeoInteger as Mul<NeoInteger>>::Output
Performs the
* operation. Read moreSource§impl Mul for NeoInteger
impl Mul for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
* operator.Source§fn mul(self, rhs: NeoInteger) -> <NeoInteger as Mul>::Output
fn mul(self, rhs: NeoInteger) -> <NeoInteger as Mul>::Output
Performs the
* operation. Read moreSource§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§fn rem(self, rhs: &NeoInteger) -> <&NeoInteger as Rem<&NeoInteger>>::Output
fn rem(self, rhs: &NeoInteger) -> <&NeoInteger as Rem<&NeoInteger>>::Output
Performs the
% operation. Read moreSource§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§fn rem(self, rhs: &NeoInteger) -> <NeoInteger as Rem<&NeoInteger>>::Output
fn rem(self, rhs: &NeoInteger) -> <NeoInteger as Rem<&NeoInteger>>::Output
Performs the
% operation. Read moreSource§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§fn rem(self, rhs: NeoInteger) -> <&NeoInteger as Rem<NeoInteger>>::Output
fn rem(self, rhs: NeoInteger) -> <&NeoInteger as Rem<NeoInteger>>::Output
Performs the
% operation. Read moreSource§impl Rem for NeoInteger
impl Rem for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
% operator.Source§fn rem(self, rhs: NeoInteger) -> <NeoInteger as Rem>::Output
fn rem(self, rhs: NeoInteger) -> <NeoInteger as Rem>::Output
Performs the
% operation. Read moreSource§impl Serialize for NeoInteger
impl Serialize for NeoInteger
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
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§fn sub(self, rhs: &NeoInteger) -> <&NeoInteger as Sub<&NeoInteger>>::Output
fn sub(self, rhs: &NeoInteger) -> <&NeoInteger as Sub<&NeoInteger>>::Output
Performs the
- operation. Read moreSource§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§fn sub(self, rhs: &NeoInteger) -> <NeoInteger as Sub<&NeoInteger>>::Output
fn sub(self, rhs: &NeoInteger) -> <NeoInteger as Sub<&NeoInteger>>::Output
Performs the
- operation. Read moreSource§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§fn sub(self, rhs: NeoInteger) -> <&NeoInteger as Sub<NeoInteger>>::Output
fn sub(self, rhs: NeoInteger) -> <&NeoInteger as Sub<NeoInteger>>::Output
Performs the
- operation. Read moreSource§impl Sub for NeoInteger
impl Sub for NeoInteger
Source§type Output = NeoInteger
type Output = NeoInteger
The resulting type after applying the
- operator.Source§fn sub(self, rhs: NeoInteger) -> <NeoInteger as Sub>::Output
fn sub(self, rhs: NeoInteger) -> <NeoInteger as Sub>::Output
Performs the
- operation. Read moreimpl 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