pub struct GeoLine<T: CoordNum>(/* private fields */);Expand description
Shape-only adapter for geo_types::Line<T>.
Endpoint 0 is start, endpoint 1 is end; 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::Line;
use geometry_adapt_geo_types::GeoLine;
use geometry_trait::{segment_start, segment_end, Point};
let line = GeoLine::new(Line::new((0.0_f64, 0.0), (3.0, 4.0)));
let a = segment_start(&line);
let b = segment_end(&line);
assert_eq!(a.get::<0>(), 0.0);
assert_eq!(b.get::<1>(), 4.0);Implementations§
Source§impl<T: CoordNum> GeoLine<T>
impl<T: CoordNum> GeoLine<T>
Sourcepub fn into_inner(self) -> Line<T>
pub fn into_inner(self) -> Line<T>
Recover the wrapped geo_types::Line.
§Examples
use geo_types::Line;
use geometry_adapt_geo_types::GeoLine;
let original = Line::new((0.0_f64, 0.0), (3.0, 4.0));
let line = GeoLine::new(original);
assert_eq!(line.into_inner(), original);Trait Implementations§
impl<T: Copy + CoordNum> Copy for GeoLine<T>
Source§impl<T: CoordinateScalar + CoordNum> IndexedAccess for GeoLine<T>
impl<T: CoordinateScalar + CoordNum> IndexedAccess for GeoLine<T>
impl<T: CoordinateScalar + CoordNum> Segment for GeoLine<T>
impl<T: PartialEq + CoordNum> StructuralPartialEq for GeoLine<T>
Auto Trait Implementations§
impl<T> Freeze for GeoLine<T>where
T: Freeze,
impl<T> RefUnwindSafe for GeoLine<T>where
T: RefUnwindSafe,
impl<T> Send for GeoLine<T>where
T: Send,
impl<T> Sync for GeoLine<T>where
T: Sync,
impl<T> Unpin for GeoLine<T>where
T: Unpin,
impl<T> UnsafeUnpin for GeoLine<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for GeoLine<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