Skip to main content

SnapshotDriver

Trait SnapshotDriver 

Source
pub trait SnapshotDriver {
    // Required methods
    fn registry_json(
        &mut self,
        root: &str,
    ) -> Result<String, SnapshotDriverError>;
    fn create_snapshot(
        &mut self,
        canister_id: &str,
    ) -> Result<String, SnapshotDriverError>;
    fn stop_canister(
        &mut self,
        canister_id: &str,
    ) -> Result<(), SnapshotDriverError>;
    fn start_canister(
        &mut self,
        canister_id: &str,
    ) -> Result<(), SnapshotDriverError>;
    fn download_snapshot(
        &mut self,
        canister_id: &str,
        snapshot_id: &str,
        artifact_path: &Path,
    ) -> Result<(), SnapshotDriverError>;
    fn create_snapshot_command(&self, canister_id: &str) -> String;
    fn stop_canister_command(&self, canister_id: &str) -> String;
    fn start_canister_command(&self, canister_id: &str) -> String;
    fn download_snapshot_command(
        &self,
        canister_id: &str,
        snapshot_id: &str,
        artifact_path: &Path,
    ) -> String;
}
Expand description

SnapshotDriver

Required Methods§

Source

fn registry_json(&mut self, root: &str) -> Result<String, SnapshotDriverError>

Load the root registry JSON used to resolve child snapshot targets.

Source

fn create_snapshot( &mut self, canister_id: &str, ) -> Result<String, SnapshotDriverError>

Create one canister snapshot and return its snapshot id.

Source

fn stop_canister( &mut self, canister_id: &str, ) -> Result<(), SnapshotDriverError>

Stop one canister before snapshot creation.

Source

fn start_canister( &mut self, canister_id: &str, ) -> Result<(), SnapshotDriverError>

Start one canister after snapshot capture.

Source

fn download_snapshot( &mut self, canister_id: &str, snapshot_id: &str, artifact_path: &Path, ) -> Result<(), SnapshotDriverError>

Download one snapshot into the supplied artifact directory.

Source

fn create_snapshot_command(&self, canister_id: &str) -> String

Render the planned create command for dry-run output.

Source

fn stop_canister_command(&self, canister_id: &str) -> String

Render the planned stop command for dry-run output.

Source

fn start_canister_command(&self, canister_id: &str) -> String

Render the planned start command for dry-run output.

Source

fn download_snapshot_command( &self, canister_id: &str, snapshot_id: &str, artifact_path: &Path, ) -> String

Render the planned download command for dry-run output.

Implementors§