pub fn fs_resolve_name<G>(
graph: &G,
dir: NodeId,
name: impl AsRef<[u8]>,
) -> Result<Option<NodeId>>where
G: SwhLabeledForwardGraph + SwhGraphWithProperties,
<G as SwhGraphWithProperties>::LabelNames: LabelNames,
<G as SwhGraphWithProperties>::Maps: Maps,
Expand description
Given a graph and a directory node, return the node id of a named directory entry located (not recursively) in that directory, if it exists.
See fs_resolve_path for a version of this function that traverses sub-directories recursively.
ⓘ
if let Ok(Some(node)) == fs_resolve_name(&graph, 42, "README.md") {
// do something with node
}