Struct librualg::trie::Trie[][src]

pub struct Trie { /* fields omitted */ }

Trie or prefix tree

 use librualg::trie::Trie;

 let mut trie = Trie::new();
 trie.insert("abab");
 trie.insert("abcc");
 trie.insert("ddvbn");

 assert_eq!(trie.contains("abab"), true);
 assert_eq!(trie.contains("ababa"), false);
 assert_eq!(trie.contains("abcc"), true);
 assert_eq!(trie.contains("abc"), false);

Implementations

impl Trie[src]

pub fn new() -> Self[src]

pub fn insert(&mut self, s: &str)[src]

pub fn contains(&self, p: &str) -> bool[src]

pub fn remove(&mut self, p: &str)[src]

Trait Implementations

impl Default for Trie[src]

Auto Trait Implementations

impl RefUnwindSafe for Trie

impl Send for Trie

impl Sync for Trie

impl Unpin for Trie

impl UnwindSafe for Trie

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.