Skip to main content

CheckpointService

Struct CheckpointService 

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

Main checkpoint service for integration

Implementations§

Source§

impl CheckpointService

Source

pub fn new(storage: ThreadSafeStorage) -> Self

Create a new checkpoint service

Initializes the global sequence counter from storage to ensure monotonic sequences across service restarts.

Source

pub fn global_sequence(&self) -> u64

Get the current global sequence number

Returns the sequence number of the most recently created checkpoint. Returns 0 if no checkpoints have been created yet.

Source

pub fn is_running(&self) -> bool

Check if service is running

Source

pub fn stop(&self)

Stop the service

Source

pub fn create_session(&self, _name: &str) -> Result<SessionId>

Create a new session

Source

pub fn checkpoint( &self, session_id: &SessionId, message: impl Into<String>, ) -> Result<CheckpointId>

Create a checkpoint with global sequence number

Source

pub fn list_checkpoints( &self, session_id: &SessionId, ) -> Result<Vec<CheckpointSummary>>

List checkpoints for a session

Source

pub fn restore( &self, session_id: &SessionId, checkpoint_id: &CheckpointId, ) -> Result<DebugStateSnapshot>

Restore a checkpoint

Source

pub fn enable_auto_checkpoint( &self, session_id: &SessionId, config: AutoCheckpointConfig, ) -> Result<()>

Enable auto-checkpointing for a session

Source

pub fn trigger_auto_checkpoint( &self, session_id: &SessionId, trigger: AutoTrigger, ) -> Result<Option<CheckpointId>>

Trigger an auto-checkpoint with global sequence

Source

pub fn subscribe( &self, session_id: &SessionId, ) -> Result<Receiver<CheckpointEvent>>

Subscribe to checkpoint events for a session

Source

pub fn execute(&self, command: CheckpointCommand) -> Result<CommandResult>

Execute a command

Source

pub fn sync_to_disk(&self) -> Result<()>

Sync checkpoints to disk (background persistence)

Source

pub fn annotate( &self, checkpoint_id: &CheckpointId, annotation: CheckpointAnnotation, ) -> Result<()>

Annotate a checkpoint

Source

pub fn get_with_annotations( &self, checkpoint_id: &CheckpointId, ) -> Result<AnnotatedCheckpoint>

Get checkpoint with annotations

Source

pub fn metrics(&self) -> Result<ServiceMetrics>

Get service metrics

Source

pub fn health_check(&self) -> Result<HealthStatus>

Health check

Source

pub fn list_by_sequence_range( &self, start_seq: u64, end_seq: u64, ) -> Result<Vec<CheckpointSummary>>

List checkpoints by global sequence number range

Returns all checkpoints (across all sessions) with sequence numbers in the inclusive range [start_seq, end_seq].

Source

pub fn export_all_checkpoints(&self) -> Result<String>

Export all checkpoints from all sessions

Returns a JSON-serializable export containing all checkpoints and the current global sequence number.

Source

pub fn import_checkpoints(&self, export_data: &str) -> Result<ImportResult>

Import checkpoints from export data

Imports all checkpoints and restores the global sequence counter. Skips checkpoints that already exist (by ID).

Source

pub fn validate_checkpoint(&self, checkpoint_id: &CheckpointId) -> Result<bool>

Validate a single checkpoint by ID

Returns true if the checkpoint’s checksum is valid, false otherwise.

Source

pub fn health_check_with_validation(&self) -> Result<HealthStatus>

Health check with validation of recent checkpoints

Performs a health check and additionally validates the most recent checkpoints to detect data corruption.

Source

pub fn validate_all_checkpoints(&self) -> Result<ValidationReport>

Validate all checkpoints

Performs a full validation of all checkpoints in the system. Returns a report with validation statistics.

Source

pub async fn get_hypothesis_state( &self, checkpoint_id: CheckpointId, ) -> Result<Option<HypothesisState>>

Get hypothesis state at a specific checkpoint

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more