#[non_exhaustive]pub struct AuditRecord {
pub id: i64,
pub seq: i64,
pub actor: String,
pub tenant: Option<String>,
pub action: String,
pub entity: String,
pub before: Option<Value>,
pub after: Option<Value>,
pub at: Timestamp,
pub prev_hash: Vec<u8>,
pub hash: Vec<u8>,
}Expand description
One stored audit record (a row of the audit table).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: i64Database id (not hashed).
seq: i64Position in the tenant’s chain, from 1.
actor: String§tenant: Option<String>§action: String§entity: String§before: Option<Value>§after: Option<Value>§at: TimestampWhen (the database’s now() in the appending transaction).
prev_hash: Vec<u8>The previous record’s hash (GENESIS_HASH for the first).
hash: Vec<u8>sha256(prev_hash ‖ canonical(record)).
Implementations§
Source§impl AuditRecord
impl AuditRecord
Sourcepub fn canonical(&self) -> String
pub fn canonical(&self) -> String
The hashed form of the record (see the module docs), without prev_hash.
Trait Implementations§
Source§impl Clone for AuditRecord
impl Clone for AuditRecord
Source§impl Debug for AuditRecord
impl Debug for AuditRecord
Source§impl PartialEq for AuditRecord
impl PartialEq for AuditRecord
impl StructuralPartialEq for AuditRecord
Auto Trait Implementations§
impl Freeze for AuditRecord
impl RefUnwindSafe for AuditRecord
impl Send for AuditRecord
impl Sync for AuditRecord
impl Unpin for AuditRecord
impl UnsafeUnpin for AuditRecord
impl UnwindSafe for AuditRecord
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,
Source§impl<T> Equal for T
impl<T> Equal for T
Source§fn effect_equals(&self, other: &Self) -> bool
fn effect_equals(&self, other: &Self) -> bool
Returns whether
self and other are structurally equal (defaults to PartialEq::eq).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