pub struct MetaLog {
pub directory: String,
pub events: Vec<MetaLogEntry>,
}Expand description
Metalog tracks directory-level events
Fields§
§directory: StringPath to the directory being tracked
events: Vec<MetaLogEntry>All events in chronological order
Implementations§
Source§impl MetaLog
impl MetaLog
Sourcepub fn record_event(&mut self, event: MetaEvent) -> EventId
pub fn record_event(&mut self, event: MetaEvent) -> EventId
Record a new event
Sourcepub fn events_of_type(&self, event_type: &str) -> Vec<&MetaLogEntry>
pub fn events_of_type(&self, event_type: &str) -> Vec<&MetaLogEntry>
Get all events of a specific type
Sourcepub fn events_for_file(&self, filename: &str) -> Vec<&MetaLogEntry>
pub fn events_for_file(&self, filename: &str) -> Vec<&MetaLogEntry>
Get all events related to a specific file
Sourcepub fn get_or_create(directory: &Path) -> Result<Self>
pub fn get_or_create(directory: &Path) -> Result<Self>
Get or create metalog for a directory
Sourcepub fn metalog_path(directory: &Path) -> Result<PathBuf>
pub fn metalog_path(directory: &Path) -> Result<PathBuf>
Get path to metalog file for a directory
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MetaLog
impl<'de> Deserialize<'de> for MetaLog
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 MetaLog
impl RefUnwindSafe for MetaLog
impl Send for MetaLog
impl Sync for MetaLog
impl Unpin for MetaLog
impl UnsafeUnpin for MetaLog
impl UnwindSafe for MetaLog
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