pub trait VectorRead: Send + Sync {
// Required methods
fn check_control(
&self,
control: &StorageReadControl,
) -> StorageBackendResult<()>;
fn dimensions(&self) -> u32;
fn next_document_after(
&self,
after: Option<DocId>,
control: &StorageReadControl,
) -> StorageBackendResult<Option<DocId>>;
fn document_vector_count(
&self,
document: DocId,
control: &StorageReadControl,
) -> StorageBackendResult<u64>;
fn read_vector(
&self,
document: DocId,
ordinal: u32,
control: &StorageReadControl,
) -> StorageBackendResult<Option<BudgetedVec<f32>>>;
// Provided method
fn corpus_fingerprint(
&self,
control: &StorageReadControl,
) -> StorageBackendResult<Option<[u8; 32]>> { ... }
}Expand description
A fixed canonical field view. Owners retain their original visibility, allowance and cancellation. Metadata enumeration never decodes coordinates; a point read owns at most one vector and releases provider locks before returning. This interface makes no claim about physical index lineage or mutation origins.
Required Methods§
fn check_control( &self, control: &StorageReadControl, ) -> StorageBackendResult<()>
fn dimensions(&self) -> u32
fn next_document_after( &self, after: Option<DocId>, control: &StorageReadControl, ) -> StorageBackendResult<Option<DocId>>
Sourcefn document_vector_count(
&self,
document: DocId,
control: &StorageReadControl,
) -> StorageBackendResult<u64>
fn document_vector_count( &self, document: DocId, control: &StorageReadControl, ) -> StorageBackendResult<u64>
Validate contiguous ordinal keys and return their count. Missing and explicitly empty tensors both have zero vectors.
Sourcefn read_vector(
&self,
document: DocId,
ordinal: u32,
control: &StorageReadControl,
) -> StorageBackendResult<Option<BudgetedVec<f32>>>
fn read_vector( &self, document: DocId, ordinal: u32, control: &StorageReadControl, ) -> StorageBackendResult<Option<BudgetedVec<f32>>>
Read one ordinal without invoking a caller while a provider read lock is held. Absent ordinals return None; malformed values fail.
Provided Methods§
Sourcefn corpus_fingerprint(
&self,
control: &StorageReadControl,
) -> StorageBackendResult<Option<[u8; 32]>>
fn corpus_fingerprint( &self, control: &StorageReadControl, ) -> StorageBackendResult<Option<[u8; 32]>>
Trustworthy identity of this complete fixed field, obtained from retained metadata. None means fixed-model reuse cannot be verified; callers must not replace it with a user-supplied label.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".