Trait IsNormalized2D

Source
pub trait IsNormalized2D: Sized + Is2D {
    // Required method
    fn new<P>(p: P) -> Result<Self>
       where P: Is2D;

    // Provided methods
    fn norm_x() -> Self { ... }
    fn norm_y() -> Self { ... }
    fn norm_x_neg() -> Self { ... }
    fn norm_y_neg() -> Self { ... }
}
Expand description

IsNormalized2D is a trait used for types which are positioned within the 2D space and normalized

Required Methods§

Source

fn new<P>(p: P) -> Result<Self>
where P: Is2D,

Should construct a new object and only fail if it can’t be normalized

Provided Methods§

Source

fn norm_x() -> Self

Returns a new normalized object which only points in the positive x-Direction

Source

fn norm_y() -> Self

Returns a new normalized object which only points in the positive y-Direction

Source

fn norm_x_neg() -> Self

Returns a new normalized object which only points in the negative x-Direction

Source

fn norm_y_neg() -> Self

Returns a new normalized object which only points in the negative y-Direction

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§