Skip to main content

JournalChainVerifier

Struct JournalChainVerifier 

Source
pub struct JournalChainVerifier { /* private fields */ }
Expand description

Streaming verifier for a complete journal or a suffix after a trusted head.

Each accepted event must be individually self-validating, in the same scope, exactly one sequence after the current head, chained to its digest, and no earlier in durable time. Rejection leaves the verifier unchanged.

Implementations§

Source§

impl JournalChainVerifier

Source

pub const fn new() -> Self

Constructs a verifier expecting the first event.

Source

pub const fn after(head: JournalHead) -> Self

Constructs a suffix verifier after a trusted checkpoint or archive head.

Source

pub const fn head(&self) -> Option<&JournalHead>

Returns the most recently accepted head.

Source

pub fn verify_next( &mut self, event: &JournalEvent, ) -> Result<(), JournalChainError>

Verifies and accepts the next event without buffering payload history.

§Errors

Returns JournalChainError for intrinsic corruption, wrong scope, sequence gaps, predecessor mismatch, or durable-clock regression.

Trait Implementations§

Source§

impl Debug for JournalChainVerifier

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for JournalChainVerifier

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.