pub struct Databases { /* private fields */ }Expand description
Registry of the default database and the named ones.
Implementations§
Source§impl Databases
impl Databases
Sourcepub fn open(
root: &Path,
embedder: Option<Arc<dyn EmbeddingProvider>>,
cognitive: CognitiveConfig,
config: DatabasesConfig,
) -> MenteResult<Self>
pub fn open( root: &Path, embedder: Option<Arc<dyn EmbeddingProvider>>, cognitive: CognitiveConfig, config: DatabasesConfig, ) -> MenteResult<Self>
Open the default database at root and prepare the registry.
Sourcepub fn default_db(&self) -> Arc<MenteDb> ⓘ
pub fn default_db(&self) -> Arc<MenteDb> ⓘ
The database at the data directory root.
Sourcepub fn embedder(&self) -> Option<Arc<dyn EmbeddingProvider>>
pub fn embedder(&self) -> Option<Arc<dyn EmbeddingProvider>>
The shared embedder, when one is configured.
Sourcepub fn get(&self, name: &str, create: bool) -> Result<Arc<MenteDb>, ApiError>
pub fn get(&self, name: &str, create: bool) -> Result<Arc<MenteDb>, ApiError>
Get a database by name, opening it if needed. Blocking: call from
spawn_blocking. create allows making a new database.
Sourcepub fn delete(&self, name: &str) -> Result<(), ApiError>
pub fn delete(&self, name: &str) -> Result<(), ApiError>
Close and permanently delete a named database. Blocking.
Sourcepub fn path_of(&self, name: &str) -> Result<PathBuf, ApiError>
pub fn path_of(&self, name: &str) -> Result<PathBuf, ApiError>
Directory a database’s files live in.
Auto Trait Implementations§
impl !Freeze for Databases
impl !RefUnwindSafe for Databases
impl !UnwindSafe for Databases
impl Send for Databases
impl Sync for Databases
impl Unpin for Databases
impl UnsafeUnpin for Databases
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request