Skip to content

xuehaonan27/rustcracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rustcracker

A crate for communicating with firecracker developed by Xue Haonan during development of PKU-cloud. Reference: firecracker-go-sdk

Thanks for supports from all members of LCPU (Linux Club of Peking University).

Break Changes

The API of rustcracker 2.0.0 has a break change, which is completely incompatible with 1.x, and is cleaner, more organized and easier to use.

Example

async fn _demo_use_async_machine() -> RtckResult<()> {
    use rustcracker::config::GlobalConfig;
    let config = GlobalConfig {
        ..Default::default()
    };

    use rustcracker::machine::machine_async;
    use rustcracker::models::snapshot_create_params;
    let machine = machine_async::Machine::create(&config).await?;
    machine.configure().await?;
    machine.start().await?;
    machine.pause().await?;
    machine
        .snapshot(
            "/snapshot/state/demo",
            "/snapshot/mem/demo",
            snapshot_create_params::SnapshotType::Diff,
        )
        .await?;
    machine.resume().await?;
    machine.stop().await?;
    machine.delete().await?;
    machine.delete_and_clean().await?;

    Ok(())
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages