Struct sozu_lib::router::pattern_trie::TrieNode
source · pub struct TrieNode<V> { /* private fields */ }
Expand description
Implementation of a trie tree structure. In Sozu this is used to store and lookup domains recursively. Each node represents a “level domain”. A leaf node (leftmost label) can be a wildcard, a regex pattern or a plain string. Leaves also store a value associated with the complete domain. For Sozu it is a list of (PathRule, MethodRule, ClusterId). See the Router strucure.
Implementations§
source§impl<V: Debug + Clone> TrieNode<V>
impl<V: Debug + Clone> TrieNode<V>
pub fn new(key: Key, value: V) -> TrieNode<V>
pub fn wildcard(key: Key, value: V) -> TrieNode<V>
pub fn root() -> TrieNode<V>
pub fn is_empty(&self) -> bool
pub fn insert(&mut self, key: Key, value: V) -> InsertResult
pub fn insert_recursive( &mut self, partial_key: &[u8], key: &Key, value: V ) -> InsertResult
pub fn remove(&mut self, key: &Key) -> RemoveResult
pub fn remove_recursive(&mut self, partial_key: &[u8]) -> RemoveResult
pub fn lookup( &self, partial_key: &[u8], accept_wildcard: bool ) -> Option<&KeyValue<Key, V>>
pub fn lookup_mut( &mut self, partial_key: &[u8], accept_wildcard: bool ) -> Option<&mut KeyValue<Key, V>>
pub fn print(&self)
pub fn print_recursive(&self, partial_key: &[u8], indent: u8)
pub fn domain_insert(&mut self, key: Key, value: V) -> InsertResult
pub fn domain_remove(&mut self, key: &Key) -> RemoveResult
pub fn domain_lookup( &self, key: &[u8], accept_wildcard: bool ) -> Option<&KeyValue<Key, V>>
pub fn domain_lookup_mut( &mut self, key: &[u8], accept_wildcard: bool ) -> Option<&mut KeyValue<Key, V>>
pub fn size(&self) -> usize
pub fn to_hashmap(&self) -> HashMap<Key, V>
pub fn to_hashmap_recursive(&self, h: &mut HashMap<Key, V>)
Trait Implementations§
Auto Trait Implementations§
impl<V> Freeze for TrieNode<V>where
V: Freeze,
impl<V> RefUnwindSafe for TrieNode<V>where
V: RefUnwindSafe,
impl<V> Send for TrieNode<V>where
V: Send,
impl<V> Sync for TrieNode<V>where
V: Sync,
impl<V> Unpin for TrieNode<V>where
V: Unpin,
impl<V> UnwindSafe for TrieNode<V>where
V: UnwindSafe,
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more