pub struct Baseline {
pub version: String,
pub created_at: String,
pub file_hashes: HashMap<String, FileHash>,
pub file_count: usize,
}Expand description
Represents a baseline snapshot for drift detection (rug pull prevention)
Fields§
§version: StringVersion of the baseline format
created_at: StringWhen the baseline was created
file_hashes: HashMap<String, FileHash>Hash of each scanned file
file_count: usizeTotal number of files
Implementations§
Source§impl Baseline
impl Baseline
Sourcepub fn from_directory(dir: &Path) -> Result<Self>
pub fn from_directory(dir: &Path) -> Result<Self>
Create a new baseline from a directory
Sourcepub fn save(&self, dir: &Path) -> Result<()>
pub fn save(&self, dir: &Path) -> Result<()>
Save baseline to default location (dir/.cc-audit-baseline.json)
Sourcepub fn save_to_file(&self, path: &Path) -> Result<()>
pub fn save_to_file(&self, path: &Path) -> Result<()>
Save baseline to a specific file path
Sourcepub fn load(dir: &Path) -> Result<Self>
pub fn load(dir: &Path) -> Result<Self>
Load baseline from default location (dir/.cc-audit-baseline.json)
Sourcepub fn load_from_file(path: &Path) -> Result<Self>
pub fn load_from_file(path: &Path) -> Result<Self>
Load baseline from a specific file path
Sourcepub fn check_drift(&self, dir: &Path) -> Result<DriftReport>
pub fn check_drift(&self, dir: &Path) -> Result<DriftReport>
Check for drift against current state
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