pub struct BaselineFile {
pub version: u32,
pub entries: Vec<BaselineEntry>,
}Expand description
The duplication a codebase already had when the baseline was recorded.
Fields§
§version: u32The format the entries are written in.
entries: Vec<BaselineEntry>Every group that was there at the time.
Implementations§
Source§impl BaselineFile
impl BaselineFile
Sourcepub fn record(result: &AnalysisResult) -> Self
pub fn record(result: &AnalysisResult) -> Self
Record everything result found.
Entries are ordered by kind and then by fingerprint, so re-recording an unchanged codebase produces a byte-identical file and a diff shows only what actually moved.
Sourcepub fn load(path: &Path) -> Result<Self>
pub fn load(path: &Path) -> Result<Self>
Read the baseline at path.
§Errors
Returns Error::Baseline when the file is missing, unreadable,
malformed, or written in a format this build does not read. A baseline
that cannot be applied is never treated as an empty one: that would
quietly turn every inherited finding into a new one.
Sourcepub fn save(&self, path: &Path) -> Result<()>
pub fn save(&self, path: &Path) -> Result<()>
Write the baseline to path, creating the directory above it.
§Errors
Returns Error::Baseline if the file cannot be written.
Sourcepub fn admits(&self, kind: BaselineKind, group: &DuplicateGroup) -> bool
pub fn admits(&self, kind: BaselineKind, group: &DuplicateGroup) -> bool
Whether some entry accounts for group in full.