pub struct ChainedEvent {
pub chain_hash: [u8; 32],
pub event_bytes: Vec<u8>,
pub prev_hash: [u8; 32],
}Expand description
A single event in a tamper-evident hash chain.
Each event records the hash of the previous event (or a sentinel for the first event) so that any tampering with a stored event is detectable by recomputing the chain.
Fields§
§chain_hash: [u8; 32]SHA-256 of the preceding event’s hash + this event’s bytes.
For the first event in a chain, this is SHA-256(event_bytes).
event_bytes: Vec<u8>The raw event payload (JSON, binary, etc.) — content is opaque.
prev_hash: [u8; 32]Hash of the previous event’s chain_hash, or [0u8; 32] for first.
Trait Implementations§
Source§impl Clone for ChainedEvent
impl Clone for ChainedEvent
Source§fn clone(&self) -> ChainedEvent
fn clone(&self) -> ChainedEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ChainedEvent
impl RefUnwindSafe for ChainedEvent
impl Send for ChainedEvent
impl Sync for ChainedEvent
impl Unpin for ChainedEvent
impl UnsafeUnpin for ChainedEvent
impl UnwindSafe for ChainedEvent
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