logo
pub struct KnearestClosure<B, C, D, E> {
    pub broad: B,
    pub fine: C,
    pub xline: D,
    pub yline: E,
}
Expand description

Construct an object that implements Knearest from closures. We pass the tree so that we can infer the type of T.

fine is a function that gives the true distance between the point and the specified tree element.

broad is a function that gives the distance between the point and the closest point of a axis aligned rectangle. This function is used as a conservative estimate to prune out elements which minimizes how often the fine function gets called.

xline is a function that gives the distance between the point and a axis aligned line that was a fixed x value and spans the y values.

yline is a function that gives the distance between the point and a axis aligned line that was a fixed x value and spans the y values.

acc is a user defined object that is passed to every call to either the fine or broad functions.

Container of closures that implements Knearest

Fields

broad: Bfine: Cxline: Dyline: E

Trait Implementations

User define distance function from a point to an axis aligned line of infinite length.

User defined inexpensive distance function that that can be overly conservative. It may be that the precise distance function is fast enough, in which case you can simply return None. If None is desired, every call to this function for a particular element must always return None. Read more

User defined expensive distance function. Here the user can return fine-grained distance of the shape contained in T instead of its bounding box. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.