pub trait RecordStore: Send + Sync {
// Required methods
fn insert(&self, record: Record);
fn get(&self, id: RecordId) -> Option<Cow<'_, Record>>;
fn len(&self) -> usize;
// Provided methods
fn get_many(&self, ids: &[RecordId]) -> Vec<Option<Cow<'_, Record>>> { ... }
fn is_empty(&self) -> bool { ... }
}Expand description
Backing store for records used during ingestion and batch runs.
Required Methods§
Sourcefn insert(&self, record: Record)
fn insert(&self, record: Record)
Persist a record. Must be callable from the ingester background task.
Provided Methods§
Sourcefn get_many(&self, ids: &[RecordId]) -> Vec<Option<Cow<'_, Record>>>
fn get_many(&self, ids: &[RecordId]) -> Vec<Option<Cow<'_, Record>>>
Retrieve multiple records in one call (allows batch I/O optimisation).
The default impl calls get in a loop; override for bulk reads.
fn is_empty(&self) -> bool
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".