#[repr(transparent)]pub struct NaVector2<T: Scalar>(pub Vector2<T>);Expand description
Shape-only adapter for nalgebra::Vector2<T>.
#[repr(transparent)] so &NaVector2<T> is layout-compatible
with &nalgebra::Vector2<T>. Pins Cs = Cartesian, DIM = 2.
§Examples
use geometry_adapt_nalgebra::NaVector2;
use geometry_algorithm::distance;
use nalgebra::Vector2;
let a = NaVector2::new(Vector2::new(0.0_f64, 0.0));
let b = NaVector2::new(Vector2::new(3.0_f64, 4.0));
assert_eq!(distance(&a, &b), 5.0);Tuple Fields§
§0: Vector2<T>Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for NaVector2<T>where
T: Freeze,
impl<T> RefUnwindSafe for NaVector2<T>where
T: RefUnwindSafe,
impl<T> Send for NaVector2<T>where
T: Send,
impl<T> Sync for NaVector2<T>where
T: Sync,
impl<T> Unpin for NaVector2<T>where
T: Unpin,
impl<T> UnsafeUnpin for NaVector2<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for NaVector2<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
impl<T> SameAs<T> for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.