Trait gear_common::gas_provider::ReservableTree
source · pub trait ReservableTree: Tree {
// Required methods
fn reserve(
key: impl Into<Self::NodeId>,
new_key: impl Into<Self::NodeId>,
amount: Self::Balance,
) -> Result<(), Self::Error>;
fn system_reserve(
key: impl Into<Self::NodeId>,
amount: Self::Balance,
) -> Result<(), Self::Error>;
fn system_unreserve(
key: impl Into<Self::NodeId>,
) -> Result<Self::Balance, Self::Error>;
fn get_system_reserve(
key: impl Into<Self::NodeId>,
) -> Result<Self::Balance, Self::Error>;
}
Required Methods§
sourcefn reserve(
key: impl Into<Self::NodeId>,
new_key: impl Into<Self::NodeId>,
amount: Self::Balance,
) -> Result<(), Self::Error>
fn reserve( key: impl Into<Self::NodeId>, new_key: impl Into<Self::NodeId>, amount: Self::Balance, ) -> Result<(), Self::Error>
Reserve some value from underlying balance.
Used in gas reservation feature.
sourcefn system_reserve(
key: impl Into<Self::NodeId>,
amount: Self::Balance,
) -> Result<(), Self::Error>
fn system_reserve( key: impl Into<Self::NodeId>, amount: Self::Balance, ) -> Result<(), Self::Error>
Reserve some value from underlying balance.
Used in gas reservation for system signal.
sourcefn system_unreserve(
key: impl Into<Self::NodeId>,
) -> Result<Self::Balance, Self::Error>
fn system_unreserve( key: impl Into<Self::NodeId>, ) -> Result<Self::Balance, Self::Error>
Unreserve some value from underlying balance.
Used in gas reservation for system signal.
sourcefn get_system_reserve(
key: impl Into<Self::NodeId>,
) -> Result<Self::Balance, Self::Error>
fn get_system_reserve( key: impl Into<Self::NodeId>, ) -> Result<Self::Balance, Self::Error>
Get system reserve value associated with given id.
Returns errors in cases of absence associated with given key node,
or if such functionality is forbidden for specific node type:
for example, for GasNode::ReservedLocal
.
Object Safety§
This trait is not object safe.