pub struct SpecSnapshot {
pub timestamp: SystemTime,
pub files: HashMap<PathBuf, FileMetadata>,
}Expand description
A snapshot of spec files at a point in time.
This struct captures the state of .md files in relevant directories
before spawning a Claude session, allowing detection of new files afterward.
Fields§
§timestamp: SystemTimeThe timestamp when this snapshot was taken.
files: HashMap<PathBuf, FileMetadata>Map of file paths to their metadata at snapshot time.
Implementations§
Source§impl SpecSnapshot
impl SpecSnapshot
Sourcepub fn capture() -> Result<Self>
pub fn capture() -> Result<Self>
Create a new snapshot by scanning the specified directories for .md files.
Scans both:
~/.config/autom8/<project>/pdr/(config directory)- Current working directory
Directories that don’t exist are silently skipped (resulting in an empty contribution to the snapshot from that location).
Sourcepub fn get(&self, path: &PathBuf) -> Option<&FileMetadata>
pub fn get(&self, path: &PathBuf) -> Option<&FileMetadata>
Get the metadata for a file path, if it exists in the snapshot.
Sourcepub fn detect_new_files(&self) -> Result<Vec<PathBuf>>
pub fn detect_new_files(&self) -> Result<Vec<PathBuf>>
Detect new spec files by comparing current state against this snapshot.
Scans the same directories (config spec/ and current working directory) and returns paths to files that are either:
- Not present in the original snapshot (newly created)
- Present but modified after the snapshot timestamp (modified during session)
Returns a sorted list of canonical paths to new/modified .md files.
Trait Implementations§
Source§impl Clone for SpecSnapshot
impl Clone for SpecSnapshot
Source§fn clone(&self) -> SpecSnapshot
fn clone(&self) -> SpecSnapshot
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SpecSnapshot
impl RefUnwindSafe for SpecSnapshot
impl Send for SpecSnapshot
impl Sync for SpecSnapshot
impl Unpin for SpecSnapshot
impl UnwindSafe for SpecSnapshot
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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