pub trait MaxSimKernel<T: Copy>:
Send
+ Sync
+ Debug {
// Required methods
fn nrows(&self) -> usize;
fn compute_max_sim(
&self,
doc: MatRef<'_, Standard<T>>,
scores: &mut [f32],
) -> Result<(), MaxSimError>;
}Expand description
Object-safe interface for computing per-query MaxSim scores.
Required Methods§
Sourcefn compute_max_sim(
&self,
doc: MatRef<'_, Standard<T>>,
scores: &mut [f32],
) -> Result<(), MaxSimError>
fn compute_max_sim( &self, doc: MatRef<'_, Standard<T>>, scores: &mut [f32], ) -> Result<(), MaxSimError>
Compute per-query MaxSim scores into scores. On zero docs, fills
every slot with f32::MAX.
§Errors
MaxSimError::InvalidBufferLength if scores.len() != self.nrows().
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".