pub struct Entry { /* private fields */ }Expand description
One entry being written.
Built with the chained setters below so a call site reads as a sentence and so adding a field later does not touch every caller.
Implementations§
Source§impl Entry
impl Entry
pub fn new(action: &str) -> Self
Sourcepub fn by(self, actor_id: Uuid) -> Self
pub fn by(self, actor_id: Uuid) -> Self
The person who acted. Absent for the server acting on its own.
Sourcepub fn by_email(self, email: impl Into<String>) -> Self
pub fn by_email(self, email: impl Into<String>) -> Self
The actor’s email, kept as text so an entry stays readable after a rename or a deletion.
pub fn on(self, target_id: Uuid) -> Self
Sourcepub fn labelled(self, label: impl Into<String>) -> Self
pub fn labelled(self, label: impl Into<String>) -> Self
A human label for the target - an email, a department name.
Sourcepub fn with(self, details: Value) -> Self
pub fn with(self, details: Value) -> Self
Extra context. Never credentials: this is read in an admin UI and pasted into support tickets.
Sourcepub async fn record(self, pool: &PgPool)
pub async fn record(self, pool: &PgPool)
Writes the entry, or complains loudly and carries on.
The action being recorded has already happened. Failing the request because its audit entry did not write would undo nothing - the token is already revoked - and would turn a full disk into an outage.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Entry
impl RefUnwindSafe for Entry
impl Send for Entry
impl Sync for Entry
impl Unpin for Entry
impl UnsafeUnpin for Entry
impl UnwindSafe for Entry
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<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