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§
Sourcefn insert_seq(node: Rc<RefCell<Node<T>>>, words: &[T], leaf: Leaf<T>)
fn insert_seq(node: Rc<RefCell<Node<T>>>, words: &[T], leaf: Leaf<T>)
add node chars and leaf chars to Node.
Sourcefn get_leaf(node: Rc<RefCell<Node<T>>>, words: &[T]) -> Leaf<T>
fn get_leaf(node: Rc<RefCell<Node<T>>>, words: &[T]) -> Leaf<T>
get the corresponding leaf from the char seq.
Sourcefn find_node(
node: Rc<RefCell<Node<T>>>,
word: &T,
) -> (bool, Rc<RefCell<Node<T>>>)
fn find_node( node: Rc<RefCell<Node<T>>>, word: &T, ) -> (bool, Rc<RefCell<Node<T>>>)
get the node correspongding to char.
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.