struct HotBuffer {
points: Vec<BufferedPoint>,
}Expand description
A flat buffer for recent, not-yet-compacted points.
Supports brute-force search (scan all points). Fast for small N.
Fields§
§points: Vec<BufferedPoint>Implementations§
Source§impl HotBuffer
impl HotBuffer
fn new() -> Self
fn push( &mut self, entity_id: u64, timestamp: i64, vector: Vec<f32>, global_id: u32, )
fn len(&self) -> usize
fn is_empty(&self) -> bool
Sourcefn drain(&mut self) -> Vec<BufferedPoint>
fn drain(&mut self) -> Vec<BufferedPoint>
Drain all points from the buffer.
Sourcefn brute_force_search(
&self,
query: &[f32],
k: usize,
filter: &TemporalFilter,
metric: &dyn DistanceMetric,
) -> Vec<(u32, f32)>
fn brute_force_search( &self, query: &[f32], k: usize, filter: &TemporalFilter, metric: &dyn DistanceMetric, ) -> Vec<(u32, f32)>
Brute-force kNN search within the buffer.
Sourcefn trajectory(&self, entity_id: u64, filter: &TemporalFilter) -> Vec<(i64, u32)>
fn trajectory(&self, entity_id: u64, filter: &TemporalFilter) -> Vec<(i64, u32)>
Get trajectory points for an entity from the buffer.
Sourcefn find(&self, global_id: u32) -> Option<&BufferedPoint>
fn find(&self, global_id: u32) -> Option<&BufferedPoint>
Find a point by global ID.
Auto Trait Implementations§
impl Freeze for HotBuffer
impl RefUnwindSafe for HotBuffer
impl Send for HotBuffer
impl Sync for HotBuffer
impl Unpin for HotBuffer
impl UnwindSafe for HotBuffer
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 more