[][src]Struct turtle::Size

pub struct Size {
    pub width: u32,
    pub height: u32,

Represents a size

A Size can be converted from either a tuple or array. These forms are often more ergonomic than using the Size struct on its own. The set_size() method accepts either form (without needing to use into()). See that method's documentation for more information.

assert_eq!(Size {width: 640, height: 480}, (640, 480).into());
assert_eq!(Size {width: 640, height: 480}, [640, 480].into());

You can access the width and height fields directly on any Size struct.

let size: Size = (800, 600).into();
assert_eq!(size.width, 800);
assert_eq!(size.height, 600);


width: u32

The width in pixels

height: u32

The height in pixels

Trait Implementations

impl From<(u32, u32)> for Size[src]

impl From<[u32; 2]> for Size[src]

impl Clone for Size[src]

impl Copy for Size[src]

impl Eq for Size[src]

impl PartialEq<Size> for Size[src]

impl Debug for Size[src]

impl Hash for Size[src]

impl StructuralPartialEq for Size[src]

impl StructuralEq for Size[src]

Auto Trait Implementations

impl Send for Size

impl Sync for Size

impl Unpin for Size

impl UnwindSafe for Size

impl RefUnwindSafe for Size

Blanket Implementations

impl<T> From<T> for T[src]

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

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

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

type Error = !

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

impl<T> SetParameter for T