pub trait MaxSimElement:
Sealed
+ Sized
+ Copy
+ Send
+ Sync
+ 'static {
type Score: Copy + Default + PartialEq + Debug;
const NO_MATCH: Self::Score;
// Required method
fn build<E: Erase<Self>>(
isa: MaxSimIsa,
query: MatRef<'_, Standard<Self>>,
erase: E,
) -> Result<E::Output, BuildMaxSimError>;
}Expand description
Scalar element types accepted by build_max_sim.
Sealed: external crates cannot add impls. Quantized representations
(PQ, SQ, packed sub-byte) are intentionally excluded — they need
codebook/scale state that MatRef<'_, Standard<Self>> can’t carry.
Required Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn build<E: Erase<Self>>(
isa: MaxSimIsa,
query: MatRef<'_, Standard<Self>>,
erase: E,
) -> Result<E::Output, BuildMaxSimError>
fn build<E: Erase<Self>>( isa: MaxSimIsa, query: MatRef<'_, Standard<Self>>, erase: E, ) -> Result<E::Output, BuildMaxSimError>
Build the concrete kernel for this element type and hand it to
erase.erase(...).
§Errors
Returns BuildMaxSimError::NotSupported when the requested ISA cannot
run on this build (e.g. AVX-512 unavailable; aarch64 on x86_64), and
BuildMaxSimError::DimTooLarge when an i8 query has more than
131_071 dimensions, beyond which i32 scores could overflow.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".