pub struct SafetyEventLog { /* private fields */ }Expand description
Append-only, plaintext, hash-linked safety event ledger. Reuses the black-box
chain semantics ([entry_hash], genesis_prev_hash) so the two logs verify
the same way, but entries are plaintext: a safety record is meant to be read
and trusted by third parties.
Implementations§
Source§impl SafetyEventLog
impl SafetyEventLog
Sourcepub fn new(genesis_prev_hash_override: Option<&str>) -> Self
pub fn new(genesis_prev_hash_override: Option<&str>) -> Self
Build a log. A None genesis uses genesis_prev_hash.
Sourcepub fn append(
&mut self,
event_type: &str,
severity: &str,
details: Option<&Value>,
actor: Option<&str>,
timestamp: &str,
) -> Result<Value>
pub fn append( &mut self, event_type: &str, severity: &str, details: Option<&Value>, actor: Option<&str>, timestamp: &str, ) -> Result<Value>
Append one safety event, link it to the chain head, and return the entry.
pub fn head(&self) -> &str
pub fn genesis(&self) -> &str
pub fn entries(&self) -> &[Value]
Auto Trait Implementations§
impl Forget for SafetyEventLog
impl Freeze for SafetyEventLog
impl RefUnwindSafe for SafetyEventLog
impl Send for SafetyEventLog
impl Sync for SafetyEventLog
impl Unpin for SafetyEventLog
impl UnsafeUnpin for SafetyEventLog
impl UnwindSafe for SafetyEventLog
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