pub trait Stream<A>where
A: Arguments,{
type Output: 'static;
// Required methods
fn search(&mut self, args: A::Search<'_>) -> Result<Self::Output>;
fn insert(&mut self, args: A::Insert<'_>) -> Result<Self::Output>;
fn replace(&mut self, args: A::Replace<'_>) -> Result<Self::Output>;
fn delete(&mut self, args: A::Delete<'_>) -> Result<Self::Output>;
fn maintain(&mut self, args: A::Maintain<'_>) -> Result<Self::Output>;
fn needs_maintenance(&mut self) -> bool;
}Expand description
A streaming interface for performing dynamic (streaming) operations on an index.
Streams are characterized by five operations:
search: This is, after all, the whole reason for building an index.insert: Insert new points into the index that do not already exist.replace: Replace existing points in the index with new data.delete: Remove points from the index.maintain: Perform maintenance operations on the index. Examples may include fully removing deleted points from internal references.
This trait is parameterized by an Arguments proxy trait, which defines the
argument types for each of the operations. The motivation here is to allow nesting
of Stream implementations that progressively modify or adapt the arguments
for better code reuse. An example of this is
[crate::streaming::executors::bigann::WithData], which is a stream layer adapting
the raw ranges used by [crate::streaming::executors::bigann::RunBook] into
actual data slices.
Runners for Streams use the Executor trait to invoke the stream operations
in a structured way.
Required Associated Types§
Required Methods§
Sourcefn replace(&mut self, args: A::Replace<'_>) -> Result<Self::Output>
fn replace(&mut self, args: A::Replace<'_>) -> Result<Self::Output>
Perform a replace operation.
Sourcefn maintain(&mut self, args: A::Maintain<'_>) -> Result<Self::Output>
fn maintain(&mut self, args: A::Maintain<'_>) -> Result<Self::Output>
Perform a maintain operation.
Sourcefn needs_maintenance(&mut self) -> bool
fn needs_maintenance(&mut self) -> bool
Indicate whether or not maintenance is needed. Executor implementations
are responsible periodically checking this.