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 remain atomic on the same filesystem.
§Example
use dev_coverage::{Baseline, BaselineStore, JsonFileBaselineStore};
let dir = tempfile::tempdir().unwrap();
let store = JsonFileBaselineStore::new(dir.path());
let b = Baseline {
name: "my-crate".into(),
line_pct: 85.0,
function_pct: 90.0,
region_pct: 80.0,
};
store.save("main", &b).unwrap();
let back = store.load("main", "my-crate").unwrap().unwrap();
assert_eq!(back, b);Implementations§
Trait Implementations§
Source§impl Clone for JsonFileBaselineStore
impl Clone for JsonFileBaselineStore
Source§fn clone(&self) -> JsonFileBaselineStore
fn clone(&self) -> JsonFileBaselineStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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