| Crates.io | bolt-lite |
| lib.rs | bolt-lite |
| version | 0.1.0 |
| created_at | 2025-12-13 15:29:57.648642+00 |
| updated_at | 2025-12-13 15:29:57.648642+00 |
| description | Minimal read-only BoltDB parser for containerd metadata |
| homepage | https://github.com/yorelog/docker-image-pusher |
| repository | https://github.com/yorelog/docker-image-pusher |
| max_upload_size | |
| id | 1983063 |
| size | 19,360 |
Minimal, read-only BoltDB parser focused on containerd metadata.db. It keeps everything in-memory, walks buckets, and exposes a tiny API that mirrors common containerd layouts.
Tx::bucket, Tx::bucket_path), entry lookup, and iteration.use bolt_lite::Bolt;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let db = Bolt::open_ro("/var/lib/containerd/io.containerd.metadata.v1.bolt/meta.db")?;
let tx = db.begin()?;
let images = tx
.bucket_path(&[b"v1", b"default", b"images"])
.expect("images bucket")
.iter_buckets();
for (name, bucket) in images {
if let Some(desc) = bucket.get(b"target") {
println!("{} -> {} bytes", String::from_utf8_lossy(&name), desc.len());
}
}
Ok(())
}
Tx::bucket_path handles nested buckets by byte segments.Bucket::get and Bucket::bucket fetch values or nested buckets.Bucket::cursor iterates leaf entries; Bucket::iter_buckets discovers child buckets with BUCKET_VALUE_FLAG set.ok_opt converts Result<T, E> into Option<T> when you want fallbacks.MIT