[][src]Struct eosio::Asset

pub struct Asset {
    pub amount: i64,
    pub symbol: Symbol,
}

Stores information for owner of asset https://github.com/EOSIO/eosio.cdt/blob/4985359a30da1f883418b7133593f835927b8046/libraries/eosiolib/core/eosio/asset.hpp#L18-L369

Fields

amount: i64

The amount of the asset

symbol: Symbol

The symbol name of the asset

Methods

impl Asset[src]

pub fn zero<T: Into<Symbol>>(symbol: T) -> Self[src]

#[must_use] pub fn is_valid(&self) -> bool[src]

Check if the asset is valid. A valid asset has its amount <= max_amount and its symbol name valid

Trait Implementations

impl Add<Asset> for Asset[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<Asset> for i64[src]

type Output = Asset

The resulting type after applying the + operator.

impl Add<i64> for Asset[src]

type Output = Self

The resulting type after applying the + operator.

impl AddAssign<Asset> for Asset[src]

impl AddAssign<i64> for Asset[src]

impl CheckedAdd<Asset> for Asset[src]

type Output = Result<Self, AssetOpError>

TODO docs

impl CheckedAdd<i128> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedAdd<i64> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedAdd<isize> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedAdd<u128> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedAdd<u64> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedAdd<usize> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedDiv<Asset> for Asset[src]

type Output = Result<Self, AssetDivOpError>

TODO docs

impl CheckedDiv<i128> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedDiv<i64> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedDiv<isize> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedDiv<u128> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedDiv<u64> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedDiv<usize> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedMul<Asset> for Asset[src]

type Output = Result<Self, AssetOpError>

TODO docs

impl CheckedMul<i128> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedMul<i64> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedMul<isize> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedMul<u128> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedMul<u64> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedMul<usize> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedRem<Asset> for Asset[src]

type Output = Result<Self, AssetOpError>

TODO docs

impl CheckedRem<i128> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedRem<i64> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedRem<isize> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedRem<u128> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedRem<u64> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedRem<usize> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedSub<Asset> for Asset[src]

type Output = Result<Self, AssetOpError>

TODO docs

impl CheckedSub<i128> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedSub<i64> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedSub<isize> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedSub<u128> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedSub<u64> for Asset[src]

type Output = Option<Self>

TODO docs

impl CheckedSub<usize> for Asset[src]

type Output = Option<Self>

TODO docs

impl Clone for Asset[src]

impl Copy for Asset[src]

impl Debug for Asset[src]

impl Default for Asset[src]

impl Display for Asset[src]

impl Div<Asset> for Asset[src]

type Output = Self

The resulting type after applying the / operator.

impl Div<Asset> for i64[src]

type Output = Asset

The resulting type after applying the / operator.

impl Div<i64> for Asset[src]

type Output = Self

The resulting type after applying the / operator.

impl DivAssign<Asset> for Asset[src]

impl DivAssign<i64> for Asset[src]

impl FromStr for Asset[src]

type Err = ParseAssetError

The associated error which can be returned from parsing.

impl Mul<Asset> for Asset[src]

type Output = Self

The resulting type after applying the * operator.

impl Mul<Asset> for i64[src]

type Output = Asset

The resulting type after applying the * operator.

impl Mul<i64> for Asset[src]

type Output = Self

The resulting type after applying the * operator.

impl MulAssign<Asset> for Asset[src]

impl MulAssign<i64> for Asset[src]

impl NumBytes for Asset[src]

impl PartialEq<Asset> for Asset[src]

impl PartialOrd<Asset> for Asset[src]

impl Read for Asset[src]

impl Rem<Asset> for Asset[src]

type Output = Self

The resulting type after applying the % operator.

impl Rem<Asset> for i64[src]

type Output = Asset

The resulting type after applying the % operator.

impl Rem<i64> for Asset[src]

type Output = Self

The resulting type after applying the % operator.

impl RemAssign<Asset> for Asset[src]

impl RemAssign<i64> for Asset[src]

impl StructuralPartialEq for Asset[src]

impl Sub<Asset> for Asset[src]

type Output = Self

The resulting type after applying the - operator.

impl Sub<Asset> for i64[src]

type Output = Asset

The resulting type after applying the - operator.

impl Sub<i64> for Asset[src]

type Output = Self

The resulting type after applying the - operator.

impl SubAssign<Asset> for Asset[src]

impl SubAssign<i64> for Asset[src]

impl Write for Asset[src]

Auto Trait Implementations

impl Send for Asset

impl Sync for Asset

impl Unpin for Asset

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> From<T> for T[src]

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

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, 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.