pub enum WeightHeuristic {
Haversine,
Custom {
custom_weight_type: CustomWeightType,
},
}Variants§
Haversine
computes a weight directly as the haversine distance estimation between trip origin and destination, in kilometers.
Custom
user provides a field of some custom weight type that is used directly for weight estimates.
Fields
§
custom_weight_type: CustomWeightTypeImplementations§
Source§impl WeightHeuristic
impl WeightHeuristic
pub fn estimate_weight(&self, query: &Value) -> Result<f64, InputPluginError>
Trait Implementations§
Source§impl Clone for WeightHeuristic
impl Clone for WeightHeuristic
Source§fn clone(&self) -> WeightHeuristic
fn clone(&self) -> WeightHeuristic
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WeightHeuristic
impl Debug for WeightHeuristic
Source§impl<'de> Deserialize<'de> for WeightHeuristic
impl<'de> Deserialize<'de> for WeightHeuristic
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for WeightHeuristic
impl RefUnwindSafe for WeightHeuristic
impl Send for WeightHeuristic
impl Sync for WeightHeuristic
impl Unpin for WeightHeuristic
impl UnsafeUnpin for WeightHeuristic
impl UnwindSafe for WeightHeuristic
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more