pub struct Vector2 { /* private fields */ }Expand description
A 2D displacement with finite f64 components.
Vector2 can only be constructed via Vector2::new (or by
subtracting two Point2s), which reject NaN and infinite
components. Arithmetic between already-finite Vector2/Point2
values (+, -, scaling) does not re-validate its result — the same
convention every numeric type in Rust follows (e.g. f64 addition
doesn’t return Result) — so it is possible, in principle, for two
astronomically large finite inputs to add to an infinite result. This
is not treated as a boundary: Point2::new/Vector2::new are the
finiteness boundary (ADR-003), not every subsequent arithmetic op.
Implementations§
Trait Implementations§
impl Copy for Vector2
impl StructuralPartialEq for Vector2
Auto Trait Implementations§
impl Freeze for Vector2
impl RefUnwindSafe for Vector2
impl Send for Vector2
impl Sync for Vector2
impl Unpin for Vector2
impl UnsafeUnpin for Vector2
impl UnwindSafe for Vector2
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