pub struct Baseline {
pub version: String,
pub created_at: String,
pub duplicates: Vec<DuplicateMatch>,
}Expand description
Baseline snapshot for comparing duplicate detection across runs
Fields§
§version: StringVersion of the baseline format
created_at: StringTimestamp when baseline was created
duplicates: Vec<DuplicateMatch>Duplicates that existed at baseline time
Implementations§
Source§impl Baseline
impl Baseline
Sourcepub fn from_duplicates(duplicates: Vec<DuplicateMatch>) -> Self
pub fn from_duplicates(duplicates: Vec<DuplicateMatch>) -> Self
Create a new baseline from scan results
Sourcepub fn save_to_file(&self, path: &Path) -> Result<()>
pub fn save_to_file(&self, path: &Path) -> Result<()>
Save baseline to a JSON file
Sourcepub fn load_from_file(path: &Path) -> Result<Self>
pub fn load_from_file(path: &Path) -> Result<Self>
Load baseline from a JSON file
Sourcepub fn find_new_duplicates(
&self,
current: &[DuplicateMatch],
) -> Vec<DuplicateMatch>
pub fn find_new_duplicates( &self, current: &[DuplicateMatch], ) -> Vec<DuplicateMatch>
Compare current duplicates against baseline and return only new ones
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Baseline
impl<'de> Deserialize<'de> for Baseline
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Baseline
impl RefUnwindSafe for Baseline
impl Send for Baseline
impl Sync for Baseline
impl Unpin for Baseline
impl UnwindSafe for Baseline
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more