pub struct Arms { /* private fields */ }Expand description
The main ARMS engine
Orchestrates storage and indexing with a unified API.
Implementations§
Source§impl Arms
impl Arms
Sourcepub fn new(config: ArmsConfig) -> Self
pub fn new(config: ArmsConfig) -> Self
Create a new ARMS instance with default adapters
Uses MemoryStorage and FlatIndex.
For production, use Arms::with_adapters with appropriate backends.
Sourcepub fn with_adapters(
config: ArmsConfig,
storage: Box<dyn Place>,
index: Box<dyn Near>,
) -> Self
pub fn with_adapters( config: ArmsConfig, storage: Box<dyn Place>, index: Box<dyn Near>, ) -> Self
Create with custom adapters
Sourcepub fn config(&self) -> &ArmsConfig
pub fn config(&self) -> &ArmsConfig
Get the configuration
Sourcepub fn dimensionality(&self) -> usize
pub fn dimensionality(&self) -> usize
Get the dimensionality of this space
Sourcepub fn place(&mut self, point: Point, blob: Blob) -> PlaceResult<Id>
pub fn place(&mut self, point: Point, blob: Blob) -> PlaceResult<Id>
Place a point in the space
The point will be normalized if configured to do so. Returns the assigned ID.
Sourcepub fn place_batch(&mut self, items: Vec<(Point, Blob)>) -> Vec<PlaceResult<Id>> ⓘ
pub fn place_batch(&mut self, items: Vec<(Point, Blob)>) -> Vec<PlaceResult<Id>> ⓘ
Place multiple points at once
Sourcepub fn remove(&mut self, id: Id) -> Option<PlacedPoint>
pub fn remove(&mut self, id: Id) -> Option<PlacedPoint>
Remove a point from the space
Sourcepub fn get(&self, id: Id) -> Option<&PlacedPoint>
pub fn get(&self, id: Id) -> Option<&PlacedPoint>
Get a point by ID
Sourcepub fn near(&self, query: &Point, k: usize) -> NearResult<Vec<SearchResult>>
pub fn near(&self, query: &Point, k: usize) -> NearResult<Vec<SearchResult>>
Find k nearest points to query
Sourcepub fn within(
&self,
query: &Point,
threshold: f32,
) -> NearResult<Vec<SearchResult>>
pub fn within( &self, query: &Point, threshold: f32, ) -> NearResult<Vec<SearchResult>>
Find all points within threshold
Sourcepub fn near_with_data(
&self,
query: &Point,
k: usize,
) -> NearResult<Vec<(&PlacedPoint, f32)>>
pub fn near_with_data( &self, query: &Point, k: usize, ) -> NearResult<Vec<(&PlacedPoint, f32)>>
Find and retrieve k nearest points (with full data)
Sourcepub fn merge(&self, points: &[Point]) -> Point
pub fn merge(&self, points: &[Point]) -> Point
Merge multiple points into one using the configured merge function
Sourcepub fn size_bytes(&self) -> usize
pub fn size_bytes(&self) -> usize
Get storage size in bytes
Auto Trait Implementations§
impl Freeze for Arms
impl !RefUnwindSafe for Arms
impl Send for Arms
impl Sync for Arms
impl Unpin for Arms
impl !UnwindSafe for Arms
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