Function bee_tangle::traversal::visit_parents_depth_first [−][src]
pub async fn visit_parents_depth_first<Fut, Metadata, Match, Apply, ElseApply, MissingApply, H: Hooks<Metadata>>(
tangle: &Tangle<Metadata, H>,
root: MessageId,
matches: Match,
apply: Apply,
else_apply: ElseApply,
missing_apply: MissingApply
) where
Fut: Future<Output = bool>,
Metadata: Clone + Copy,
Match: Fn(MessageId, MessageRef, Metadata) -> Fut,
Apply: FnMut(&MessageId, &MessageRef, &Metadata),
ElseApply: FnMut(&MessageId, &MessageRef, &Metadata),
MissingApply: FnMut(&MessageId),
A Tangle walker that - given a starting vertex - visits all of its ancestors that are connected through either the parent1 or the parent2 edge. The walk continues as long as the visited vertices match a certain condition. For each visited vertex customized logic can be applied depending on the availability of the vertex. Each traversed vertex provides read access to its associated data and metadata.