Struct turtle::Size
[−]
[src]
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);
Fields
width: u32
The width in pixels
height: u32
The height in pixels
Trait Implementations
impl Debug for Size
[src]
impl Clone for Size
[src]
fn clone(&self) -> Size
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for Size
[src]
impl PartialEq for Size
[src]
fn eq(&self, __arg_0: &Size) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Size) -> bool
[src]
This method tests for !=
.
impl Eq for Size
[src]
impl Hash for Size
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more