Function bee_tangle::traversal::visit_parents_depth_first[][src]

pub async fn visit_parents_depth_first<Fut, Match, Apply, ElseApply, MissingApply, B: StorageBackend>(
    tangle: &Tangle<B>,
    root: MessageId,
    matches: Match,
    apply: Apply,
    else_apply: ElseApply,
    missing_apply: MissingApply
) where
    Fut: Future<Output = bool>,
    Match: Fn(MessageId, MessageRef, MessageMetadata) -> Fut,
    Apply: FnMut(&MessageId, &MessageRef, &MessageMetadata),
    ElseApply: FnMut(&MessageId, &MessageRef, &MessageMetadata),
    MissingApply: FnMut(&MessageId), 
Expand description

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.