Struct pallet_balances::PositiveImbalance [−][src]
Expand description
Opaque, move-only struct with private fields that serves as a token denoting that funds have been created without any equal and opposite accounting.
Implementations
Trait Implementations
type Opposite = NegativeImbalance<T, I>
type Opposite = NegativeImbalance<T, I>
The oppositely imbalanced type. They come in pairs.
Drop an instance cleanly. Only works if its self.value()
is zero.
Consume self
and return two independent instances; the first
is guaranteed to be at most amount
and the second will be the remainder. Read more
Consume self
and an other
to return a new instance that combines
both. Read more
Consume an other
to mutate self
into a new instance that combines
both. Read more
Consume self and along with an opposite counterpart to return a combined result. Read more
Consume self
and return two independent instances; the amounts returned will be in
approximately the same ratio as first
:second
. Read more
Consume self and add its two components, defined by the first component’s balance, element-wise to two pre-existing Imbalances. Read more
Consume self and add its two components, defined by the ratio first
:second
,
element-wise to two pre-existing Imbalances. Read more
Consume self and add its two components, defined by the first component’s balance, element-wise into two pre-existing Imbalance refs. Read more
fn ration_merge_into(self, first: u32, second: u32, others: &mut (Self, Self)) where
Balance: From<u32> + Saturating + Div<Balance, Output = Balance>,
fn ration_merge_into(self, first: u32, second: u32, others: &mut (Self, Self)) where
Balance: From<u32> + Saturating + Div<Balance, Output = Balance>,
Consume self and add its two components, defined by the ratio first
:second
,
element-wise to two pre-existing Imbalances. Read more
Consume self to mutate other
so that it combines both. Just like subsume
, only with
reversed arguments. Read more
Consume self
and maybe an other
to return a new instance that combines
both. Read more
Maybe consume an other
to mutate self
into a new instance that combines
both. Read more
impl<T: PartialEq + Config<I>, I: PartialEq + 'static> PartialEq<PositiveImbalance<T, I>> for PositiveImbalance<T, I> where
T::Balance: PartialEq,
impl<T: PartialEq + Config<I>, I: PartialEq + 'static> PartialEq<PositiveImbalance<T, I>> for PositiveImbalance<T, I> where
T::Balance: PartialEq,
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<T, I> RefUnwindSafe for PositiveImbalance<T, I> where
<T as Config<I>>::Balance: RefUnwindSafe,
impl<T, I> Send for PositiveImbalance<T, I>
impl<T, I> Sync for PositiveImbalance<T, I>
impl<T, I> Unpin for PositiveImbalance<T, I> where
<T as Config<I>>::Balance: Unpin,
impl<T, I> UnwindSafe for PositiveImbalance<T, I> where
<T as Config<I>>::Balance: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
impl<T> MaybeDebug for T where
T: Debug,
impl<T> MaybeDebug for T where
T: Debug,