pub struct InterestMap { /* private fields */ }Expand description
Interest map - tracks who is interested in what
Implementations§
Source§impl InterestMap
impl InterestMap
Sourcepub fn register(&mut self, decl: InterestDeclaration)
pub fn register(&mut self, decl: InterestDeclaration)
Register interest
Sourcepub fn unregister(&mut self, node: NodeId, state_id: u64)
pub fn unregister(&mut self, node: NodeId, state_id: u64)
Unregister interest
Sourcepub fn interested_nodes(&self, state_id: u64) -> Vec<(NodeId, InterestLevel)>
pub fn interested_nodes(&self, state_id: u64) -> Vec<(NodeId, InterestLevel)>
Get all nodes interested in a state
Sourcepub fn nodes_with_interest(
&self,
state_id: u64,
min_level: InterestLevel,
) -> Vec<NodeId>
pub fn nodes_with_interest( &self, state_id: u64, min_level: InterestLevel, ) -> Vec<NodeId>
Get nodes with at least a certain interest level
Sourcepub fn node_states(&self, node: NodeId) -> Vec<u64>
pub fn node_states(&self, node: NodeId) -> Vec<u64>
Get all states a node is interested in
Sourcepub fn get_interest(&self, node: NodeId, state_id: u64) -> InterestLevel
pub fn get_interest(&self, node: NodeId, state_id: u64) -> InterestLevel
Get interest level for a specific node and state
Sourcepub fn interest_count(&self, state_id: u64) -> usize
pub fn interest_count(&self, state_id: u64) -> usize
Count interested nodes for a state
Sourcepub fn remove_node(&mut self, node: NodeId)
pub fn remove_node(&mut self, node: NodeId)
Remove a node entirely (they disconnected)
Trait Implementations§
Source§impl Clone for InterestMap
impl Clone for InterestMap
Source§fn clone(&self) -> InterestMap
fn clone(&self) -> InterestMap
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 moreSource§impl Debug for InterestMap
impl Debug for InterestMap
Source§impl Default for InterestMap
impl Default for InterestMap
Source§fn default() -> InterestMap
fn default() -> InterestMap
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for InterestMap
impl RefUnwindSafe for InterestMap
impl Send for InterestMap
impl Sync for InterestMap
impl Unpin for InterestMap
impl UnsafeUnpin for InterestMap
impl UnwindSafe for InterestMap
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