pub struct SnapshotManager { /* private fields */ }Expand description
Snapshot manager
Implementations§
Source§impl SnapshotManager
impl SnapshotManager
Sourcepub async fn create_snapshot(
&self,
name: &str,
description: Option<String>,
database: &dyn VirtualDatabase,
registry: &EntityRegistry,
) -> Result<SnapshotMetadata>
pub async fn create_snapshot( &self, name: &str, description: Option<String>, database: &dyn VirtualDatabase, registry: &EntityRegistry, ) -> Result<SnapshotMetadata>
Create a snapshot of the current database state
§Arguments
name- Name for the snapshotdescription- Optional descriptiondatabase- The virtual database instanceregistry- The entity registryinclude_time_travel- Whether to include time travel state (cron jobs, mutation rules)time_travel_state- Optional time travel state to include
Sourcepub async fn create_snapshot_with_time_travel(
&self,
name: &str,
description: Option<String>,
database: &dyn VirtualDatabase,
registry: &EntityRegistry,
include_time_travel: bool,
time_travel_state: Option<TimeTravelSnapshotState>,
) -> Result<SnapshotMetadata>
pub async fn create_snapshot_with_time_travel( &self, name: &str, description: Option<String>, database: &dyn VirtualDatabase, registry: &EntityRegistry, include_time_travel: bool, time_travel_state: Option<TimeTravelSnapshotState>, ) -> Result<SnapshotMetadata>
Create a snapshot with optional time travel state
§Arguments
name- Name for the snapshotdescription- Optional descriptiondatabase- The virtual database instanceregistry- The entity registryinclude_time_travel- Whether to include time travel statetime_travel_state- Optional time travel state to include
Sourcepub async fn restore_snapshot(
&self,
name: &str,
database: &dyn VirtualDatabase,
registry: &EntityRegistry,
) -> Result<()>
pub async fn restore_snapshot( &self, name: &str, database: &dyn VirtualDatabase, registry: &EntityRegistry, ) -> Result<()>
Restore a snapshot
§Arguments
name- Name of the snapshot to restoredatabase- The virtual database instance (will be reset)registry- The entity registry
Sourcepub async fn restore_snapshot_with_time_travel<F>(
&self,
name: &str,
database: &dyn VirtualDatabase,
registry: &EntityRegistry,
restore_time_travel: bool,
time_travel_restore_callback: Option<F>,
) -> Result<()>
pub async fn restore_snapshot_with_time_travel<F>( &self, name: &str, database: &dyn VirtualDatabase, registry: &EntityRegistry, restore_time_travel: bool, time_travel_restore_callback: Option<F>, ) -> Result<()>
Restore a snapshot with optional time travel state restoration
§Arguments
name- Name of the snapshot to restoredatabase- The virtual database instance (will be reset)registry- The entity registryrestore_time_travel- Whether to restore time travel statetime_travel_restore_callback- Optional callback to restore time travel state
Sourcepub async fn list_snapshots(&self) -> Result<Vec<SnapshotMetadata>>
pub async fn list_snapshots(&self) -> Result<Vec<SnapshotMetadata>>
List all snapshots
Sourcepub async fn get_snapshot_metadata(
&self,
name: &str,
) -> Result<SnapshotMetadata>
pub async fn get_snapshot_metadata( &self, name: &str, ) -> Result<SnapshotMetadata>
Get snapshot metadata
Sourcepub async fn delete_snapshot(&self, name: &str) -> Result<()>
pub async fn delete_snapshot(&self, name: &str) -> Result<()>
Delete a snapshot
Auto Trait Implementations§
impl Freeze for SnapshotManager
impl RefUnwindSafe for SnapshotManager
impl Send for SnapshotManager
impl Sync for SnapshotManager
impl Unpin for SnapshotManager
impl UnwindSafe for SnapshotManager
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
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>
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 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>
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