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§


fn node_already_exists() -> Self

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


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.


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.


fn node_not_found() -> Self

Value node doesn’t exist for a key.


fn node_was_consumed() -> Self

Procedure can’t be called on consumed node.


fn insufficient_balance() -> Self

Account doesn’t have enough funds to complete operation.


fn forbidden() -> Self

Forbidden operation for the value node.


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.


fn unexpected_node_type() -> Self

Node type that can’t occur if algorithm work well


fn value_is_not_caught() -> Self

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


fn value_is_blocked() -> Self

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


fn value_is_not_blocked() -> Self

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


fn consumed_with_lock() -> Self

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


fn consumed_with_system_reservation() -> Self

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


fn total_value_is_overflowed() -> Self

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


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.