Struct cosmwasm_std::Uint64[][src]

pub struct Uint64(_);

A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 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 u64 to get the value out:

let a = Uint64::from(42u64);
assert_eq!(a.u64(), 42);

let b = Uint64::from(70u32);
assert_eq!(b.u64(), 70);

Implementations

impl Uint64[src]

pub const fn new(value: u64) -> Self[src]

Creates a Uint64(value).

This method is less flexible than from but can be called in a const context.

pub const fn zero() -> Self[src]

Creates a Uint64(0)

pub const fn u64(&self) -> u64[src]

Returns a copy of the internal data

pub fn is_zero(&self) -> bool[src]

pub fn checked_add(self, other: Self) -> Result<Self, OverflowError>[src]

pub fn checked_sub(self, other: Self) -> Result<Self, OverflowError>[src]

pub fn checked_mul(self, other: Self) -> Result<Self, OverflowError>[src]

pub fn checked_div(self, other: Self) -> Result<Self, DivideByZeroError>[src]

pub fn checked_div_euclid(self, other: Self) -> Result<Self, DivideByZeroError>[src]

pub fn checked_rem(self, other: Self) -> Result<Self, DivideByZeroError>[src]

pub fn wrapping_add(self, other: Self) -> Self[src]

pub fn wrapping_sub(self, other: Self) -> Self[src]

pub fn wrapping_mul(self, other: Self) -> Self[src]

pub fn wrapping_pow(self, other: u32) -> Self[src]

pub fn saturating_add(self, other: Self) -> Self[src]

pub fn saturating_sub(self, other: Self) -> Self[src]

pub fn saturating_mul(self, other: Self) -> Self[src]

pub fn saturating_pow(self, other: u32) -> Self[src]

impl Uint64[src]

pub fn multiply_ratio<A: Into<u64>, B: Into<u64>>(
    &self,
    numerator: A,
    denominator: B
) -> Uint64
[src]

Returns self * numerator / denominator

Trait Implementations

impl<'a> Add<&'a Uint64> for Uint64[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<Uint64> for Uint64[src]

type Output = Self

The resulting type after applying the + operator.

impl<'a> AddAssign<&'a Uint64> for Uint64[src]

impl AddAssign<Uint64> for Uint64[src]

impl Clone for Uint64[src]

impl Copy for Uint64[src]

impl Debug for Uint64[src]

impl Default for Uint64[src]

impl<'de> Deserialize<'de> for Uint64[src]

fn deserialize<D>(deserializer: D) -> Result<Uint64, D::Error> where
    D: Deserializer<'de>, 
[src]

Deserialized from an integer string using base 10

impl Display for Uint64[src]

impl Eq for Uint64[src]

impl From<u16> for Uint64[src]

impl From<u32> for Uint64[src]

impl From<u64> for Uint64[src]

impl From<u8> for Uint64[src]

impl JsonSchema for Uint64[src]

impl Ord for Uint64[src]

impl PartialEq<Uint64> for Uint64[src]

impl PartialOrd<Uint64> for Uint64[src]

impl Serialize for Uint64[src]

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
    S: Serializer
[src]

Serializes as an integer string using base 10

impl StructuralEq for Uint64[src]

impl StructuralPartialEq for Uint64[src]

impl<'a> Sum<&'a Uint64> for Uint64[src]

impl Sum<Uint64> for Uint64[src]

impl TryFrom<&'_ str> for Uint64[src]

type Error = StdError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Uint64

impl Send for Uint64

impl Sync for Uint64

impl Unpin for Uint64

impl UnwindSafe for Uint64

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

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

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.