Trait Trie

Source
pub trait Trie<T: Eq + Hash + Clone> {
    // Provided methods
    fn insert_seq(node: Rc<RefCell<Node<T>>>, words: &[T], leaf: Leaf<T>) { ... }
    fn get_leaf(node: Rc<RefCell<Node<T>>>, words: &[T]) -> Leaf<T> { ... }
    fn find_node(
        node: Rc<RefCell<Node<T>>>,
        word: &T,
    ) -> (bool, Rc<RefCell<Node<T>>>) { ... }
    fn find_last_node(
        node: Rc<RefCell<Node<T>>>,
        words: &[T],
    ) -> (usize, Rc<RefCell<Node<T>>>) { ... }
    fn add_leaf(node: Rc<RefCell<Node<T>>>, leaf: Leaf<T>) -> bool { ... }
    fn add_node(
        node: Rc<RefCell<Node<T>>>,
        node_data: T,
    ) -> Rc<RefCell<Node<T>>> { ... }
}

Provided Methods§

Source

fn insert_seq(node: Rc<RefCell<Node<T>>>, words: &[T], leaf: Leaf<T>)

add node chars and leaf chars to Node.

Source

fn get_leaf(node: Rc<RefCell<Node<T>>>, words: &[T]) -> Leaf<T>

get the corresponding leaf from the char seq.

Source

fn find_node( node: Rc<RefCell<Node<T>>>, word: &T, ) -> (bool, Rc<RefCell<Node<T>>>)

get the node correspongding to char.

Source

fn find_last_node( node: Rc<RefCell<Node<T>>>, words: &[T], ) -> (usize, Rc<RefCell<Node<T>>>)

get the last node correspongding to chars.

Source

fn add_leaf(node: Rc<RefCell<Node<T>>>, leaf: Leaf<T>) -> bool

add leaf to the node

Source

fn add_node(node: Rc<RefCell<Node<T>>>, node_data: T) -> Rc<RefCell<Node<T>>>

add node to the node

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: Eq + Hash + Clone> Trie<T> for Node<T>