pub struct ArchiveIndex {
pub beans: Vec<IndexEntry>,
}Fields§
§beans: Vec<IndexEntry>Implementations§
Source§impl ArchiveIndex
impl ArchiveIndex
Sourcepub fn build(beans_dir: &Path) -> Result<Self>
pub fn build(beans_dir: &Path) -> Result<Self>
Build the archive index by walking .beans/archive/ recursively.
Reuses Index::collect_archived to find all archived bean files,
then sorts entries by ID using natural ordering.
Sourcepub fn save(&self, beans_dir: &Path) -> Result<()>
pub fn save(&self, beans_dir: &Path) -> Result<()>
Save the archive index to .beans/archive.yaml.
Sourcepub fn load_or_rebuild(beans_dir: &Path) -> Result<Self>
pub fn load_or_rebuild(beans_dir: &Path) -> Result<Self>
Load cached archive index or rebuild if stale.
Sourcepub fn is_stale(beans_dir: &Path) -> Result<bool>
pub fn is_stale(beans_dir: &Path) -> Result<bool>
Check whether the cached archive index is stale. Returns true if archive.yaml is missing (and archive dir exists), or if any file in the archive tree has been modified after archive.yaml.
Sourcepub fn append(&mut self, entry: IndexEntry)
pub fn append(&mut self, entry: IndexEntry)
Append an entry, deduplicating by ID (replaces any existing entry with the same ID).
Trait Implementations§
Source§impl Clone for ArchiveIndex
impl Clone for ArchiveIndex
Source§fn clone(&self) -> ArchiveIndex
fn clone(&self) -> ArchiveIndex
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ArchiveIndex
impl Debug for ArchiveIndex
Source§impl<'de> Deserialize<'de> for ArchiveIndex
impl<'de> Deserialize<'de> for ArchiveIndex
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
Source§impl PartialEq for ArchiveIndex
impl PartialEq for ArchiveIndex
Source§impl Serialize for ArchiveIndex
impl Serialize for ArchiveIndex
impl StructuralPartialEq for ArchiveIndex
Auto Trait Implementations§
impl Freeze for ArchiveIndex
impl RefUnwindSafe for ArchiveIndex
impl Send for ArchiveIndex
impl Sync for ArchiveIndex
impl Unpin for ArchiveIndex
impl UnsafeUnpin for ArchiveIndex
impl UnwindSafe for ArchiveIndex
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