I have use nut to open three different boltdb config files which generate by Go language, I only read data with transaction, the code like this:
fn main() -> Result<(), Box<dyn std::error::Error>> {
let db = DBBuilder::new("config.db").read_only(true).build()?;
let tx = db.begin_tx()?;
let b = tx.bucket(b"name")?;
let Some(value) = b.get(b"key") else {return Err(Box::new(Error::new(ErrorKind::Other, "can't get key from bucket"))); };
println!("{:?}", value);
Ok(())
}
but there were several panic when I read different database file as follows:
thread 'main' panicked at 'range start index 36864 out of range for slice of length 32768', /home/jicky/.cargo/registry/src/mirrors.sjtug.sjtu.edu.cn-be2141875385cea5/nut-0.1.1/src/db/db.rs:731:59
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted
Of course, I have also succeeded when I read the third database file.
I have use nut to open three different boltdb config files which generate by Go language, I only read data with transaction, the code like this:
but there were several panic when I read different database file as follows:
Of course, I have also succeeded when I read the third database file.