pub struct ArchiveIndex {
pub units: Vec<IndexEntry>,
}Fields§
§units: Vec<IndexEntry>Implementations§
Source§impl ArchiveIndex
impl ArchiveIndex
Sourcepub fn build(mana_dir: &Path) -> Result<ArchiveIndex, Error>
pub fn build(mana_dir: &Path) -> Result<ArchiveIndex, Error>
Build the archive index by walking .mana/archive/ recursively.
Reuses Index::collect_archived to find all archived unit files,
then sorts entries by ID using natural ordering.
Sourcepub fn load(mana_dir: &Path) -> Result<ArchiveIndex, Error>
pub fn load(mana_dir: &Path) -> Result<ArchiveIndex, Error>
Load the archive index from .mana/archive.yaml.
Sourcepub fn save(&self, mana_dir: &Path) -> Result<(), Error>
pub fn save(&self, mana_dir: &Path) -> Result<(), Error>
Save the archive index to .mana/archive.yaml.
Sourcepub fn load_or_rebuild(mana_dir: &Path) -> Result<ArchiveIndex, Error>
pub fn load_or_rebuild(mana_dir: &Path) -> Result<ArchiveIndex, Error>
Load cached archive index or rebuild if stale.
Sourcepub fn is_stale(mana_dir: &Path) -> Result<bool, Error>
pub fn is_stale(mana_dir: &Path) -> Result<bool, Error>
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<ArchiveIndex, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ArchiveIndex, <__D as Deserializer<'de>>::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
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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