[][src]Struct wfc::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[src]

pub fn try_new(
    width: u32,
    height: u32
) -> Result<Size, DimensionTooLargeForSize>
[src]

pub fn new(width: u32, height: u32) -> Size[src]

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

pub fn from_coord(coord: Coord) -> Result<Size, NegativeDimension>[src]

pub fn to_coord(self) -> Result<Coord, DimensionTooLargeForCoord>[src]

pub fn get(self, axis: Axis) -> u32[src]

pub fn get_mut(&mut self, axis: Axis) -> &mut u32[src]

pub fn with_axis<F>(self, axis: Axis, f: F) -> Size where
    F: FnMut(u32) -> u32
[src]

pub fn try_set(
    self,
    axis: Axis,
    value: u32
) -> Result<Size, DimensionTooLargeForSize>
[src]

pub fn set(self, axis: Axis, value: u32) -> Size[src]

pub fn try_set_in_place(
    &mut self,
    axis: Axis,
    value: u32
) -> Result<(), DimensionTooLargeForSize>
[src]

pub fn set_in_place(&mut self, axis: Axis, value: u32)[src]

pub fn try_new_axis(
    this_axis: u32,
    other_axis: u32,
    axis: Axis
) -> Result<Size, DimensionTooLargeForSize>
[src]

pub fn new_axis(this_axis: u32, other_axis: u32, axis: Axis) -> Size[src]

pub fn get_static<A>(self) -> u32 where
    A: StaticAxis
[src]

pub fn get_static_mut<A>(&mut self) -> &mut u32 where
    A: StaticAxis
[src]

pub fn with_static_axis<A, F>(self, f: F) -> Size where
    A: StaticAxis,
    F: FnMut(u32) -> u32
[src]

pub fn try_set_static<A>(
    self,
    value: u32
) -> Result<Size, DimensionTooLargeForSize> where
    A: StaticAxis
[src]

pub fn try_set_static_in_place<A>(
    &mut self,
    value: u32
) -> Result<(), DimensionTooLargeForSize> where
    A: StaticAxis
[src]

pub fn set_static<A>(self, value: u32) -> Size where
    A: StaticAxis
[src]

pub fn set_static_in_place<A>(&mut self, value: u32) where
    A: StaticAxis
[src]

pub fn try_new_static_axis<A>(
    this_axis: u32,
    other_axis: u32
) -> Result<Size, DimensionTooLargeForSize> where
    A: StaticAxis
[src]

pub fn new_static_axis<A>(this_axis: u32, other_axis: u32) -> Size where
    A: StaticAxis
[src]

pub fn width(self) -> u32[src]

Returns the width.

pub fn x(self) -> u32[src]

Alias for width.

pub fn height(self) -> u32[src]

Returns the height.

pub fn y(self) -> u32[src]

Alias for height.

pub fn count(self) -> usize[src]

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

Trait Implementations

impl Clone for Size[src]

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

Performs copy-assignment from source. Read more

impl PartialOrd<Size> for Size[src]

impl<'a> Div<u32> for &'a Size[src]

type Output = Size

The resulting type after applying the / operator.

impl Div<u32> for Size[src]

type Output = Size

The resulting type after applying the / operator.

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

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

impl Copy for Size[src]

impl Ord for Size[src]

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<'a> Add<&'a Size> for Coord[src]

type Output = Coord

The resulting type after applying the + operator.

impl<'a, 'b> Add<&'a Size> for &'b Size[src]

type Output = Size

The resulting type after applying the + operator.

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

type Output = Coord

The resulting type after applying the + operator.

impl<'a> Add<Size> for &'a Size[src]

type Output = Size

The resulting type after applying the + operator.

impl<'a> Add<&'a Size> for Size[src]

type Output = Size

The resulting type after applying the + operator.

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

type Output = Coord

The resulting type after applying the + operator.

impl Add<Size> for Size[src]

type Output = Size

The resulting type after applying the + operator.

impl<'a> Add<Size> for &'a Coord[src]

type Output = Coord

The resulting type after applying the + operator.

impl Add<Size> for Coord[src]

type Output = Coord

The resulting type after applying the + operator.

impl Add<Coord> for Size[src]

type Output = Coord

The resulting type after applying the + operator.

impl<'a> Add<&'a Coord> for Size[src]

type Output = Coord

The resulting type after applying the + operator.

impl<'a> Add<Coord> for &'a Size[src]

type Output = Coord

The resulting type after applying the + operator.

impl Default for Size[src]

impl Eq for Size[src]

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

type Output = Coord

The resulting type after applying the - operator.

impl<'a> Sub<Size> for &'a Coord[src]

type Output = Coord

The resulting type after applying the - operator.

impl<'a> Sub<&'a Size> for Coord[src]

type Output = Coord

The resulting type after applying the - operator.

impl Sub<Coord> for Size[src]

type Output = Coord

The resulting type after applying the - operator.

impl<'a> Sub<&'a Coord> for Size[src]

type Output = Coord

The resulting type after applying the - operator.

impl<'a> Sub<&'a Size> for Size[src]

type Output = Size

The resulting type after applying the - operator.

impl Sub<Size> for Size[src]

type Output = Size

The resulting type after applying the - operator.

impl<'a> Sub<Coord> for &'a Size[src]

type Output = Coord

The resulting type after applying the - operator.

impl Sub<Size> for Coord[src]

type Output = Coord

The resulting type after applying the - operator.

impl<'a> Sub<Size> for &'a Size[src]

type Output = Size

The resulting type after applying the - operator.

impl<'a, 'b> Sub<&'a Size> for &'b Size[src]

type Output = Size

The resulting type after applying the - operator.

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

type Output = Coord

The resulting type after applying the - operator.

impl Hash for Size[src]

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 From<(u32, u32)> for Size[src]

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

impl<'a> Mul<u32> for &'a Size[src]

type Output = Size

The resulting type after applying the * operator.

impl Mul<u32> for Size[src]

type Output = Size

The resulting type after applying the * operator.

impl PartialEq<Size> for Size[src]

impl Debug for Size[src]

Auto Trait Implementations

impl Send for Size

impl Sync for Size

Blanket Implementations

impl<T> From for T[src]

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, U> TryFrom for T where
    U: Into<T>, 
[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> BorrowMut for T where
    T: ?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.