pub struct EventLog { /* private fields */ }Implementations§
Source§impl EventLog
impl EventLog
pub fn new(pool: SqlitePool) -> Self
Sourcepub async fn append(&self, event: &mut EventRecord) -> KernelResult<()>
pub async fn append(&self, event: &mut EventRecord) -> KernelResult<()>
Appends an event, assigning a monotonic log_index and computing event_hash in place. Wraps in an internal transaction for atomicity.
pub async fn append_in_tx( &self, tx: &mut Transaction<'_, Sqlite>, event: &mut EventRecord, ) -> KernelResult<()>
pub async fn list_recent(&self, limit: i64) -> KernelResult<Vec<EventRecord>>
Sourcepub async fn list_by_actor(
&self,
actor_id: &str,
limit: i64,
) -> KernelResult<Vec<EventRecord>>
pub async fn list_by_actor( &self, actor_id: &str, limit: i64, ) -> KernelResult<Vec<EventRecord>>
List events filtered by actor_id, ordered by log_index descending.
Sourcepub async fn query(
&self,
actor_id: Option<&str>,
before_index: Option<i64>,
after_index: Option<i64>,
limit: i64,
) -> KernelResult<Vec<EventRecord>>
pub async fn query( &self, actor_id: Option<&str>, before_index: Option<i64>, after_index: Option<i64>, limit: i64, ) -> KernelResult<Vec<EventRecord>>
General-purpose event query with composable filters.
All filter fields are optional and combined with AND logic:
actor_id: restrict to a specific actorbefore_index: only events with log_index < value (for backward pagination)after_index: only events with log_index > value (for forward pagination)limit: max results (clamped by caller; this method does not clamp)
Returns events ordered by log_index descending (newest first).
pub async fn count(&self) -> KernelResult<i64>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EventLog
impl !RefUnwindSafe for EventLog
impl Send for EventLog
impl Sync for EventLog
impl Unpin for EventLog
impl UnsafeUnpin for EventLog
impl !UnwindSafe for EventLog
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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