pub struct StorageIndex { /* private fields */ }Expand description
Ephemeral metadata index backed by redb.
Implementations§
Source§impl StorageIndex
impl StorageIndex
Sourcepub fn open(path: &Path) -> Result<StorageIndex, StoreError>
pub fn open(path: &Path) -> Result<StorageIndex, StoreError>
Open or create the index at the given path.
§Errors
Returns StoreError::Io if the database cannot be opened or the
schema tables cannot be created.
Sourcepub fn index_narinfo(&self, hash: &str, nar_size: u64) -> Result<(), StoreError>
pub fn index_narinfo(&self, hash: &str, nar_size: u64) -> Result<(), StoreError>
Sourcepub fn index_store_path(
&self,
store_path: &str,
hash: &str,
) -> Result<(), StoreError>
pub fn index_store_path( &self, store_path: &str, hash: &str, ) -> Result<(), StoreError>
Sourcepub fn has_narinfo(&self, hash: &str) -> Result<bool, StoreError>
pub fn has_narinfo(&self, hash: &str) -> Result<bool, StoreError>
Sourcepub fn list_hashes(&self) -> Result<Vec<String>, StoreError>
pub fn list_hashes(&self) -> Result<Vec<String>, StoreError>
Sourcepub fn count(&self) -> Result<u64, StoreError>
pub fn count(&self) -> Result<u64, StoreError>
Auto Trait Implementations§
impl !RefUnwindSafe for StorageIndex
impl !UnwindSafe for StorageIndex
impl Freeze for StorageIndex
impl Send for StorageIndex
impl Sync for StorageIndex
impl Unpin for StorageIndex
impl UnsafeUnpin for StorageIndex
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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