Skip to main content

resolve_loopback_edges

Function resolve_loopback_edges 

Source
fn resolve_loopback_edges(
    inner: &InnerGraph,
    me_idx: NodeIndex,
    path_bytes: &[u8],
) -> Option<Vec<EdgeIndex>>
Expand description

Resolves a loopback path from serialized node-index bytes into a validated chain of edge indices.

The path_bytes encode a PathId where each u64 is a NodeIndex. The path is expected to start and end at me_idx (a closed loop).

Walks consecutive node pairs, finding the connecting edge for each. Stops when the loop closes back to me_idx or when no edge exists between a pair. Returns None if the path bytes have wrong length, the first node is not me_idx, or fewer than 2 edges can be resolved.