[][src]Struct space::Neighbor

pub struct Neighbor {
    pub index: usize,
    pub distance: u32,
}

For k-NN algorithms to return neighbors.

Fields

index: usize

Index of the neighbor in the search space.

distance: u32

The distance of the neighbor from the search feature.

Methods

impl Neighbor[src]

pub fn invalid() -> Self[src]

Generates an invalid (on purpose) neighbor to initialize an array.

Generated neighbor has maximum index and distance. This is to ensure that software does not silently fail as an out-of-bounds will occur if an invalid neighbor is used.

Trait Implementations

impl Clone for Neighbor[src]

impl Copy for Neighbor[src]

impl Debug for Neighbor[src]

impl Eq for Neighbor[src]

impl Hash for Neighbor[src]

impl Ord for Neighbor[src]

impl PartialEq<Neighbor> for Neighbor[src]

impl PartialOrd<Neighbor> for Neighbor[src]

impl StructuralEq for Neighbor[src]

impl StructuralPartialEq for Neighbor[src]

Auto Trait Implementations

impl Send for Neighbor

impl Sync for Neighbor

impl Unpin for Neighbor

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.