[]Struct prototty_wasm::Size

pub struct Size { /* fields omitted */ }

A size cannot be created which would contain un-addressable cells. That is, the maximum size has a width and height of one greater than the maximum i32.

Methods

impl Size

pub fn new(x: u32, y: u32) -> Size

Creates a new Size. Panics if x or y is greater than ::std::i32::MAX as u32 + 1.

pub fn width(self) -> u32

Returns the width.

pub fn x(self) -> u32

Alias for width.

pub fn height(self) -> u32

Returns the height.

pub fn y(self) -> u32

Alias for height.

pub fn count(self) -> usize

Return the number of cells in a 2D grid of this size.

Trait Implementations

impl Hash for Size

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl PartialOrd<Size> for Size

impl Copy for Size

impl<'a> Div<u32> for &'a Size

type Output = Size

The resulting type after applying the / operator.

impl Div<u32> for Size

type Output = Size

The resulting type after applying the / operator.

impl Clone for Size

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Default for Size

impl Add<Size> for Coord

type Output = Coord

The resulting type after applying the + operator.

impl<'a> Add<&'a Size> for Size

type Output = Size

The resulting type after applying the + operator.

impl<'a> Add<Coord> for &'a Size

type Output = Coord

The resulting type after applying the + operator.

impl<'a, 'b> Add<&'a Size> for &'b Coord

type Output = Coord

The resulting type after applying the + operator.

impl<'a, 'b> Add<&'a Size> for &'b Size

type Output = Size

The resulting type after applying the + operator.

impl<'a> Add<Size> for &'a Coord

type Output = Coord

The resulting type after applying the + operator.

impl<'a, 'b> Add<&'a Coord> for &'b Size

type Output = Coord

The resulting type after applying the + operator.

impl Add<Size> for Size

type Output = Size

The resulting type after applying the + operator.

impl Add<Coord> for Size

type Output = Coord

The resulting type after applying the + operator.

impl<'a> Add<Size> for &'a Size

type Output = Size

The resulting type after applying the + operator.

impl<'a> Add<&'a Coord> for Size

type Output = Coord

The resulting type after applying the + operator.

impl<'a> Add<&'a Size> for Coord

type Output = Coord

The resulting type after applying the + operator.

impl Ord for Size

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

impl Eq for Size

impl PartialEq<Size> for Size

impl<'a> Sub<Coord> for &'a Size

type Output = Coord

The resulting type after applying the - operator.

impl<'a> Sub<Size> for &'a Coord

type Output = Coord

The resulting type after applying the - operator.

impl Sub<Coord> for Size

type Output = Coord

The resulting type after applying the - operator.

impl<'a> Sub<&'a Coord> for Size

type Output = Coord

The resulting type after applying the - operator.

impl<'a, 'b> Sub<&'a Coord> for &'b Size

type Output = Coord

The resulting type after applying the - operator.

impl<'a> Sub<Size> for &'a Size

type Output = Size

The resulting type after applying the - operator.

impl Sub<Size> for Coord

type Output = Coord

The resulting type after applying the - operator.

impl<'a, 'b> Sub<&'a Size> for &'b Size

type Output = Size

The resulting type after applying the - operator.

impl<'a> Sub<&'a Size> for Coord

type Output = Coord

The resulting type after applying the - operator.

impl Sub<Size> for Size

type Output = Size

The resulting type after applying the - operator.

impl<'a> Sub<&'a Size> for Size

type Output = Size

The resulting type after applying the - operator.

impl<'a, 'b> Sub<&'a Size> for &'b Coord

type Output = Coord

The resulting type after applying the - operator.

impl<T> MulAssign<T> for Size where
    Size: Mul<T>,
    <Size as Mul<T>>::Output == Size

impl Debug for Size

impl<'a> Mul<u32> for &'a Size

type Output = Size

The resulting type after applying the * operator.

impl Mul<u32> for Size

type Output = Size

The resulting type after applying the * operator.

impl From<[u32; 2]> for Size

impl From<(u32, u32)> for Size

impl<T> DivAssign<T> for Size where
    Size: Div<T>,
    <Size as Div<T>>::Output == Size

Auto Trait Implementations

impl Send for Size

impl Sync for Size

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

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

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]