Trait gear_common::gas_provider::Error

source ·
pub trait Error {
Show 16 methods // Required methods fn node_already_exists() -> Self; fn parent_is_lost() -> Self; fn parent_has_no_children() -> Self; fn node_not_found() -> Self; fn node_was_consumed() -> Self; fn insufficient_balance() -> Self; fn forbidden() -> Self; fn unexpected_consume_output() -> Self; fn unexpected_node_type() -> Self; fn value_is_not_caught() -> Self; fn value_is_blocked() -> Self; fn value_is_not_blocked() -> Self; fn consumed_with_lock() -> Self; fn consumed_with_system_reservation() -> Self; fn total_value_is_overflowed() -> Self; fn total_value_is_underflowed() -> Self;
}
Expand description

Errors stating that gas tree has been invalidated.

Contains constructors for all existing errors.

Required Methods§

source

fn node_already_exists() -> Self

Gas (gas tree) has already been created for the provided key.

source

fn parent_is_lost() -> Self

Parent must be in the tree, but not found.

This differs from node_not_found, because parent node for local node types must be found, but was not. Thus, tree is invalidated.

source

fn parent_has_no_children() -> Self

Parent node must have children, but they weren’t found.

If node is a parent to some other node it must have at least one child, otherwise it’s id can’t be used as a parent for local nodes in the tree.

source

fn node_not_found() -> Self

Value node doesn’t exist for a key.

source

fn node_was_consumed() -> Self

Procedure can’t be called on consumed node.

source

fn insufficient_balance() -> Self

Account doesn’t have enough funds to complete operation.

source

fn forbidden() -> Self

Forbidden operation for the value node.

source

fn unexpected_consume_output() -> Self

Output of Tree::consume procedure that wasn’t expected.

Outputs of consumption procedure are determined. The error is returned when unexpected one occurred. That signals, that algorithm works wrong and expected invariants are not correct.

source

fn unexpected_node_type() -> Self

Node type that can’t occur if algorithm work well

source

fn value_is_not_caught() -> Self

Value must have been caught, but was missed or blocked (see TreeImpl::catch_value for details).

source

fn value_is_blocked() -> Self

Value must have been caught or moved upstream, but was blocked (see TreeImpl::catch_value for details).

source

fn value_is_not_blocked() -> Self

Value must have been blocked, but was either moved or caught (see TreeImpl::catch_value for details).

source

fn consumed_with_lock() -> Self

GasTree::consume called on node, which has some balance locked.

source

fn consumed_with_system_reservation() -> Self

GasTree::consume called on node, which has some system reservation.

source

fn total_value_is_overflowed() -> Self

GasTree::create called with some value amount leading to the total value overflow.

source

fn total_value_is_underflowed() -> Self

Either GasTree::consume or GasTree::spent called on a node creating negative imbalance which leads to the total value drop below 0.

Object Safety§

This trait is not object safe.

Implementors§