Expand description
Output with native assets (e.g. Cardano, Ergo)
The algorithm of selection picks the closest.
- Computes
wanted - unwanted
assets in the outputs, the larger the better. Returns0
if there are more unwanted assets. - If the values of #1 are equal, the more
wanted
assets the better. - If the values of #2 are equal, the fewer
unwanted
assets the better. - If the values of #3 are equal, the larger value the better.
The value of asset should not be 0
.
Fields
value: u64
Coin value.
assets: BTreeMap<K, u64>
Native assets.
data: Option<D>
Optional data such as transaction hash, index and any other data needed later. The output should be able to make a transaction input after selection.
Implementations
Trait Implementations
sourceimpl<D, K: Clone + Ord> Select for ExtOutput<D, K>
impl<D, K: Clone + Ord> Select for ExtOutput<D, K>
sourcefn checked_add(&self, rhs: &Self) -> Option<Self>
fn checked_add(&self, rhs: &Self) -> Option<Self>
Computes self + rhs
, returning None
if overflow occurred.
sourcefn checked_sub(&self, rhs: &Self) -> Option<Self>
fn checked_sub(&self, rhs: &Self) -> Option<Self>
Computes self - rhs
, returning None
if overflow occurred.
sourcefn saturating_sub(&self, rhs: &Self) -> Self
fn saturating_sub(&self, rhs: &Self) -> Self
Computes self - rhs
, saturating at the lowest bound if overflow occurred.
impl<D, K> StructuralPartialEq for ExtOutput<D, K>
Auto Trait Implementations
impl<D, K> RefUnwindSafe for ExtOutput<D, K> where
D: RefUnwindSafe,
K: RefUnwindSafe,
impl<D, K> Send for ExtOutput<D, K> where
D: Send,
K: Send,
impl<D, K> Sync for ExtOutput<D, K> where
D: Sync,
K: Sync,
impl<D, K> Unpin for ExtOutput<D, K> where
D: Unpin,
impl<D, K> UnwindSafe for ExtOutput<D, K> where
D: UnwindSafe,
K: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more