pub struct ChainVerification {
pub checked: usize,
pub tampered_events: usize,
pub linkage_breaks: usize,
pub unknown_schema: usize,
pub breaks: Vec<ChainBreak>,
}Expand description
Result of verifying the integrity of an enforcement event chain.
Verification is a READ-SIDE check over already-recorded events: it never
mutates the store and performs no network I/O. It is the inverse of the
write-time hash contract — it recomputes each event’s hash AND re-checks the
prev_hash linkage, so it detects both:
- content tampering — an event whose body was altered after recording
while its stored
event_hashwas left untouched (a linkage-only check misses this, because the stored hashes still chain together); and - linkage breaks — a deleted, inserted, or re-pointed event, where one
event’s
prev_hashno longer matches its predecessor’sevent_hash.
A full from-genesis rewrite (every hash recomputed consistently) is not detectable here by design — that is the inherent limit of a local, externally-unanchored chain, and is addressed at the custody layer, not here.
Fields§
§checked: usizeEvents whose hash was recomputed and compared (excludes unknown-schema).
tampered_events: usizeEvents whose stored event_hash does not match a fresh compute_hash()
— i.e. the content was altered after recording.
linkage_breaks: usizeAdjacent events where prev_hash does not match the predecessor’s
event_hash. The earliest surviving event is never counted, so a
legitimately retention-pruned prefix is not a break.
unknown_schema: usizeEvents with a schema_version newer than this binary understands. Their
canonical form cannot be reproduced, so they are reported, not verified.
breaks: Vec<ChainBreak>Every located break, in seq order. Empty when the chain is intact.
Implementations§
Trait Implementations§
Source§impl Clone for ChainVerification
impl Clone for ChainVerification
Source§fn clone(&self) -> ChainVerification
fn clone(&self) -> ChainVerification
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 ChainVerification
impl Debug for ChainVerification
Source§impl Default for ChainVerification
impl Default for ChainVerification
Source§fn default() -> ChainVerification
fn default() -> ChainVerification
Source§impl<'de> Deserialize<'de> for ChainVerification
impl<'de> Deserialize<'de> for ChainVerification
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>,
impl Eq for ChainVerification
Source§impl PartialEq for ChainVerification
impl PartialEq for ChainVerification
Source§fn eq(&self, other: &ChainVerification) -> bool
fn eq(&self, other: &ChainVerification) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ChainVerification
impl Serialize for ChainVerification
impl StructuralPartialEq for ChainVerification
Auto Trait Implementations§
impl Freeze for ChainVerification
impl RefUnwindSafe for ChainVerification
impl Send for ChainVerification
impl Sync for ChainVerification
impl Unpin for ChainVerification
impl UnsafeUnpin for ChainVerification
impl UnwindSafe for ChainVerification
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> Fruit for T
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>
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