pub struct ManifestStore { /* private fields */ }Expand description
Local manifest store backed by Sled
Implementations§
Source§impl ManifestStore
impl ManifestStore
Sourcepub fn open<P: AsRef<Path>>(path: P) -> StorageResult<Self>
pub fn open<P: AsRef<Path>>(path: P) -> StorageResult<Self>
Open or create a manifest store at the given path
Sourcepub fn put(&self, manifest: &FileManifest) -> StorageResult<()>
pub fn put(&self, manifest: &FileManifest) -> StorageResult<()>
Store a file manifest
Sourcepub fn get(&self, file_id: &FileId) -> StorageResult<Option<FileManifest>>
pub fn get(&self, file_id: &FileId) -> StorageResult<Option<FileManifest>>
Retrieve a manifest by file ID
Sourcepub fn get_by_id_str(
&self,
file_id_str: &str,
) -> StorageResult<Option<FileManifest>>
pub fn get_by_id_str( &self, file_id_str: &str, ) -> StorageResult<Option<FileManifest>>
Retrieve a manifest by file ID string (UUID format)
Sourcepub fn get_by_name(&self, name: &str) -> StorageResult<Option<FileManifest>>
pub fn get_by_name(&self, name: &str) -> StorageResult<Option<FileManifest>>
Retrieve a manifest by filename
Sourcepub fn contains(&self, file_id: &FileId) -> StorageResult<bool>
pub fn contains(&self, file_id: &FileId) -> StorageResult<bool>
Check if a manifest exists
Sourcepub fn delete(&self, file_id: &FileId) -> StorageResult<bool>
pub fn delete(&self, file_id: &FileId) -> StorageResult<bool>
Delete a manifest
Sourcepub fn list(&self) -> StorageResult<Vec<ManifestSummary>>
pub fn list(&self) -> StorageResult<Vec<ManifestSummary>>
List all stored manifests (returns file_id, name, size, chunk_count)
Sourcepub fn count(&self) -> StorageResult<usize>
pub fn count(&self) -> StorageResult<usize>
Get total number of manifests stored
Sourcepub fn flush(&self) -> StorageResult<()>
pub fn flush(&self) -> StorageResult<()>
Flush all pending writes to disk
Auto Trait Implementations§
impl Freeze for ManifestStore
impl !RefUnwindSafe for ManifestStore
impl Send for ManifestStore
impl Sync for ManifestStore
impl Unpin for ManifestStore
impl !UnwindSafe for ManifestStore
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