Module imbalance
Expand description
The imbalance trait type and its associates, which handles keeps everything adding up properly with unbalanced operations.
Structs§
- Maybe
Resolve Asset To - Resolves received asset credit to account
TargetifTarget::get()returns some, implementingOnUnbalanced. - Resolve
Asset To - Resolves received asset credit to account
A, implementingOnUnbalanced. - Resolve
To - Resolves received asset credit to account
A, implementingOnUnbalanced. - Split
TwoWays - Split an unbalanced amount two ways between a common divisor.
Enums§
- Signed
Imbalance - Either a positive or a negative imbalance.
Traits§
- Imbalance
- A trait for a not-quite Linear Type that tracks an imbalance.
- Imbalance
Accounting - Helper trait to be used for generic Imbalance, helpful for tracking multiple concrete types of
Imbalanceusing dynamic dispatch of this trait. - OnUnbalanced
- Handler for when some currency “account” decreased in balance for some reason.
- TryMerge
- Try to merge two imbalances.
- Unsafe
Constructor Destructor - Unsafe imbalance cloning constructor and forgetful destructor.
- Unsafe
Manual Accounting - Unsafe manual accounting operations for imbalances.