pub struct Index { /* private fields */ }Expand description
Implementations§
source§impl Index
impl Index
sourcepub fn add_observer(
&mut self,
t: &mut Activation,
pat: &Pattern,
observer: &Arc<Cap>
)
pub fn add_observer( &mut self, t: &mut Activation, pat: &Pattern, observer: &Arc<Cap> )
Adds a new observer. If any existing assertions in the index
match pat, establishes corresponding assertions at
observer. Once the observer is registered, subsequent
arriving assertions will be matched against pat and
delivered to observer if they match.
sourcepub fn remove_observer(
&mut self,
t: &mut Activation,
pat: Pattern,
observer: &Arc<Cap>
)
pub fn remove_observer( &mut self, t: &mut Activation, pat: Pattern, observer: &Arc<Cap> )
Removes an existing observer.
sourcepub fn insert(&mut self, t: &mut Activation, outer_value: &AnyValue) -> bool
pub fn insert(&mut self, t: &mut Activation, outer_value: &AnyValue) -> bool
Inserts an assertion into the index, notifying matching observers.
Answers true iff the assertion was new to the dataspace.
sourcepub fn remove(&mut self, t: &mut Activation, outer_value: &AnyValue) -> bool
pub fn remove(&mut self, t: &mut Activation, outer_value: &AnyValue) -> bool
Removes an assertion from the index, notifying matching observers.
Answers true if it is the last in its equivalence class to be removed.
sourcepub fn send(&mut self, t: &mut Activation, outer_value: &AnyValue)
pub fn send(&mut self, t: &mut Activation, outer_value: &AnyValue)
Routes a message using the index, notifying matching observers.
sourcepub fn assertion_count(&self) -> usize
pub fn assertion_count(&self) -> usize
Retrieves the current count of distinct assertions in the index.
sourcepub fn endpoint_count(&self) -> isize
pub fn endpoint_count(&self) -> isize
Retrieves the current count of assertions in the index, including duplicates.
sourcepub fn observer_count(&self) -> usize
pub fn observer_count(&self) -> usize
Retrieves the current count of observers of the index.