pub struct DnsRadixTree {
pub root: DnsNode,
pub scope_mode: ScopeMode,
}Fields§
§root: DnsNode§scope_mode: ScopeModeImplementations§
Source§impl DnsRadixTree
impl DnsRadixTree
pub fn new(scope_mode: ScopeMode) -> Self
Sourcepub fn insert(&mut self, hostname: &str) -> Option<String>
pub fn insert(&mut self, hostname: &str) -> Option<String>
Insert a hostname into the tree, storing parts in reverse order for hierarchy. Returns the canonicalized hostname after insertion, or None if already exists in ACL mode.
Sourcepub fn get(&self, hostname: &str) -> Option<String>
pub fn get(&self, hostname: &str) -> Option<String>
Find the most specific matching entry for a given hostname. If strict_scope is true, only exact matches are allowed. Returns the canonicalized hostname if found.
Sourcepub fn delete(&mut self, hostname: &str) -> bool
pub fn delete(&mut self, hostname: &str) -> bool
Delete a hostname from the tree. Returns true if the hostname was found and deleted.
pub fn prune(&mut self) -> usize
Trait Implementations§
Source§impl Clone for DnsRadixTree
impl Clone for DnsRadixTree
Source§fn clone(&self) -> DnsRadixTree
fn clone(&self) -> DnsRadixTree
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DnsRadixTree
impl RefUnwindSafe for DnsRadixTree
impl Send for DnsRadixTree
impl Sync for DnsRadixTree
impl Unpin for DnsRadixTree
impl UnwindSafe for DnsRadixTree
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