[][src]Enum nash_protocol::types::blockchain::AssetOrCrosschain

pub enum AssetOrCrosschain {
    Asset(Asset),
    Crosschain,
}

An asset in the Ethereum and NEO smart contract protocols is represented either by an asset id or an indicator that the trade is occurring across blockchains.

Variants

Asset(Asset)
Crosschain

Implementations

impl AssetOrCrosschain[src]

pub fn to_eth_bytes(&self) -> [u8; 2][src]

Convert asset to id in bytes interpretable by the Ethereum smart contract, or 0xffff if it is a cross-chain asset

pub fn from_eth_bytes(bytes: [u8; 2]) -> Result<Self>[src]

Read asset bytes from a protocol payload and convert into an Asset or mark as cross-chain

impl AssetOrCrosschain[src]

pub fn to_neo_bytes(&self) -> Vec<u8>[src]

Convert asset to id in bytes interpretable by the NEO smart contract, or 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF if it is a cross-chain asset

pub fn from_neo_bytes(bytes: Vec<u8>) -> Result<Self>[src]

Read asset bytes from a protocol payload and convert into an Asset or mark as cross-chain

Trait Implementations

impl Clone for AssetOrCrosschain[src]

impl Debug for AssetOrCrosschain[src]

impl From<Asset> for AssetOrCrosschain[src]

impl From<AssetofPrecision> for AssetOrCrosschain[src]

impl PartialEq<AssetOrCrosschain> for AssetOrCrosschain[src]

impl StructuralPartialEq for AssetOrCrosschain[src]

Auto Trait Implementations

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> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

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.