pub struct VectorRegistry { /* private fields */ }Expand description
Per-server vector index registry.
The registry owns the VectorTable map; FT.* command
handlers consult it on every command. Construct one with
VectorRegistry::new (typically as a field on the
dynomite [crate::core::context::Context]) and clone the
returned handle freely; clones share state.
Implementations§
Source§impl VectorRegistry
impl VectorRegistry
Sourcepub fn create(
&self,
name: String,
schema: VectorSchema,
) -> Result<(), RegistryError>
pub fn create( &self, name: String, schema: VectorSchema, ) -> Result<(), RegistryError>
Register a new index.
The schema’s IndexAlgorithm is validated against the
engine’s capabilities; today only
IndexAlgorithm::Hnsw is supported. The engine is
instantiated as an in-memory dynvec::Engine; on-disk
backends will plug in once the Noxu storage path lands.
§Errors
RegistryError::AlreadyExistswhennameis in use.RegistryError::UnsupportedAlgorithmwhen the schema selects an algorithm we do not implement.RegistryError::Enginewhen the underlying engine refuses the schema.
Sourcepub fn drop(&self, name: &str) -> Result<Arc<VectorTable>, RegistryError>
pub fn drop(&self, name: &str) -> Result<Arc<VectorTable>, RegistryError>
Drop the index name.
Returns the prior table (so callers can decide whether
to also delete underlying documents, mimicking the
FT.DROPINDEX ... DD flag).
§Errors
RegistryError::NotFound when no index is registered
under name.
Sourcepub fn drop_with_dd(&self, name: &str) -> Result<Vec<Vec<u8>>, RegistryError>
pub fn drop_with_dd(&self, name: &str) -> Result<Vec<Vec<u8>>, RegistryError>
Drop the index name and return the set of document
keys that the FT.* surface had observed under it.
Used by FT.DROPINDEX ... DD to enumerate the hash
documents the caller should also delete from the
underlying datastore.
§Errors
RegistryError::NotFound when no index is registered
under name.
Sourcepub fn get(&self, name: &str) -> Option<Arc<VectorTable>>
pub fn get(&self, name: &str) -> Option<Arc<VectorTable>>
Look up a registered table by name.
Returns a cloned Arc so the caller can drop the
registry lock immediately after the lookup.
Sourcepub fn info(&self, name: &str) -> Option<VectorTableInfo>
pub fn info(&self, name: &str) -> Option<VectorTableInfo>
Snapshot the FT.INFO view of name.
Trait Implementations§
Source§impl Clone for VectorRegistry
impl Clone for VectorRegistry
Source§fn clone(&self) -> VectorRegistry
fn clone(&self) -> VectorRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VectorRegistry
impl Debug for VectorRegistry
Source§impl Default for VectorRegistry
impl Default for VectorRegistry
Source§fn default() -> VectorRegistry
fn default() -> VectorRegistry
Auto Trait Implementations§
impl Freeze for VectorRegistry
impl !RefUnwindSafe for VectorRegistry
impl Send for VectorRegistry
impl Sync for VectorRegistry
impl Unpin for VectorRegistry
impl UnsafeUnpin for VectorRegistry
impl !UnwindSafe for VectorRegistry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
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>
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.