pub enum ShapeBox {
    Line(Drawable<Line>),
    Rect(Drawable<Rect>),
    Triangle(Drawable<Triangle>),
    Circle(Drawable<Circle>),
    Ellipse(Drawable<Ellipse>),
    Polygon(Drawable<Polygon>),
}
Expand description

Represents one of the shapes from graphics-shapes so they be used in a collection with generic or type issues

Variants§

Implementations§

source§

impl ShapeBox

source

pub fn with_translation<P: Into<Coord>>(&self, delta: P) -> ShapeBox

source§

impl ShapeBox

source

pub fn with_move<P: Into<Coord>>(&self, xy: P) -> ShapeBox

source§

impl ShapeBox

source

pub fn with_scale(&self, scale: f32) -> ShapeBox

source§

impl ShapeBox

source

pub fn with_rotation(&self, degrees: isize) -> ShapeBox

source§

impl ShapeBox

source

pub fn with_scale_around<P: Into<Coord>>( &self, scale: f32, center: P ) -> ShapeBox

source§

impl ShapeBox

source

pub fn with_rotation_around<P: Into<Coord>>( &self, degrees: isize, center: P ) -> ShapeBox

source§

impl ShapeBox

source

pub fn left(&self) -> isize

source

pub fn top(&self) -> isize

source

pub fn bottom(&self) -> isize

source

pub fn right(&self) -> isize

source

pub fn center(&self) -> Coord

Trait Implementations§

source§

impl Clone for ShapeBox

source§

fn clone(&self) -> ShapeBox

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for ShapeBox

source§

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

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

impl<S: Clone> From<Drawable<S>> for ShapeBoxwhere ShapeBox: FromDrawable<S>,

source§

fn from(value: Drawable<S>) -> Self

Converts to this type from the input type.
source§

impl FromDrawable<Circle> for ShapeBox

source§

impl FromDrawable<Ellipse> for ShapeBox

source§

impl FromDrawable<Line> for ShapeBox

source§

impl FromDrawable<Polygon> for ShapeBox

source§

impl FromDrawable<Rect> for ShapeBox

source§

impl FromDrawable<Triangle> for ShapeBox

source§

impl FromShape<Circle> for ShapeBox

source§

fn from_shape(shape: Circle, draw_type: DrawType) -> ShapeBox

source§

impl FromShape<Ellipse> for ShapeBox

source§

fn from_shape(shape: Ellipse, draw_type: DrawType) -> ShapeBox

source§

impl FromShape<Line> for ShapeBox

source§

fn from_shape(shape: Line, draw_type: DrawType) -> ShapeBox

source§

impl FromShape<Polygon> for ShapeBox

source§

fn from_shape(shape: Polygon, draw_type: DrawType) -> ShapeBox

source§

impl FromShape<Rect> for ShapeBox

source§

fn from_shape(shape: Rect, draw_type: DrawType) -> ShapeBox

source§

impl FromShape<Triangle> for ShapeBox

source§

fn from_shape(shape: Triangle, draw_type: DrawType) -> ShapeBox

source§

impl PartialEq<ShapeBox> for ShapeBox

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Renderable<ShapeBox> for ShapeBox

source§

fn render(&self, graphics: &mut Graphics<'_>)

source§

impl StructuralPartialEq for ShapeBox

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.