Arms

Struct Arms 

Source
pub struct Arms { /* private fields */ }
Expand description

The main ARMS engine

Orchestrates storage and indexing with a unified API.

Implementations§

Source§

impl Arms

Source

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.

Source

pub fn with_adapters( config: ArmsConfig, storage: Box<dyn Place>, index: Box<dyn Near>, ) -> Self

Create with custom adapters

Source

pub fn config(&self) -> &ArmsConfig

Get the configuration

Source

pub fn dimensionality(&self) -> usize

Get the dimensionality of this space

Source

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.

Source

pub fn place_batch(&mut self, items: Vec<(Point, Blob)>) -> Vec<PlaceResult<Id>>

Place multiple points at once

Source

pub fn remove(&mut self, id: Id) -> Option<PlacedPoint>

Remove a point from the space

Source

pub fn get(&self, id: Id) -> Option<&PlacedPoint>

Get a point by ID

Source

pub fn contains(&self, id: Id) -> bool

Check if a point exists

Source

pub fn len(&self) -> usize

Get the number of stored points

Source

pub fn is_empty(&self) -> bool

Check if the space is empty

Source

pub fn clear(&mut self)

Clear all points

Source

pub fn near(&self, query: &Point, k: usize) -> NearResult<Vec<SearchResult>>

Find k nearest points to query

Source

pub fn within( &self, query: &Point, threshold: f32, ) -> NearResult<Vec<SearchResult>>

Find all points within threshold

Source

pub fn near_with_data( &self, query: &Point, k: usize, ) -> NearResult<Vec<(&PlacedPoint, f32)>>

Find and retrieve k nearest points (with full data)

Source

pub fn merge(&self, points: &[Point]) -> Point

Merge multiple points into one using the configured merge function

Source

pub fn proximity(&self, a: &Point, b: &Point) -> f32

Compute proximity between two points

Source

pub fn size_bytes(&self) -> usize

Get storage size in bytes

Source

pub fn index_len(&self) -> usize

Get index stats

Source

pub fn is_ready(&self) -> bool

Check if index is ready

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.