[−][src]Struct turtle::Size
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 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]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
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>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,