pub struct CollectionManager { /* private fields */ }Expand description
Collection manager for multi-collection support
Implementations§
Source§impl CollectionManager
impl CollectionManager
pub fn into_reference( val: CollectionManager, env: Env, ) -> Result<Reference<CollectionManager>>
pub fn into_instance(self, env: Env) -> Result<ClassInstance<CollectionManager>>
Source§impl CollectionManager
impl CollectionManager
Sourcepub async fn create_collection(
&self,
name: String,
config: JsCollectionConfig,
) -> Result<()>
pub async fn create_collection( &self, name: String, config: JsCollectionConfig, ) -> Result<()>
Create a new collection
§Example
await manager.createCollection('my_vectors', {
dimensions: 384,
distanceMetric: 'Cosine'
});Sourcepub async fn list_collections(&self) -> Result<Vec<String>>
pub async fn list_collections(&self) -> Result<Vec<String>>
List all collections
§Example
const collections = await manager.listCollections();
console.log('Collections:', collections);Sourcepub async fn delete_collection(&self, name: String) -> Result<()>
pub async fn delete_collection(&self, name: String) -> Result<()>
Sourcepub async fn get_stats(&self, name: String) -> Result<JsCollectionStats>
pub async fn get_stats(&self, name: String) -> Result<JsCollectionStats>
Get collection statistics
§Example
const stats = await manager.getStats('my_vectors');
console.log(`Vectors: ${stats.vectorsCount}`);Sourcepub async fn delete_alias(&self, alias: String) -> Result<()>
pub async fn delete_alias(&self, alias: String) -> Result<()>
Trait Implementations§
Source§impl FromNapiMutRef for CollectionManager
impl FromNapiMutRef for CollectionManager
Source§unsafe fn from_napi_mut_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static mut Self>
unsafe fn from_napi_mut_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static mut Self>
Safety Read more
Source§impl FromNapiRef for CollectionManager
impl FromNapiRef for CollectionManager
Source§unsafe fn from_napi_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static Self>
unsafe fn from_napi_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static Self>
Safety Read more
Source§impl FromNapiValue for &CollectionManager
impl FromNapiValue for &CollectionManager
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl FromNapiValue for &mut CollectionManager
impl FromNapiValue for &mut CollectionManager
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl ObjectFinalize for CollectionManager
impl ObjectFinalize for CollectionManager
Source§impl ToNapiValue for CollectionManager
impl ToNapiValue for CollectionManager
Source§unsafe fn to_napi_value(
env: napi_env,
val: CollectionManager,
) -> Result<napi_value>
unsafe fn to_napi_value( env: napi_env, val: CollectionManager, ) -> Result<napi_value>
Safety Read more
Source§impl TypeName for &CollectionManager
impl TypeName for &CollectionManager
Source§impl TypeName for &mut CollectionManager
impl TypeName for &mut CollectionManager
Source§impl TypeName for CollectionManager
impl TypeName for CollectionManager
Source§impl ValidateNapiValue for &CollectionManager
impl ValidateNapiValue for &CollectionManager
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &mut CollectionManager
impl ValidateNapiValue for &mut CollectionManager
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Auto Trait Implementations§
impl Freeze for CollectionManager
impl RefUnwindSafe for CollectionManager
impl Send for CollectionManager
impl Sync for CollectionManager
impl Unpin for CollectionManager
impl UnwindSafe for CollectionManager
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