pub struct IndexFile { /* private fields */ }Expand description
Generic index file interface
Implementations§
Source§impl IndexFile
impl IndexFile
Sourcepub fn new(version: IndexVersion) -> Self
pub fn new(version: IndexVersion) -> Self
Create a new empty index
Sourcepub fn lookup(&self, ekey: &EKey) -> Option<&ArchiveLocation>
pub fn lookup(&self, ekey: &EKey) -> Option<&ArchiveLocation>
Look up an entry by EKey
Sourcepub fn add_entry(&mut self, ekey: EKey, location: ArchiveLocation)
pub fn add_entry(&mut self, ekey: EKey, location: ArchiveLocation)
Add an entry to the index
Sourcepub fn remove_entry(&mut self, ekey: &EKey) -> Option<ArchiveLocation>
pub fn remove_entry(&mut self, ekey: &EKey) -> Option<ArchiveLocation>
Remove an entry from the index
Sourcepub fn version(&self) -> IndexVersion
pub fn version(&self) -> IndexVersion
Get the index version
Sourcepub fn entries(&self) -> impl Iterator<Item = (&EKey, &ArchiveLocation)>
pub fn entries(&self) -> impl Iterator<Item = (&EKey, &ArchiveLocation)>
Iterate over all entries
Auto Trait Implementations§
impl Freeze for IndexFile
impl RefUnwindSafe for IndexFile
impl Send for IndexFile
impl Sync for IndexFile
impl Unpin for IndexFile
impl UnwindSafe for IndexFile
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