pub struct JsonFileBaselineStore { /* private fields */ }Expand description
Filesystem-backed JSON baseline store.
Keys baselines as <root>/<scope>/<name>.json. Save uses
write-temp-rename to be atomic on the same filesystem.
§Example
use dev_bench::{Baseline, BaselineStore, JsonFileBaselineStore};
let dir = tempfile::tempdir().unwrap();
let store = JsonFileBaselineStore::new(dir.path());
let b = Baseline {
name: "parse".into(),
mean_ns: 1234,
samples: 100,
ops_per_sec: 800_000.0,
};
store.save("main", &b).unwrap();
let back = store.load("main", "parse").unwrap().unwrap();
assert_eq!(back, b);Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JsonFileBaselineStore
impl RefUnwindSafe for JsonFileBaselineStore
impl Send for JsonFileBaselineStore
impl Sync for JsonFileBaselineStore
impl Unpin for JsonFileBaselineStore
impl UnsafeUnpin for JsonFileBaselineStore
impl UnwindSafe for JsonFileBaselineStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more