ReservableWithName

Struct ReservableWithName 

Source
pub struct ReservableWithName<NamedReservable, Id, AccountId>(/* private fields */);
Expand description

Adapter to allow a NamedReservableCurrency to be passed as regular ReservableCurrency together with an Id.

All “anonymous” operations are then implemented as their named counterparts with the given Id.

Trait Implementations§

Source§

impl<NamedReservable: NamedReservableCurrency<AccountId>, Id: Get<NamedReservable::ReserveIdentifier>, AccountId> Currency<AccountId> for ReservableWithName<NamedReservable, Id, AccountId>

Source§

type Balance = <NamedReservable as Currency<AccountId>>::Balance

The balance of an account.
Source§

type PositiveImbalance = <NamedReservable as Currency<AccountId>>::PositiveImbalance

The opaque token type for an imbalance. This is returned by unbalanced operations and must be dealt with. It may be dropped but cannot be cloned.
Source§

type NegativeImbalance = <NamedReservable as Currency<AccountId>>::NegativeImbalance

The opaque token type for an imbalance. This is returned by unbalanced operations and must be dealt with. It may be dropped but cannot be cloned.
Source§

fn total_balance(who: &AccountId) -> Self::Balance

The combined balance of who.
Source§

fn can_slash(who: &AccountId, value: Self::Balance) -> bool

Same result as slash(who, value) (but without the side-effects) assuming there are no balance changes in the meantime and only the reserved balance is not taken into account.
Source§

fn total_issuance() -> Self::Balance

The total amount of issuance in the system.
Source§

fn minimum_balance() -> Self::Balance

The minimum balance any single account may have. This is equivalent to the Balances module’s ExistentialDeposit.
Source§

fn burn(amount: Self::Balance) -> Self::PositiveImbalance

Reduce the total issuance by amount and return the according imbalance. The imbalance will typically be used to reduce an account by the same amount with e.g. settle. Read more
Source§

fn issue(amount: Self::Balance) -> Self::NegativeImbalance

Increase the total issuance by amount and return the according imbalance. The imbalance will typically be used to increase an account by the same amount with e.g. resolve_into_existing or resolve_creating. Read more
Source§

fn pair( amount: Self::Balance, ) -> (Self::PositiveImbalance, Self::NegativeImbalance)

Produce a pair of imbalances that cancel each other out exactly. Read more
Source§

fn free_balance(who: &AccountId) -> Self::Balance

The ‘free’ balance of a given account. Read more
Source§

fn ensure_can_withdraw( who: &AccountId, amount: Self::Balance, reasons: WithdrawReasons, new_balance: Self::Balance, ) -> DispatchResult

Returns Ok iff the account is able to make a withdrawal of the given amount for the given reason. Basically, it’s just a dry-run of withdraw. Read more
Source§

fn transfer( source: &AccountId, dest: &AccountId, value: Self::Balance, existence_requirement: ExistenceRequirement, ) -> DispatchResult

Transfer some liquid free balance to another staker. Read more
Source§

fn slash( who: &AccountId, value: Self::Balance, ) -> (Self::NegativeImbalance, Self::Balance)

Deducts up to value from the combined balance of who, preferring to deduct from the free balance. This function cannot fail. Read more
Source§

fn deposit_into_existing( who: &AccountId, value: Self::Balance, ) -> Result<Self::PositiveImbalance, DispatchError>

Mints value to the free balance of who. Read more
Source§

fn resolve_into_existing( who: &AccountId, value: Self::NegativeImbalance, ) -> Result<(), Self::NegativeImbalance>

Similar to deposit_creating, only accepts a NegativeImbalance and returns nothing on success.
Source§

fn deposit_creating( who: &AccountId, value: Self::Balance, ) -> Self::PositiveImbalance

Adds up to value to the free balance of who. If who doesn’t exist, it is created. Read more
Source§

fn resolve_creating(who: &AccountId, value: Self::NegativeImbalance)

Similar to deposit_creating, only accepts a NegativeImbalance and returns nothing on success.
Source§

fn withdraw( who: &AccountId, value: Self::Balance, reasons: WithdrawReasons, liveness: ExistenceRequirement, ) -> Result<Self::NegativeImbalance, DispatchError>

Removes some free balance from who account for reason if possible. If liveness is KeepAlive, then no less than ExistentialDeposit must be left remaining. Read more
Source§

fn settle( who: &AccountId, value: Self::PositiveImbalance, reasons: WithdrawReasons, liveness: ExistenceRequirement, ) -> Result<(), Self::PositiveImbalance>

Similar to withdraw, only accepts a PositiveImbalance and returns nothing on success.
Source§

fn make_free_balance_be( who: &AccountId, balance: Self::Balance, ) -> SignedImbalance<Self::Balance, Self::PositiveImbalance>

Ensure an account’s free balance equals some value; this will create the account if needed. Read more
Source§

fn active_issuance() -> Self::Balance

The total amount of issuance in the system excluding those which are controlled by the system.
Source§

fn deactivate(_: Self::Balance)

Reduce the active issuance by some amount.
Source§

fn reactivate(_: Self::Balance)

Increase the active issuance by some amount, up to the outstanding amount reduced.
Source§

impl<NamedReservable: NamedReservableCurrency<AccountId>, Id: Get<NamedReservable::ReserveIdentifier>, AccountId> ReservableCurrency<AccountId> for ReservableWithName<NamedReservable, Id, AccountId>

Source§

fn can_reserve(who: &AccountId, value: Self::Balance) -> bool

Same result as reserve(who, value) (but without the side-effects) assuming there are no balance changes in the meantime.
Source§

fn slash_reserved( who: &AccountId, value: Self::Balance, ) -> (Self::NegativeImbalance, Self::Balance)

Deducts up to value from reserved balance of who. This function cannot fail. Read more
Source§

fn reserved_balance(who: &AccountId) -> Self::Balance

The amount of the balance of a given account that is externally reserved; this can still get slashed, but gets slashed last of all. Read more
Source§

fn reserve(who: &AccountId, value: Self::Balance) -> DispatchResult

Moves value from balance to reserved balance. Read more
Source§

fn unreserve(who: &AccountId, value: Self::Balance) -> Self::Balance

Moves up to value from reserved balance to free balance. This function cannot fail. Read more
Source§

fn repatriate_reserved( slashed: &AccountId, beneficiary: &AccountId, value: Self::Balance, status: BalanceStatus, ) -> Result<Self::Balance, DispatchError>

Moves up to value from reserved balance of account slashed to balance of account beneficiary. beneficiary must exist for this to succeed. If it does not, Err will be returned. Funds will be placed in either the free balance or the reserved balance, depending on the status. Read more

Auto Trait Implementations§

§

impl<NamedReservable, Id, AccountId> Freeze for ReservableWithName<NamedReservable, Id, AccountId>

§

impl<NamedReservable, Id, AccountId> RefUnwindSafe for ReservableWithName<NamedReservable, Id, AccountId>
where NamedReservable: RefUnwindSafe, Id: RefUnwindSafe, AccountId: RefUnwindSafe,

§

impl<NamedReservable, Id, AccountId> Send for ReservableWithName<NamedReservable, Id, AccountId>
where NamedReservable: Send, Id: Send, AccountId: Send,

§

impl<NamedReservable, Id, AccountId> Sync for ReservableWithName<NamedReservable, Id, AccountId>
where NamedReservable: Sync, Id: Sync, AccountId: Sync,

§

impl<NamedReservable, Id, AccountId> Unpin for ReservableWithName<NamedReservable, Id, AccountId>
where NamedReservable: Unpin, Id: Unpin, AccountId: Unpin,

§

impl<NamedReservable, Id, AccountId> UnwindSafe for ReservableWithName<NamedReservable, Id, AccountId>
where NamedReservable: UnwindSafe, Id: UnwindSafe, AccountId: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CheckedConversion for T

Source§

fn checked_from<T>(t: T) -> Option<Self>
where Self: TryFrom<T>,

Convert from a value of T into an equivalent instance of Option<Self>. Read more
Source§

fn checked_into<T>(self) -> Option<T>
where Self: TryInto<T>,

Consume self to return Some equivalent value of Option<T>. Read more
Source§

impl<T, U> DefensiveTruncateInto<U> for T

Source§

fn defensive_truncate_into(self) -> U

Defensively truncate a value and convert it into its bounded form.
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> IntoKey<U> for T
where U: FromKey<T>,

Source§

fn into_key(self) -> U

Source§

impl<Src, Dest> IntoTuple<Dest> for Src
where Dest: FromTuple<Src>,

Source§

fn into_tuple(self) -> Dest

Source§

impl<T> IsType<T> for T

Source§

fn from_ref(t: &T) -> &T

Cast reference.
Source§

fn into_ref(&self) -> &T

Cast reference.
Source§

fn from_mut(t: &mut T) -> &mut T

Cast mutable reference.
Source§

fn into_mut(&mut self) -> &mut T

Cast mutable reference.
Source§

impl<T, Outer> IsWrappedBy<Outer> for T
where Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,

Source§

fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

Source§

fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatedConversion for T

Source§

fn saturated_from<T>(t: T) -> Self
where Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
Source§

fn saturated_into<T>(self) -> T
where Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U> TryIntoKey<U> for T
where U: TryFromKey<T>,

Source§

type Error = <U as TryFromKey<T>>::Error

Source§

fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>

Source§

impl<S, T> UncheckedInto<T> for S
where T: UncheckedFrom<S>,

Source§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
Source§

impl<T, S> UniqueSaturatedInto<T> for S
where T: Bounded, S: TryInto<T>,

Source§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> JsonSchemaMaybe for T

Source§

impl<T> MaybeRefUnwindSafe for T
where T: RefUnwindSafe,