[−][src]Struct vadeen_osm::geo::Boundary
Represents coordinate boundary, i.e. min and max latitude and longitude.
Examples
// Default creates boundaries cover the whole world let bounds = Boundary::default(); assert_eq!(bounds.min.lat(), -90.0); assert_eq!(bounds.min.lon(), -180.0); assert_eq!(bounds.max.lat(), 90.0); assert_eq!(bounds.max.lon(), 180.0); // Inverted boundary is same as default, but with max as min and min as max. // Useful when the boundary is intended to be dynamically expanded. let mut bounds = Boundary::inverted(); assert_eq!(bounds.min.lat(), 90.0); assert_eq!(bounds.min.lon(), 180.0); assert_eq!(bounds.max.lat(), -90.0); assert_eq!(bounds.max.lon(), -180.0); bounds.expand((10.0, 20.0).into()); bounds.expand((30.0, 40.0).into()); assert_eq!(bounds.min.lat(), 10.0); assert_eq!(bounds.min.lon(), 20.0); assert_eq!(bounds.max.lat(), 30.0); assert_eq!(bounds.max.lon(), 40.0);
Fields
min: Coordinate
max: Coordinate
freeze: bool
Methods
impl Boundary
[src]
pub fn inverted() -> Self
[src]
Same as default()
but inverted so min contains max and max contains min.
Used when a boundary are intended to be expanded by coordinates.
pub fn expand(&mut self, c: Coordinate)
[src]
Expand boundary if necessary to include a coordinate.
Trait Implementations
impl Clone for Boundary
[src]
impl Debug for Boundary
[src]
impl Default for Boundary
[src]
impl Eq for Boundary
[src]
impl PartialEq<Boundary> for Boundary
[src]
impl StructuralEq for Boundary
[src]
impl StructuralPartialEq for Boundary
[src]
Auto Trait Implementations
impl RefUnwindSafe for Boundary
impl Send for Boundary
impl Sync for Boundary
impl Unpin for Boundary
impl UnwindSafe for Boundary
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,