pub struct NameTrie { /* private fields */ }Expand description
A trie over the /-separated segments of Mangle name constants.
Implementations§
Source§impl NameTrie
impl NameTrie
pub fn new() -> Self
Sourcepub fn prefix_name(&self, name: &str) -> String
pub fn prefix_name(&self, name: &str) -> String
Finds the longest prefix of name that exists in the trie.
Returns the prefix as a name string, or /name if no prefix found.
Example: if trie contains /animal and /animal/dog, and we look up
/animal/dog/poodle, returns /animal/dog.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NameTrie
impl RefUnwindSafe for NameTrie
impl Send for NameTrie
impl Sync for NameTrie
impl Unpin for NameTrie
impl UnsafeUnpin for NameTrie
impl UnwindSafe for NameTrie
Blanket Implementations§
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