referrerpolicy=no-referrer-when-downgrade

Trait TryMerge

pub trait TryMerge: Sized {
    // Required method
    fn try_merge(self, other: Self) -> Result<Self, (Self, Self)>;
}
Expand description

Try to merge two imbalances.

Required Methods§

fn try_merge(self, other: Self) -> Result<Self, (Self, Self)>

Consume self and an other to return a new instance that combines both. Errors with Err(self, other) if the imbalances cannot be merged (e.g. imbalances of different assets).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl TryMerge for ()

§

fn try_merge(self, _: ()) -> Result<(), ((), ())>

Implementors§

§

impl<A, B, OnDrop, OppositeOnDrop> TryMerge for polkadot_sdk_frame::token::fungibles::Imbalance<A, B, OnDrop, OppositeOnDrop>
where A: AssetId, B: Balance, OnDrop: HandleImbalanceDrop<A, B>, OppositeOnDrop: HandleImbalanceDrop<A, B>,

§

impl<B, OnDrop, OppositeOnDrop> TryMerge for polkadot_sdk_frame::token::fungible::Imbalance<B, OnDrop, OppositeOnDrop>
where B: Balance, OnDrop: HandleImbalanceDrop<B>, OppositeOnDrop: HandleImbalanceDrop<B>,

impl<T: Config<I>, I: 'static> TryMerge for NegativeImbalance<T, I>

impl<T: Config<I>, I: 'static> TryMerge for PositiveImbalance<T, I>