firecracker 0.1.0

Rust client SDK for the Firecracker microVM API
docs.rs failed to build firecracker-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

Firecracker Rust Client SDK

Rust SDK for the Firecracker microVM API.

Crates

Crate Description
firecracker Facade — re-exports api + sdk
fc-api Low-level typed client, generated from Swagger spec via progenitor
fc-sdk High-level typestate wrapper: VmBuilderVm lifecycle

Quick Start

use firecracker::sdk::{VmBuilder, types};

let vm = VmBuilder::new("/tmp/firecracker.socket")
    .boot_source(types::BootSource {
        kernel_image_path: "/path/to/vmlinux".into(),
        boot_args: Some("console=ttyS0".into()),
        initrd_path: None,
    })
    .machine_config(types::MachineConfiguration {
        vcpu_count: 2,
        mem_size_mib: 256,
        ..Default::default()
    })
    .start()
    .await?;

vm.pause().await?;
vm.resume().await?;
vm.snapshot("/tmp/snap", "/tmp/mem").await?;

For operations not covered by the SDK, use the generated API client directly:

use firecracker::api::Client;

let client = vm.client();
client.describe_instance().send().await?;

Building

Requires Node.js (for npx swagger2openapi during code generation).

cargo build

License

MIT OR Apache-2.0