pub fn new_with(
        root: ReorgNode<K, M>,
        allowed_depth: u64,
        value_based: bool,
    ) -> Organizer<K, M> {
        let mut nodes_by_height = HashMap::new();
        nodes_by_height.insert(root.height, vec![root.key]);
        Self {
            height: root.height,
            root,
            nodes_by_key: HashMap::new(),
            nodes_by_height,
            buffer: HashMap::new(),
            allowed_depth,
            value_based,
        }
    }
/// Constructor function that takes the first root node - possibly the genesis node -
/// and the depth we want to allow reorganization to. Stores the root node in its slot,
/// as well as by height. Root is not stored by key, only by height.
/// Examples
/// ```
/// use abandoning_reorg::Organizer;
/// use abandoning_reorg::ReorgNode;
///
/// let initial_node = ReorgNode::default();
/// Organizer::<[u8; 32], ()>::new_with(initial_node, 777);
/// ```
Constructor function that takes the first root node - possibly the genesis node
and the depth we want to allow reorganization to. Stores the root node in its slot,
as well as by height. Root is not stored by key, only by height.


Constructor function that takes the first root node - possibly the genesis node and the depth we want to allow reorganization to . Stores the root node in its slot as well as by height . Root is not stored by key only by height .
pub fn new_with(
        root: ReorgNode<K, M>,
        allowed_depth: u64,
        value_based: bool,
    ) -> Organizer<K, M> {
        let mut nodes_by_height = HashMap::new();
        nodes_by_height.insert(root.height, vec![root.key]);
        Self {
            height: root.height,
            root,
            nodes_by_key: HashMap::new(),
            nodes_by_height,
            buffer: HashMap::new(),
            allowed_depth,
            value_based,
        }
    }
pub fn new_with ( root : ReorgNode < K , M > , allowed_depth : u64 , value_based : bool , ) -> Organizer < K , M > { let mut nodes_by_height = HashMap :: new ( ) ; nodes_by_height . insert ( root . height , vec ! [ root key ] ) ; Self { height : root . height , root , nodes_by_key : HashMap :: new ( ) , nodes_by_height , buffer : HashMap :: new ( ) , allowed_depth , value_based , } }
Constructor function that takes the first root node - possibly the genesis node
and the depth we want to allow reorganization to.
Constructor function that takes the first root node - possibly the genesis node and the depth we want to allow reorganization to .
root
ReorgNode<K, M>
allowed_depth
u64
value_based
bool
root
ReorgNode<K, M>
allowed_depth
u64
value_based
bool