[−][src]Enum geo::algorithm::dimensions::Dimensions
Geometries can have 0, 1, or two dimensions. Or, in the case of an empty
geometry, a special Empty
dimensionality.
Examples
use geo_types::{Point, Rect, line_string}; use geo::algorithm::dimensions::{HasDimensions, Dimensions}; let point = Point::new(0.0, 5.0); let line_string = line_string![(x: 0.0, y: 0.0), (x: 5.0, y: 5.0), (x: 0.0, y: 5.0)]; let rect = Rect::new((0.0, 0.0), (10.0, 10.0)); assert_eq!(Dimensions::ZeroDimensional, point.dimensions()); assert_eq!(Dimensions::OneDimensional, line_string.dimensions()); assert_eq!(Dimensions::TwoDimensional, rect.dimensions()); assert!(point.dimensions() < line_string.dimensions()); assert!(rect.dimensions() > line_string.dimensions());
Variants
Some geometries, like a MultiPoint
or GeometryColletion
may have no elements - thus no
dimensions. Note that this is distinct from being ZeroDimensional
, like a Point
.
Dimension of a point
Dimension of a line or curve
Dimension of a surface
Trait Implementations
impl Clone for Dimensions
[src]
pub fn clone(&self) -> Dimensions
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Dimensions
[src]
impl Debug for Dimensions
[src]
impl Eq for Dimensions
[src]
impl Ord for Dimensions
[src]
pub fn cmp(&self, other: &Dimensions) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Dimensions> for Dimensions
[src]
pub fn eq(&self, other: &Dimensions) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Dimensions> for Dimensions
[src]
pub fn partial_cmp(&self, other: &Dimensions) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for Dimensions
[src]
impl StructuralPartialEq for Dimensions
[src]
Auto Trait Implementations
impl RefUnwindSafe for Dimensions
impl Send for Dimensions
impl Sync for Dimensions
impl Unpin for Dimensions
impl UnwindSafe for Dimensions
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,
pub 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> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,