pub struct CheckpointBuilder { /* private fields */ }Expand description
Constructs checkpoint snapshots from event streams and state.
Implementations§
Source§impl CheckpointBuilder
impl CheckpointBuilder
Sourcepub fn new(timeline_id: &str, tick: u64) -> Self
pub fn new(timeline_id: &str, tick: u64) -> Self
Create a builder targeting a specific timeline and tick.
Sourcepub fn compute_event_hash(events: &[CanonEventSnapshot]) -> String
pub fn compute_event_hash(events: &[CanonEventSnapshot]) -> String
Compute the BLAKE3 chain hash over all events up to this checkpoint.
Events are hashed in order by feeding each event’s digest. This produces the same result regardless of how many times it is computed, as long as the input events are in canonical order.
Sourcepub fn compute_state_hash(state: &StateSnapshot) -> Result<String, String>
pub fn compute_state_hash(state: &StateSnapshot) -> Result<String, String>
Compute BLAKE3 hash of the serialized state snapshot.
Sourcepub fn build(
&self,
events: &[CanonEventSnapshot],
state: &StateSnapshot,
) -> Result<CheckpointSnapshot, String>
pub fn build( &self, events: &[CanonEventSnapshot], state: &StateSnapshot, ) -> Result<CheckpointSnapshot, String>
Build a complete checkpoint snapshot.
Auto Trait Implementations§
impl Freeze for CheckpointBuilder
impl RefUnwindSafe for CheckpointBuilder
impl Send for CheckpointBuilder
impl Sync for CheckpointBuilder
impl Unpin for CheckpointBuilder
impl UnsafeUnpin for CheckpointBuilder
impl UnwindSafe for CheckpointBuilder
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