pub struct AuditLog { /* private fields */ }Expand description
Transactional audit log backed by the slabs_audit_log system table.
Implementations§
Source§impl AuditLog
impl AuditLog
Sourcepub async fn record_in_tx(
&self,
tx: &mut Transaction<'_, Sqlite>,
actor_id: Option<&str>,
action: &str,
target_type: &str,
target_id: &str,
metadata: &Value,
) -> SlabResult<String>
pub async fn record_in_tx( &self, tx: &mut Transaction<'_, Sqlite>, actor_id: Option<&str>, action: &str, target_type: &str, target_id: &str, metadata: &Value, ) -> SlabResult<String>
Inserts an audit entry inside an open SQLite transaction so it commits or rolls back atomically.
Returns the generated aud_<ulid> identifier.
Sourcepub async fn list_for_target(
&self,
target_type: &str,
target_id: &str,
limit: i64,
) -> SlabResult<Vec<AuditEntry>>
pub async fn list_for_target( &self, target_type: &str, target_id: &str, limit: i64, ) -> SlabResult<Vec<AuditEntry>>
Lists up to limit (clamped to 1..=500) most recent audit entries for a specific
(target_type, target_id) on the read pool.
Sourcepub async fn list_recent(&self, limit: i64) -> SlabResult<Vec<AuditEntry>>
pub async fn list_recent(&self, limit: i64) -> SlabResult<Vec<AuditEntry>>
Lists up to limit (clamped to 1..=500) most recent audit entries across all targets
on the read pool.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AuditLog
impl !UnwindSafe for AuditLog
impl Forget for AuditLog
impl Freeze for AuditLog
impl Move for AuditLog
impl Send for AuditLog
impl Sync for AuditLog
impl Unpin for AuditLog
impl UnsafeUnpin for AuditLogwhere
*const ArcInner<PoolInner<Sqlite>> is !null: UnsafeUnpin,
PhantomData<ArcInner<PoolInner<Sqlite>>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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