pub struct AuditRecord {
pub id: [u8; 32],
pub parent: [u8; 32],
pub branch_ref: String,
pub actor_did: String,
pub role: Option<String>,
pub stated_purpose: Option<String>,
pub action: AuditAction,
pub unix: u32,
pub sealed: Vec<u8>,
}Expand description
One append-only node in the audit DAG.
id is the content-address: id == chain_hash(&parent, &canonical_bytes(self)). The sealed
field is an opaque blob (a super::sanctuary_audit::seal_to output in the real lane); the DAG
never reads it. Construct with AuditRecord::new so id is always computed consistently.
Fields§
§id: [u8; 32]Content-address of this record (chain_hash(parent, canonical_bytes)).
parent: [u8; 32]The id of the previous record on this branch, or GENESIS_PARENT for the first.
branch_ref: StringWhich branch (duress-unlock session) this record belongs to.
actor_did: StringDID of the actor as asserted by the session (unauthenticated; a duress session may lie).
role: Option<String>Optional asserted role.
stated_purpose: Option<String>Optional asserted purpose for the action.
action: AuditActionWhat happened.
unix: u32Unix seconds (u32) when the action was recorded.
sealed: Vec<u8>Opaque sealed payload — stored verbatim, never inspected by the DAG.
Implementations§
Source§impl AuditRecord
impl AuditRecord
Sourcepub fn new(
parent: [u8; 32],
branch_ref: impl Into<String>,
actor_did: impl Into<String>,
role: Option<String>,
stated_purpose: Option<String>,
action: AuditAction,
unix: u32,
sealed: Vec<u8>,
) -> Self
pub fn new( parent: [u8; 32], branch_ref: impl Into<String>, actor_did: impl Into<String>, role: Option<String>, stated_purpose: Option<String>, action: AuditAction, unix: u32, sealed: Vec<u8>, ) -> Self
Build a record and compute its content-address id from parent and the record’s content.
Sourcepub fn recomputed_id(&self) -> [u8; 32]
pub fn recomputed_id(&self) -> [u8; 32]
Recompute this record’s content-address from its own content fields. Equals id iff the
record has not been tampered with.
Trait Implementations§
Source§impl Clone for AuditRecord
impl Clone for AuditRecord
Source§fn clone(&self) -> AuditRecord
fn clone(&self) -> AuditRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AuditRecord
impl Debug for AuditRecord
Source§impl<'de> Deserialize<'de> for AuditRecord
impl<'de> Deserialize<'de> for AuditRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for AuditRecord
impl PartialEq for AuditRecord
Source§fn eq(&self, other: &AuditRecord) -> bool
fn eq(&self, other: &AuditRecord) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for AuditRecord
impl Serialize for AuditRecord
impl Eq 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§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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