pub struct VectorDB { /* private fields */ }Implementations§
Source§impl VectorDB
impl VectorDB
pub fn new( dimensions: usize, storage_path: Option<String>, ) -> Result<VectorDB, JsValue>
pub fn insert( &mut self, id: String, vector: Vec<f32>, ) -> Result<String, JsValue>
pub fn search(&self, vector: Vec<f32>, k: usize) -> Result<JsValue, JsValue>
pub fn delete(&mut self, id: String) -> Result<bool, JsValue>
pub fn count(&self) -> Result<usize, JsValue>
Trait Implementations§
Source§impl FromWasmAbi for VectorDB
impl FromWasmAbi for VectorDB
Source§impl IntoWasmAbi for VectorDB
impl IntoWasmAbi for VectorDB
Source§impl LongRefFromWasmAbi for VectorDB
impl LongRefFromWasmAbi for VectorDB
Source§impl OptionFromWasmAbi for VectorDB
impl OptionFromWasmAbi for VectorDB
Source§impl OptionIntoWasmAbi for VectorDB
impl OptionIntoWasmAbi for VectorDB
Source§impl RefFromWasmAbi for VectorDB
impl RefFromWasmAbi for VectorDB
Source§impl RefMutFromWasmAbi for VectorDB
impl RefMutFromWasmAbi for VectorDB
Source§impl TryFromJsValue for VectorDB
impl TryFromJsValue for VectorDB
Source§impl VectorFromWasmAbi for VectorDB
impl VectorFromWasmAbi for VectorDB
Source§impl VectorIntoWasmAbi for VectorDB
impl VectorIntoWasmAbi for VectorDB
impl SupportsConstructor for VectorDB
impl SupportsInstanceProperty for VectorDB
impl SupportsStaticProperty for VectorDB
Auto Trait Implementations§
impl Freeze for VectorDB
impl !RefUnwindSafe for VectorDB
impl Send for VectorDB
impl Sync for VectorDB
impl Unpin for VectorDB
impl UnsafeUnpin for VectorDB
impl !UnwindSafe for VectorDB
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> 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> Pointable for T
impl<T> Pointable for T
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.