pub enum AssetOrCrosschain {
Asset(Asset),
Crosschain,
}Expand description
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§
Implementations§
Source§impl AssetOrCrosschain
impl AssetOrCrosschain
Sourcepub fn to_eth_bytes(&self) -> [u8; 2]
pub fn to_eth_bytes(&self) -> [u8; 2]
Convert asset to id in bytes interpretable by the Ethereum
smart contract, or 0xffff if it is a cross-chain asset
Sourcepub fn from_eth_bytes(bytes: [u8; 2]) -> Result<Self>
pub fn from_eth_bytes(bytes: [u8; 2]) -> Result<Self>
Read asset bytes from a protocol payload and convert into an Asset or mark as cross-chain
Source§impl AssetOrCrosschain
impl AssetOrCrosschain
Sourcepub fn to_neo_bytes(&self) -> Vec<u8> ⓘ
pub fn to_neo_bytes(&self) -> Vec<u8> ⓘ
Convert asset to id in bytes interpretable by the NEO
smart contract, or 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF if it is a cross-chain asset
Sourcepub fn from_neo_bytes(bytes: Vec<u8>) -> Result<Self>
pub fn from_neo_bytes(bytes: Vec<u8>) -> Result<Self>
Read asset bytes from a protocol payload and convert into an Asset or mark as cross-chain
Trait Implementations§
Source§impl Clone for AssetOrCrosschain
impl Clone for AssetOrCrosschain
Source§fn clone(&self) -> AssetOrCrosschain
fn clone(&self) -> AssetOrCrosschain
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 AssetOrCrosschain
impl Debug for AssetOrCrosschain
Source§impl From<Asset> for AssetOrCrosschain
impl From<Asset> for AssetOrCrosschain
Source§impl From<AssetofPrecision> for AssetOrCrosschain
impl From<AssetofPrecision> for AssetOrCrosschain
Source§fn from(asset_prec: AssetofPrecision) -> Self
fn from(asset_prec: AssetofPrecision) -> Self
Converts to this type from the input type.
Source§impl PartialEq for AssetOrCrosschain
impl PartialEq for AssetOrCrosschain
impl StructuralPartialEq for AssetOrCrosschain
Auto Trait Implementations§
impl Freeze for AssetOrCrosschain
impl RefUnwindSafe for AssetOrCrosschain
impl Send for AssetOrCrosschain
impl Sync for AssetOrCrosschain
impl Unpin for AssetOrCrosschain
impl UnwindSafe for AssetOrCrosschain
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more