pub struct GeoRect<T: CoordNum> { /* private fields */ }Expand description
Shape-only adapter for geo_types::Rect<T>.
Corner corner::MIN is the rectangle’s minimum, corner::MAX
its maximum; get_indexed::<I, 0> reads x and <I, 1> reads y.
The point type is GeoCoord<T>, matching the container wrappers.
§Examples
use geo_types::Rect;
use geometry_adapt_geo_types::GeoRect;
use geometry_trait::{box_min, box_max, Point};
let rect = GeoRect::new(Rect::new((0.0_f64, 0.0), (3.0, 4.0)));
assert_eq!(box_min(&rect).get::<0>(), 0.0);
assert_eq!(box_max(&rect).get::<1>(), 4.0);Implementations§
Source§impl<T: CoordNum> GeoRect<T>
impl<T: CoordNum> GeoRect<T>
Sourcepub fn into_inner(self) -> Rect<T>
pub fn into_inner(self) -> Rect<T>
Recover the wrapped geo_types::Rect.
§Examples
use geo_types::Rect;
use geometry_adapt_geo_types::GeoRect;
let original = Rect::new((0.0_f64, 0.0), (3.0, 4.0));
let rect = GeoRect::new(original);
assert_eq!(rect.into_inner(), original);Trait Implementations§
impl<T: CoordinateScalar + CoordNum> Box for GeoRect<T>
impl<T: Copy + CoordNum> Copy for GeoRect<T>
Source§impl<T: CoordinateScalar + CoordNum> IndexedAccess for GeoRect<T>
impl<T: CoordinateScalar + CoordNum> IndexedAccess for GeoRect<T>
impl<T: PartialEq + CoordNum> StructuralPartialEq for GeoRect<T>
Auto Trait Implementations§
impl<T> Freeze for GeoRect<T>where
T: Freeze,
impl<T> RefUnwindSafe for GeoRect<T>where
T: RefUnwindSafe,
impl<T> Send for GeoRect<T>where
T: Send,
impl<T> Sync for GeoRect<T>where
T: Sync,
impl<T> Unpin for GeoRect<T>where
T: Unpin,
impl<T> UnsafeUnpin for GeoRect<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for GeoRect<T>where
T: UnwindSafe,
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