pub struct Distance { /* private fields */ }Expand description
A distance with an explicit unit — e.g. Distance::km(12.0). Renders to the
OpenSearch distance string ("12km"), so a malformed radius ("12 km", a
typo’d unit) can’t reach the query.
Implementations§
Source§impl Distance
impl Distance
Sourcepub fn new(value: f64, unit: DistanceUnit) -> Self
pub fn new(value: f64, unit: DistanceUnit) -> Self
value in unit.
Sourcepub fn centimeters(value: f64) -> Self
pub fn centimeters(value: f64) -> Self
Centimeters.
Sourcepub fn millimeters(value: f64) -> Self
pub fn millimeters(value: f64) -> Self
Millimeters.
Sourcepub fn nautical_miles(value: f64) -> Self
pub fn nautical_miles(value: f64) -> Self
Nautical miles.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Distance
impl RefUnwindSafe for Distance
impl Send for Distance
impl Sync for Distance
impl Unpin for Distance
impl UnsafeUnpin for Distance
impl UnwindSafe for Distance
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