gear_common::gas_provider

Trait Provider

Source
pub trait Provider {
    type ExternalOrigin;
    type NodeId;
    type Balance;
    type Funds;
    type InternalError: Error;
    type Error: From<Self::InternalError>;
    type GasTree: LockableTree<ExternalOrigin = Self::ExternalOrigin, NodeId = Self::NodeId, Balance = Self::Balance, Funds = Self::Funds, InternalError = Self::InternalError, Error = Self::Error> + ReservableTree;

    // Provided method
    fn reset() { ... }
}
Expand description

Represents logic of centralized GasTree-algorithm.

Required Associated Types§

Source

type ExternalOrigin

Type representing the external owner of a value (gas) item.

Source

type NodeId

Type that identifies a tree node.

Source

type Balance

Type representing a quantity of value.

Source

type Funds

Type representing a quantity of token balance.

Source

type InternalError: Error

Source

type Error: From<Self::InternalError>

Error type.

Source

type GasTree: LockableTree<ExternalOrigin = Self::ExternalOrigin, NodeId = Self::NodeId, Balance = Self::Balance, Funds = Self::Funds, InternalError = Self::InternalError, Error = Self::Error> + ReservableTree

A ledger to account for gas creation and consumption.

Provided Methods§

Source

fn reset()

Resets all related to gas provider storages.

It’s a temporary production solution to avoid DB migrations and would be available for test purposes only in the future.

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.

Implementors§