pub enum TreeErrorType<Ix = DefaultIndexType> {
    InvalidNodeIndex {
        node: NodeIndex<Ix>,
    },
    ExpectedRootNode {
        node: NodeIndex<Ix>,
    },
    ExpectedNonAncestorNode {
        new_ancestor: NodeIndex<Ix>,
        new_descendant: NodeIndex<Ix>,
    },
    OtherError {
        msg: String,
    },
}
Expand description

Enum to refer to error situations that commonly occur in forest operations.

Variants

InvalidNodeIndex

Fields

node: NodeIndex<Ix>

The node index that was passed to the operation.

A node index was passed to an operation but did not refer to a valid node.

ExpectedRootNode

Fields

node: NodeIndex<Ix>

The node index that was passed to operation.

An operation is only defined for root nodes, but an invalid node index or a node index referring to a non-tree node was passed to the operation.

ExpectedNonAncestorNode

Fields

new_ancestor: NodeIndex<Ix>

The node that was passed to the operation as the new ancestor

new_descendant: NodeIndex<Ix>

The node that was passed to the operation as the new descendant

An operation is only defined for forest nodes that are not part of the same forest tree, but the nodes passed to this operation are already in a ancestor/descendant relation.

OtherError

Fields

msg: String

Description of the particular error situation.

Summary error type, which can be used in other error situations which do not have a direct relation to defined operations of a forest.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.