pub struct NamespaceManager { /* private fields */ }Expand description
Multi-tenant namespace manager
Implementations§
Source§impl NamespaceManager
 
impl NamespaceManager
Sourcepub fn with_quotas<P: AsRef<Path>>(
    root_path: P,
    default_quotas: NamespaceQuotas,
) -> Result<Self>
 
pub fn with_quotas<P: AsRef<Path>>( root_path: P, default_quotas: NamespaceQuotas, ) -> Result<Self>
Create a new namespace manager with custom default quotas
Sourcepub fn load_namespaces(&self) -> Result<Vec<NamespaceId>>
 
pub fn load_namespaces(&self) -> Result<Vec<NamespaceId>>
Load existing namespaces from disk
Sourcepub fn create_namespace(
    &self,
    id: NamespaceId,
    name: String,
    quotas: Option<NamespaceQuotas>,
) -> Result<()>
 
pub fn create_namespace( &self, id: NamespaceId, name: String, quotas: Option<NamespaceQuotas>, ) -> Result<()>
Create a new namespace
Sourcepub fn get_namespace(&self, id: &NamespaceId) -> Result<Namespace>
 
pub fn get_namespace(&self, id: &NamespaceId) -> Result<Namespace>
Get namespace metadata
Sourcepub fn list_namespaces(&self) -> Vec<Namespace>
 
pub fn list_namespaces(&self) -> Vec<Namespace>
List all namespaces
Sourcepub fn update_quotas(
    &self,
    id: &NamespaceId,
    quotas: NamespaceQuotas,
) -> Result<()>
 
pub fn update_quotas( &self, id: &NamespaceId, quotas: NamespaceQuotas, ) -> Result<()>
Update namespace quotas
Sourcepub fn update_status(
    &self,
    id: &NamespaceId,
    status: NamespaceStatus,
) -> Result<()>
 
pub fn update_status( &self, id: &NamespaceId, status: NamespaceStatus, ) -> Result<()>
Update namespace status
Sourcepub fn delete_namespace(&self, id: &NamespaceId) -> Result<()>
 
pub fn delete_namespace(&self, id: &NamespaceId) -> Result<()>
Delete a namespace
Sourcepub fn upsert(
    &self,
    namespace_id: &NamespaceId,
    id: String,
    vector: Vec<f32>,
    metadata: Metadata,
) -> Result<()>
 
pub fn upsert( &self, namespace_id: &NamespaceId, id: String, vector: Vec<f32>, metadata: Metadata, ) -> Result<()>
Upsert a vector in a namespace
Sourcepub fn query(
    &self,
    namespace_id: &NamespaceId,
    query: Query,
) -> Result<Vec<Neighbor>>
 
pub fn query( &self, namespace_id: &NamespaceId, query: Query, ) -> Result<Vec<Neighbor>>
Query vectors in a namespace
Sourcepub fn remove(&self, namespace_id: &NamespaceId, id: &str) -> Result<()>
 
pub fn remove(&self, namespace_id: &NamespaceId, id: &str) -> Result<()>
Delete a vector from a namespace
Sourcepub fn get_stats(&self, namespace_id: &NamespaceId) -> Result<NamespaceStats>
 
pub fn get_stats(&self, namespace_id: &NamespaceId) -> Result<NamespaceStats>
Get statistics for a namespace
Sourcepub fn get_aggregate_stats(&self) -> AggregateStats
 
pub fn get_aggregate_stats(&self) -> AggregateStats
Get aggregate stats across all namespaces
Sourcepub fn backup_namespace(
    &self,
    namespace_id: &NamespaceId,
    backup_name: &str,
) -> Result<()>
 
pub fn backup_namespace( &self, namespace_id: &NamespaceId, backup_name: &str, ) -> Result<()>
Sourcepub fn restore_namespace(
    &self,
    namespace_id: &NamespaceId,
    backup_name: &str,
) -> Result<()>
 
pub fn restore_namespace( &self, namespace_id: &NamespaceId, backup_name: &str, ) -> Result<()>
Sourcepub fn list_namespace_backups(
    &self,
    namespace_id: &NamespaceId,
) -> Result<Vec<(String, String, usize)>>
 
pub fn list_namespace_backups( &self, namespace_id: &NamespaceId, ) -> Result<Vec<(String, String, usize)>>
Sourcepub fn delete_namespace_backup(
    &self,
    namespace_id: &NamespaceId,
    backup_name: &str,
) -> Result<()>
 
pub fn delete_namespace_backup( &self, namespace_id: &NamespaceId, backup_name: &str, ) -> Result<()>
Delete a backup for a namespace
§Arguments
- namespace_id- ID of the namespace
- backup_name- Name of the backup to delete
Auto Trait Implementations§
impl Freeze for NamespaceManager
impl RefUnwindSafe for NamespaceManager
impl Send for NamespaceManager
impl Sync for NamespaceManager
impl Unpin for NamespaceManager
impl UnwindSafe for NamespaceManager
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> 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