pub struct SnapshotService { /* private fields */ }Expand description
Owns the store plus everything needed to dump and restore state. Created by
Runtime::run when snapshots are enabled.
Implementations§
Source§impl SnapshotService
impl SnapshotService
Sourcepub async fn initialize(
config: SnapshotConfig,
spec: &Spec,
entity_cache: EntityCache,
view_index: &ViewIndex,
_mutations_tx: Sender<MutationBatch>,
) -> Result<Arc<Self>>
pub async fn initialize( config: SnapshotConfig, spec: &Spec, entity_cache: EntityCache, view_index: &ViewIndex, _mutations_tx: Sender<MutationBatch>, ) -> Result<Arc<Self>>
Build the store, then attempt a restore (any failure logs a warning and cold-starts — restore problems must never block startup).
pub fn config(&self) -> &SnapshotConfig
Sourcepub fn runtime(&self) -> SnapshotRuntime
pub fn runtime(&self) -> SnapshotRuntime
Return the per-server coordination handle that must be shared with the matching parser, projector, and readiness endpoint.
Sourcepub async fn snapshot_now(&self, trigger: SnapshotTrigger) -> Result<bool>
pub async fn snapshot_now(&self, trigger: SnapshotTrigger) -> Result<bool>
Run one snapshot cycle. Returns Ok(false) when skipped (no VM
registered yet, or too few mutations since the last snapshot).
Auto Trait Implementations§
impl !Freeze for SnapshotService
impl !RefUnwindSafe for SnapshotService
impl !UnwindSafe for SnapshotService
impl Send for SnapshotService
impl Sync for SnapshotService
impl Unpin for SnapshotService
impl UnsafeUnpin for SnapshotService
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