consistent_hasher 0.1.5

An implementation of consistent hashing, a technique commonly used in distributed systems to map keys (such as data items or requests) to nodes (e.g., servers or storage units) in a way that minimizes disruptions when nodes are added or removed.
Documentation
use std::{rc::Rc,cell::RefCell};
use std::fmt;
#[derive(Debug)]
pub (crate)struct Node<T> {
    pub (crate) key:    T,
    pub (crate) left:   Option<Rc<RefCell<Node<T>>>>,
    pub (crate) right:  Option<Rc<RefCell<Node<T>>>>,
}

impl<T> Node<T> {
    pub (crate) fn new(key: T) -> Self {
        Self { key,  left: None, right: None }
    }
    pub (crate) fn create(key: T,vec: Vec<T>) -> Self {
        Self { key,  left: None, right: None }
    }
    
}


impl<T:fmt::Display + fmt::Debug> fmt::Display for Node<T> {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "key: {}",self.key)
    }
}
impl<T:fmt::Display + fmt::Debug> Node<T>
{
    pub (crate) fn print_node(&self)
    {
        println!("{}",self);
    }
}