pub enum NativeAsset {
Wrapper {
native: Token,
wrapper: Token,
},
SharedBalance {
native: Token,
routable: Token,
},
NativeOnly {
native: Token,
},
}Expand description
The native asset representations and economic relationship for a chain.
Variants§
Wrapper
Separate native and ERC-20 balances connected by a wrapper contract.
Separate token representations exposing the same underlying balance.
NativeOnly
A native balance without a routable token representation.
Implementations§
Source§impl NativeAsset
impl NativeAsset
pub fn native_token(&self) -> &Token
pub fn routable_token(&self) -> Option<&Token>
Sourcepub fn wrapper(&self) -> Option<&Token>
pub fn wrapper(&self) -> Option<&Token>
Returns the routable token only when it is backed by a real wrapper contract.
Sourcepub fn representations(&self) -> impl Iterator<Item = &Token>
pub fn representations(&self) -> impl Iterator<Item = &Token>
Returns each token representation of this economic asset.
Trait Implementations§
Source§impl Clone for NativeAsset
impl Clone for NativeAsset
Source§impl Debug for NativeAsset
impl Debug for NativeAsset
impl Eq for NativeAsset
Source§impl PartialEq for NativeAsset
impl PartialEq for NativeAsset
impl StructuralPartialEq for NativeAsset
Auto Trait Implementations§
impl !Freeze for NativeAsset
impl RefUnwindSafe for NativeAsset
impl Send for NativeAsset
impl Sync for NativeAsset
impl Unpin for NativeAsset
impl UnsafeUnpin for NativeAsset
impl UnwindSafe for NativeAsset
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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