pub struct NodeFeatureIndex { /* private fields */ }Expand description
Inverted feature index over active nodes for efficient characteristic-based routing.
Implementations§
Source§impl NodeFeatureIndex
impl NodeFeatureIndex
pub fn new() -> NodeFeatureIndex
pub fn get(&self, node_id: &str) -> Option<&NodeMetadata>
pub fn count(&self) -> usize
Sourcepub fn register_or_update(&mut self, node: NodeMetadata)
pub fn register_or_update(&mut self, node: NodeMetadata)
Register or update a node, modifying only the affected inverted index entries.
Sourcepub fn remove(&mut self, node_id: &str) -> Option<NodeMetadata>
pub fn remove(&mut self, node_id: &str) -> Option<NodeMetadata>
Remove a node from all feature indexes.
Sourcepub fn query(&self, selector: &TargetSelector) -> BTreeSet<String>
pub fn query(&self, selector: &TargetSelector) -> BTreeSet<String>
Match nodes matching the selector by intersecting/unioning index sets.
Trait Implementations§
Source§impl Clone for NodeFeatureIndex
impl Clone for NodeFeatureIndex
Source§fn clone(&self) -> NodeFeatureIndex
fn clone(&self) -> NodeFeatureIndex
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NodeFeatureIndex
impl Debug for NodeFeatureIndex
Source§impl Default for NodeFeatureIndex
impl Default for NodeFeatureIndex
Source§fn default() -> NodeFeatureIndex
fn default() -> NodeFeatureIndex
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Forget for NodeFeatureIndex
impl Freeze for NodeFeatureIndex
impl Move for NodeFeatureIndex
impl RefUnwindSafe for NodeFeatureIndex
impl Send for NodeFeatureIndex
impl Sync for NodeFeatureIndex
impl Unpin for NodeFeatureIndex
impl UnsafeUnpin for NodeFeatureIndex
impl UnwindSafe for NodeFeatureIndex
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