pub trait TreeDiff<'a> {
    type TreeKey: 'a + Hash + PartialEq + Eq + Copy;
    type ChildIter: Iterator<Item = &'a Self::TreeKey>;

    // Required methods
    fn children(&self, key: &Self::TreeKey) -> Option<Self::ChildIter>;
    fn contains_slot(&self, slot: &Self::TreeKey) -> bool;

    // Provided method
    fn subtree_diff(
        &self,
        root1: Self::TreeKey,
        root2: Self::TreeKey
    ) -> HashSet<Self::TreeKey> { ... }
}

Required Associated Types§

source

type TreeKey: 'a + Hash + PartialEq + Eq + Copy

source

type ChildIter: Iterator<Item = &'a Self::TreeKey>

Required Methods§

source

fn children(&self, key: &Self::TreeKey) -> Option<Self::ChildIter>

source

fn contains_slot(&self, slot: &Self::TreeKey) -> bool

Provided Methods§

source

fn subtree_diff( &self, root1: Self::TreeKey, root2: Self::TreeKey ) -> HashSet<Self::TreeKey>

Implementors§

source§

impl<'a> TreeDiff<'a> for &'a HeaviestSubtreeForkChoice

§

type TreeKey = (u64, Hash)

§

type ChildIter = Iter<'a, (u64, Hash)>