pub struct IndexDbs { /* private fields */ }Expand description
Cached handles to the four index sub-databases.
Implementations§
Source§impl IndexDbs
impl IndexDbs
Sourcepub fn open(env: &Environment) -> Result<Self>
pub fn open(env: &Environment) -> Result<Self>
Open handles to all four index DBs. Call after create_db at startup.
Sourcepub fn add(
&self,
tx: &mut RwTransaction<'_>,
galaxy: Galaxy,
memory: &Memory,
) -> Result<()>
pub fn add( &self, tx: &mut RwTransaction<'_>, galaxy: Galaxy, memory: &Memory, ) -> Result<()>
Add a memory’s index entries within an existing write transaction.
Sourcepub fn remove(
&self,
tx: &mut RwTransaction<'_>,
galaxy: Galaxy,
memory: &Memory,
) -> Result<()>
pub fn remove( &self, tx: &mut RwTransaction<'_>, galaxy: Galaxy, memory: &Memory, ) -> Result<()>
Remove a memory’s index entries within an existing write transaction.
Sourcepub fn find_by_content_hash(
&self,
tx: &RoTransaction<'_>,
galaxy: Galaxy,
hash: &str,
) -> Result<Option<Uuid>>
pub fn find_by_content_hash( &self, tx: &RoTransaction<'_>, galaxy: Galaxy, hash: &str, ) -> Result<Option<Uuid>>
O(1) content-hash lookup → UUID.
Sourcepub fn find_by_tag(
&self,
tx: &RoTransaction<'_>,
galaxy: Galaxy,
tag: &str,
) -> Result<Vec<Uuid>>
pub fn find_by_tag( &self, tx: &RoTransaction<'_>, galaxy: Galaxy, tag: &str, ) -> Result<Vec<Uuid>>
Tag lookup → all UUIDs with that tag in the galaxy.
Sourcepub fn find_by_importance_range(
&self,
tx: &RoTransaction<'_>,
galaxy: Galaxy,
min: f32,
max: f32,
) -> Result<Vec<Uuid>>
pub fn find_by_importance_range( &self, tx: &RoTransaction<'_>, galaxy: Galaxy, min: f32, max: f32, ) -> Result<Vec<Uuid>>
Importance range query → all UUIDs with importance in [min, max].
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IndexDbs
impl RefUnwindSafe for IndexDbs
impl Send for IndexDbs
impl Sync for IndexDbs
impl Unpin for IndexDbs
impl UnsafeUnpin for IndexDbs
impl UnwindSafe for IndexDbs
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> Fruit for T
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