pub trait BaseNode {
// Required methods
fn is_dead(&self) -> bool;
fn children_mut(&mut self) -> &mut HashMap<u64, Box<Self>>
where Self: Sized;
fn children(&self) -> &HashMap<u64, Box<Self>>
where Self: Sized;
fn host_string(&self) -> Option<String>;
// Provided methods
fn prune(&mut self) -> usize
where Self: Sized { ... }
fn clear(&mut self) -> Vec<String>
where Self: Sized { ... }
fn all_hosts(&self) -> HashSet<String>
where Self: Sized { ... }
}Expand description
Trait for nodes that can be pruned (base node for radix trees).
Required Methods§
Sourcefn children_mut(&mut self) -> &mut HashMap<u64, Box<Self>>where
Self: Sized,
fn children_mut(&mut self) -> &mut HashMap<u64, Box<Self>>where
Self: Sized,
Returns mutable reference to children as a trait object
Sourcefn children(&self) -> &HashMap<u64, Box<Self>>where
Self: Sized,
fn children(&self) -> &HashMap<u64, Box<Self>>where
Self: Sized,
Returns immutable reference to children
Sourcefn host_string(&self) -> Option<String>
fn host_string(&self) -> Option<String>
Returns the host as a string if present
Provided Methods§
Sourcefn prune(&mut self) -> usizewhere
Self: Sized,
fn prune(&mut self) -> usizewhere
Self: Sized,
Prune dead child nodes recursively, returns number pruned