Struct cosmwasm_std::Int64
source · pub struct Int64(_);
Expand description
An implementation of i64 that is using strings for JSON encoding/decoding, such that the full i64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.
Examples
Use from
to create instances of this and i64
to get the value out:
let a = Int64::from(258i64);
assert_eq!(a.i64(), 258);
Implementations§
source§impl Int64
impl Int64
pub const MAX: Int64 = _
pub const MIN: Int64 = _
sourcepub const fn new(value: i64) -> Self
pub const fn new(value: i64) -> Self
Creates a Int64(value).
This method is less flexible than from
but can be called in a const context.
pub const fn from_be_bytes(data: [u8; 8]) -> Self
pub const fn from_le_bytes(data: [u8; 8]) -> Self
sourcepub const fn to_be_bytes(self) -> [u8; 8]
pub const fn to_be_bytes(self) -> [u8; 8]
Returns a copy of the number as big endian bytes.
sourcepub const fn to_le_bytes(self) -> [u8; 8]
pub const fn to_le_bytes(self) -> [u8; 8]
Returns a copy of the number as little endian bytes.
pub const fn is_zero(&self) -> bool
pub fn pow(self, exp: u32) -> Self
pub fn checked_add(self, other: Self) -> Result<Self, OverflowError>
pub fn checked_sub(self, other: Self) -> Result<Self, OverflowError>
pub fn checked_mul(self, other: Self) -> Result<Self, OverflowError>
pub fn checked_pow(self, exp: u32) -> Result<Self, OverflowError>
pub fn checked_div(self, other: Self) -> Result<Self, DivisionError>
pub fn checked_div_euclid(self, other: Self) -> Result<Self, DivisionError>
pub fn checked_rem(self, other: Self) -> Result<Self, DivideByZeroError>
pub fn checked_shr(self, other: u32) -> Result<Self, OverflowError>
pub fn checked_shl(self, other: u32) -> Result<Self, OverflowError>
pub fn wrapping_add(self, other: Self) -> Self
pub fn wrapping_sub(self, other: Self) -> Self
pub fn wrapping_mul(self, other: Self) -> Self
pub fn wrapping_pow(self, other: u32) -> Self
pub fn saturating_add(self, other: Self) -> Self
pub fn saturating_sub(self, other: Self) -> Self
pub fn saturating_mul(self, other: Self) -> Self
pub fn saturating_pow(self, exp: u32) -> Self
pub fn abs_diff(self, other: Self) -> Uint64
Trait Implementations§
source§impl AddAssign<&Int64> for Int64
impl AddAssign<&Int64> for Int64
source§fn add_assign(&mut self, other: &Int64)
fn add_assign(&mut self, other: &Int64)
Performs the
+=
operation. Read moresource§impl AddAssign<Int64> for Int64
impl AddAssign<Int64> for Int64
source§fn add_assign(&mut self, rhs: Int64)
fn add_assign(&mut self, rhs: Int64)
Performs the
+=
operation. Read moresource§impl<'de> Deserialize<'de> for Int64
impl<'de> Deserialize<'de> for Int64
source§fn deserialize<D>(deserializer: D) -> Result<Int64, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Int64, D::Error>where D: Deserializer<'de>,
Deserialized from an integer string using base 10
source§impl DivAssign<&Int64> for Int64
impl DivAssign<&Int64> for Int64
source§fn div_assign(&mut self, other: &Int64)
fn div_assign(&mut self, other: &Int64)
Performs the
/=
operation. Read moresource§impl DivAssign<Int64> for Int64
impl DivAssign<Int64> for Int64
source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/=
operation. Read moresource§impl JsonSchema for Int64
impl JsonSchema for Int64
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl MulAssign<&Int64> for Int64
impl MulAssign<&Int64> for Int64
source§fn mul_assign(&mut self, other: &Int64)
fn mul_assign(&mut self, other: &Int64)
Performs the
*=
operation. Read moresource§impl MulAssign<Int64> for Int64
impl MulAssign<Int64> for Int64
source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*=
operation. Read moresource§impl Ord for Int64
impl Ord for Int64
source§impl PartialEq<&Int64> for Int64
impl PartialEq<&Int64> for Int64
source§impl PartialEq<Int64> for Int64
impl PartialEq<Int64> for Int64
source§impl PartialOrd<Int64> for Int64
impl PartialOrd<Int64> for Int64
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moresource§impl RemAssign<&Int64> for Int64
impl RemAssign<&Int64> for Int64
source§fn rem_assign(&mut self, other: &Int64)
fn rem_assign(&mut self, other: &Int64)
Performs the
%=
operation. Read moresource§impl RemAssign<Int64> for Int64
impl RemAssign<Int64> for Int64
source§fn rem_assign(&mut self, rhs: Int64)
fn rem_assign(&mut self, rhs: Int64)
Performs the
%=
operation. Read moresource§impl ShlAssign<&u32> for Int64
impl ShlAssign<&u32> for Int64
source§fn shl_assign(&mut self, other: &u32)
fn shl_assign(&mut self, other: &u32)
Performs the
<<=
operation. Read moresource§impl ShlAssign<u32> for Int64
impl ShlAssign<u32> for Int64
source§fn shl_assign(&mut self, rhs: u32)
fn shl_assign(&mut self, rhs: u32)
Performs the
<<=
operation. Read moresource§impl ShrAssign<&u32> for Int64
impl ShrAssign<&u32> for Int64
source§fn shr_assign(&mut self, other: &u32)
fn shr_assign(&mut self, other: &u32)
Performs the
>>=
operation. Read moresource§impl ShrAssign<u32> for Int64
impl ShrAssign<u32> for Int64
source§fn shr_assign(&mut self, rhs: u32)
fn shr_assign(&mut self, rhs: u32)
Performs the
>>=
operation. Read moresource§impl SubAssign<&Int64> for Int64
impl SubAssign<&Int64> for Int64
source§fn sub_assign(&mut self, other: &Int64)
fn sub_assign(&mut self, other: &Int64)
Performs the
-=
operation. Read moresource§impl SubAssign<Int64> for Int64
impl SubAssign<Int64> for Int64
source§fn sub_assign(&mut self, rhs: Int64)
fn sub_assign(&mut self, rhs: Int64)
Performs the
-=
operation. Read moreimpl Copy for Int64
impl Eq for Int64
impl StructuralEq for Int64
impl StructuralPartialEq for Int64
Auto Trait Implementations§
impl RefUnwindSafe for Int64
impl Send for Int64
impl Sync for Int64
impl Unpin for Int64
impl UnwindSafe for Int64
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