cargo::ops::tree::graph

Function add_feature

source
fn add_feature(
    graph: &mut Graph<'_>,
    name: InternedString,
    from: Option<usize>,
    to: usize,
    kind: EdgeKind,
) -> (bool, usize)
Expand description

Adds a feature node between two nodes.

That is, it adds the following:

from -Edge-> featname -Edge::Feature-> to

Returns a tuple (missing, index). missing is true if this feature edge was already added. index is the index of the index in the graph of the Feature node.