Struct cognitive_qualia::defs::Position [] [src]

#[repr(C)]
pub struct Position { pub x: isize, pub y: isize, }

Type defining position, point coordinates or 2D vector.

Fields

Methods

impl Position
[src]

Position constructor.

Check if Position points at (0,0).

Check if position is inside given area.

Return new position scaled by given factor.

Returns opposite position (with negated coordinates).

Return new position casted into given area. - if self if inside area - return copy of self - if self if outside area - return closes point inside area

Trait Implementations

impl Clone for Position
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Position
[src]

impl Debug for Position
[src]

Formats the value using the given formatter.

impl Eq for Position
[src]

impl PartialEq for Position
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Default for Position
[src]

Returns the "default value" for a type. Read more

impl Add for Position
[src]

The resulting type after applying the + operator

The method for the + operator

impl Sub for Position
[src]

The resulting type after applying the - operator

The method for the - operator