pub struct MemoryBackend { /* private fields */ }Expand description
In-memory backend. Satisfies Backend without writing to
disk; useful for tests and for embedders that want a
fully-volatile vector cache.
Implementations§
Source§impl MemoryBackend
impl MemoryBackend
Trait Implementations§
Source§impl Backend for MemoryBackend
impl Backend for MemoryBackend
Source§fn put_row(
&self,
table: &str,
key: &[u8],
row: &VectorRow,
) -> Result<(), StoreError>
fn put_row( &self, table: &str, key: &[u8], row: &VectorRow, ) -> Result<(), StoreError>
Persist
row under (table, key). Overwrites prior
values.Source§fn get_row(
&self,
table: &str,
key: &[u8],
) -> Result<Option<VectorRow>, StoreError>
fn get_row( &self, table: &str, key: &[u8], ) -> Result<Option<VectorRow>, StoreError>
Fetch the row at
(table, key). Returns None for a
missing row.Source§fn delete_row(&self, table: &str, key: &[u8]) -> Result<bool, StoreError>
fn delete_row(&self, table: &str, key: &[u8]) -> Result<bool, StoreError>
Remove
(table, key). Returns true when present,
false when absent.Source§fn for_each_row(
&self,
table: &str,
f: &mut RowVisitor<'_>,
) -> Result<(), StoreError>
fn for_each_row( &self, table: &str, f: &mut RowVisitor<'_>, ) -> Result<(), StoreError>
Iterate every
(key, row) in table in unspecified
order. Used to rebuild the HNSW index on startup.Source§fn put_schema(&self, schema: &TableSchema) -> Result<(), StoreError>
fn put_schema(&self, schema: &TableSchema) -> Result<(), StoreError>
Persist a
TableSchema.Source§fn list_schemas(&self) -> Result<Vec<TableSchema>, StoreError>
fn list_schemas(&self) -> Result<Vec<TableSchema>, StoreError>
List every persisted
TableSchema.Source§impl Default for MemoryBackend
impl Default for MemoryBackend
Source§fn default() -> MemoryBackend
fn default() -> MemoryBackend
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for MemoryBackend
impl !RefUnwindSafe for MemoryBackend
impl Send for MemoryBackend
impl Sync for MemoryBackend
impl Unpin for MemoryBackend
impl UnsafeUnpin for MemoryBackend
impl UnwindSafe for MemoryBackend
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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.