Trait KnownDist

Source
pub trait KnownDist: Sized {
    type DistFn: DistFn<Self> + Sized;

    // Required method
    fn dist_fn() -> Self::DistFn;
}
Expand description

Trait describing a type where a default distance function is known.

Required Associated Types§

Source

type DistFn: DistFn<Self> + Sized

The known distance function for Self.

Required Methods§

Source

fn dist_fn() -> Self::DistFn

Return an instance of DistFn.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl KnownDist for f32

Source§

impl KnownDist for f64

Source§

impl KnownDist for i8

Source§

impl KnownDist for i16

Source§

impl KnownDist for i32

Source§

impl KnownDist for i64

Source§

impl KnownDist for isize

Source§

impl KnownDist for u8

Source§

impl KnownDist for u16

Source§

impl KnownDist for u32

Source§

impl KnownDist for u64

Source§

impl KnownDist for usize

Source§

impl KnownDist for String

Source§

type DistFn = Hamming

The fastest distance function for strings.

Source§

fn dist_fn() -> Hamming

Source§

impl<'a> KnownDist for &'a str

Source§

type DistFn = Hamming

The fastest distance function for strings.

Source§

fn dist_fn() -> Hamming

Implementors§