pub struct EventIndex { /* private fields */ }Expand description
High-performance concurrent index for fast event lookups
Implementations§
Source§impl EventIndex
impl EventIndex
pub fn new() -> Self
Sourcepub fn index_event(
&self,
event_id: Uuid,
entity_id: &str,
event_type: &str,
timestamp: DateTime<Utc>,
offset: usize,
) -> Result<()>
pub fn index_event( &self, event_id: Uuid, entity_id: &str, event_type: &str, timestamp: DateTime<Utc>, offset: usize, ) -> Result<()>
Add an event to all relevant indices
Sourcepub fn get_by_entity(&self, entity_id: &str) -> Option<Vec<IndexEntry>>
pub fn get_by_entity(&self, entity_id: &str) -> Option<Vec<IndexEntry>>
Get all event offsets for an entity
Sourcepub fn get_by_type(&self, event_type: &str) -> Option<Vec<IndexEntry>>
pub fn get_by_type(&self, event_type: &str) -> Option<Vec<IndexEntry>>
Get all event offsets for an event type
Sourcepub fn get_all_entities(&self) -> Vec<String>
pub fn get_all_entities(&self) -> Vec<String>
Get all entities being tracked
Sourcepub fn get_all_types(&self) -> Vec<String>
pub fn get_all_types(&self) -> Vec<String>
Get all event types
Sourcepub fn stats(&self) -> IndexStats
pub fn stats(&self) -> IndexStats
Get statistics
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for EventIndex
impl !RefUnwindSafe for EventIndex
impl Send for EventIndex
impl Sync for EventIndex
impl Unpin for EventIndex
impl !UnwindSafe for EventIndex
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more