Skip to main content

find_offset

Function find_offset 

Source
pub fn find_offset(
    graph: &mut GenGraph,
    anchor: &GraphNodePosition,
    distance: i64,
    expand: impl FnMut(&mut GenGraph, HashId) -> bool,
) -> Result<Vec<GraphNodePosition>, GraphError>
Expand description

From a given position in a graph, find positions a given number of characters away. An expand function can be given that specifies how to expand the input graph when it is exhausted. By default, this function searches along the known graph, and if a matching position cannot be found it will expand until it is not possible to grow the graph anymore. Returns a Result<Vec>, given a list of matching GraphNodePositions at the requested distance.