pub struct SessionIndex { /* private fields */ }Expand description
Maps each session_id to a sorted list of node IDs in that session.
Implementations§
Source§impl SessionIndex
impl SessionIndex
Sourcepub fn get_session(&self, session_id: u32) -> &[u64]
pub fn get_session(&self, session_id: u32) -> &[u64]
Get all node IDs from a specific session.
Sourcepub fn get_sessions(&self, session_ids: &[u32]) -> Vec<u64>
pub fn get_sessions(&self, session_ids: &[u32]) -> Vec<u64>
Get all node IDs from multiple sessions, merged and sorted.
Sourcepub fn session_ids(&self) -> Vec<u32>
pub fn session_ids(&self) -> Vec<u32>
Get all known session IDs.
Sourcepub fn session_count(&self) -> usize
pub fn session_count(&self) -> usize
Count sessions.
Sourcepub fn node_count(&self, session_id: u32) -> usize
pub fn node_count(&self, session_id: u32) -> usize
Count nodes in a session.
Sourcepub fn rebuild(&mut self, nodes: &[CognitiveEvent])
pub fn rebuild(&mut self, nodes: &[CognitiveEvent])
Rebuild the entire index from a slice of nodes.
Sourcepub fn add_node(&mut self, event: &CognitiveEvent)
pub fn add_node(&mut self, event: &CognitiveEvent)
Incrementally add a new node.
Sourcepub fn remove_node(&mut self, id: u64, session_id: u32)
pub fn remove_node(&mut self, id: u64, session_id: u32)
Remove a node from the index.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SessionIndex
impl RefUnwindSafe for SessionIndex
impl Send for SessionIndex
impl Sync for SessionIndex
impl Unpin for SessionIndex
impl UnsafeUnpin for SessionIndex
impl UnwindSafe for SessionIndex
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