pub struct AuditEvent { /* private fields */ }Expand description
The app’s own event for the audit log of a panel with
Panel::audit_log: a sign-in, an export, a payment, beside what the
panel’s writes record.
AuditEvent::new("export")
.resource("orders")
.record(cx, ex)
.await?;Implementations§
Source§impl AuditEvent
impl AuditEvent
Sourcepub fn new(event: impl Into<String>) -> Self
pub fn new(event: impl Into<String>) -> Self
An event named event, on no resource: the log shows the name as it is.
Sourcepub fn resource(self, slug: impl Into<String>) -> Self
pub fn resource(self, slug: impl Into<String>) -> Self
The slug of the resource it happened to: only readers who may list that resource see it.
Source§impl AuditEvent
impl AuditEvent
Sourcepub async fn record(self, cx: &Cx, ex: &mut dyn Executor) -> Result<AuditEntry>
pub async fn record(self, cx: &Cx, ex: &mut dyn Executor) -> Result<AuditEntry>
Stores the event for the request’s panel, user and tenant through ex: the write’s
transaction inside a CommitHook or
Resource::before_commit, or the panel’s Db outside one.
§Errors
A declaration error outside every panel; an opaque infrastructure failure when the row cannot be written, the driver’s text going to the log.
Trait Implementations§
Source§impl Clone for AuditEvent
impl Clone for AuditEvent
Auto Trait Implementations§
impl Forget for AuditEvent
impl Freeze for AuditEvent
impl Move for AuditEvent
impl RefUnwindSafe for AuditEvent
impl Send for AuditEvent
impl Sync for AuditEvent
impl Unpin for AuditEvent
impl UnsafeUnpin for AuditEvent
impl UnwindSafe for AuditEvent
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