Skip to main content

GridShape

Trait GridShape 

Source
pub trait GridShape:
    ShapeClone
    + Sync
    + Send
    + 'static {
    // Required methods
    fn iter(&self) -> GridShapeIterator ;
    fn pos(&self) -> IVec2;
    fn set_pos(&mut self, pos: IVec2);
    fn bounds(&self) -> GridRect;
}
Expand description

A trait for accessing the points of shapes on a grid.

Required Methods§

Source

fn iter(&self) -> GridShapeIterator

Iterate over all the points contained within the grid shape.

Source

fn pos(&self) -> IVec2

The position of the grid shape.

Source

fn set_pos(&mut self, pos: IVec2)

Set the position of the grid shape without changing it’s size.

Source

fn bounds(&self) -> GridRect

Get a rect encompassing the entire shape.

Trait Implementations§

Source§

impl Clone for Box<dyn GridShape>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Box<dyn GridShape>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Box<dyn GridShape>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§