[−][src]Struct wfc_image::Size
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]
impl Size
pub fn try_new( | [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 | [src] |
pub fn try_set( | [src] |
pub fn set(self, axis: Axis, value: u32) -> Size | [src] |
pub fn try_set_in_place( | [src] |
pub fn set_in_place(&mut self, axis: Axis, value: u32) | [src] |
pub fn try_new_axis( | [src] |
pub fn new_axis(this_axis: u32, other_axis: u32, axis: Axis) -> Size | [src] |
pub fn get_static<A>(self) -> u32 where | [src] |
pub fn get_static_mut<A>(&mut self) -> &mut u32 where | [src] |
pub fn with_static_axis<A, F>(self, f: F) -> Size where | [src] |
pub fn try_set_static<A>( | [src] |
pub fn try_set_static_in_place<A>( | [src] |
pub fn set_static<A>(self, value: u32) -> Size where | [src] |
pub fn set_static_in_place<A>(&mut self, value: u32) where | [src] |
pub fn try_new_static_axis<A>( | [src] |
pub fn new_static_axis<A>(this_axis: u32, other_axis: u32) -> Size where | [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 PartialOrd<Size> for Size
[src]
impl PartialOrd<Size> for Size
fn partial_cmp(&self, other: &Size) -> Option<Ordering> | [src] |
fn lt(&self, other: &Size) -> bool | [src] |
fn le(&self, other: &Size) -> bool | [src] |
fn gt(&self, other: &Size) -> bool | [src] |
fn ge(&self, other: &Size) -> bool | [src] |
impl Hash for Size
[src]
impl Hash for Size
fn hash<__H>(&self, state: &mut __H) where | [src] |
fn hash_slice<H>(data: &[Self], state: &mut H) where | 1.3.0 [src] |
Feeds a slice of this type into the given [Hasher
]. Read more
impl Copy for Size
[src]
impl Copy for Size
impl<'a> Div<u32> for &'a Size
[src]
impl<'a> Div<u32> for &'a Size
type Output = Size
The resulting type after applying the /
operator.
fn div(self, rhs: u32) -> <&'a Size as Div<u32>>::Output | [src] |
impl Div<u32> for Size
[src]
impl Div<u32> for Size
type Output = Size
The resulting type after applying the /
operator.
fn div(self, rhs: u32) -> <Size as Div<u32>>::Output | [src] |
impl Clone for Size
[src]
impl Clone for Size
fn clone(&self) -> Size | [src] |
fn clone_from(&mut self, source: &Self) | 1.0.0 [src] |
Performs copy-assignment from source
. Read more
impl Default for Size
[src]
impl Default for Size
impl<'a> Add<&'a Coord> for Size
[src]
impl<'a> Add<&'a Coord> for Size
type Output = Coord
The resulting type after applying the +
operator.
fn add(self, &'a Coord) -> <Size as Add<&'a Coord>>::Output | [src] |
impl<'a> Add<Coord> for &'a Size
[src]
impl<'a> Add<Coord> for &'a Size
type Output = Coord
The resulting type after applying the +
operator.
fn add(self, Coord) -> <&'a Size as Add<Coord>>::Output | [src] |
impl<'a, 'b> Add<&'a Coord> for &'b Size
[src]
impl<'a, 'b> Add<&'a Coord> for &'b Size
type Output = Coord
The resulting type after applying the +
operator.
fn add(self, &'a Coord) -> <&'b Size as Add<&'a Coord>>::Output | [src] |
impl<'a> Add<&'a Size> for Size
[src]
impl<'a> Add<&'a Size> for Size
type Output = Size
The resulting type after applying the +
operator.
fn add(self, size: &'a Size) -> <Size as Add<&'a Size>>::Output | [src] |
impl Add<Coord> for Size
[src]
impl Add<Coord> for Size
type Output = Coord
The resulting type after applying the +
operator.
fn add(self, Coord) -> <Size as Add<Coord>>::Output | [src] |
impl Add<Size> for Size
[src]
impl Add<Size> for Size
type Output = Size
The resulting type after applying the +
operator.
fn add(self, size: Size) -> <Size as Add<Size>>::Output | [src] |
impl<'a, 'b> Add<&'a Size> for &'b Size
[src]
impl<'a, 'b> Add<&'a Size> for &'b Size
type Output = Size
The resulting type after applying the +
operator.
fn add(self, size: &'a Size) -> <&'b Size as Add<&'a Size>>::Output | [src] |
impl<'a> Add<Size> for &'a Size
[src]
impl<'a> Add<Size> for &'a Size
type Output = Size
The resulting type after applying the +
operator.
fn add(self, size: Size) -> <&'a Size as Add<Size>>::Output | [src] |
impl Ord for Size
[src]
impl Ord for Size
fn cmp(&self, other: &Size) -> Ordering | [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 Eq for Size
[src]
impl Eq for Size
impl PartialEq<Size> for Size
[src]
impl PartialEq<Size> for Size
impl<'a> Sub<Size> for &'a Size
[src]
impl<'a> Sub<Size> for &'a Size
type Output = Size
The resulting type after applying the -
operator.
fn sub(self, size: Size) -> <&'a Size as Sub<Size>>::Output | [src] |
impl Sub<Size> for Size
[src]
impl Sub<Size> for Size
type Output = Size
The resulting type after applying the -
operator.
fn sub(self, size: Size) -> <Size as Sub<Size>>::Output | [src] |
impl Sub<Coord> for Size
[src]
impl Sub<Coord> for Size
type Output = Coord
The resulting type after applying the -
operator.
fn sub(self, Coord) -> <Size as Sub<Coord>>::Output | [src] |
impl<'a, 'b> Sub<&'a Size> for &'b Size
[src]
impl<'a, 'b> Sub<&'a Size> for &'b Size
type Output = Size
The resulting type after applying the -
operator.
fn sub(self, size: &'a Size) -> <&'b Size as Sub<&'a Size>>::Output | [src] |
impl<'a> Sub<Coord> for &'a Size
[src]
impl<'a> Sub<Coord> for &'a Size
type Output = Coord
The resulting type after applying the -
operator.
fn sub(self, Coord) -> <&'a Size as Sub<Coord>>::Output | [src] |
impl<'a> Sub<&'a Size> for Size
[src]
impl<'a> Sub<&'a Size> for Size
type Output = Size
The resulting type after applying the -
operator.
fn sub(self, size: &'a Size) -> <Size as Sub<&'a Size>>::Output | [src] |
impl<'a, 'b> Sub<&'a Coord> for &'b Size
[src]
impl<'a, 'b> Sub<&'a Coord> for &'b Size
type Output = Coord
The resulting type after applying the -
operator.
fn sub(self, &'a Coord) -> <&'b Size as Sub<&'a Coord>>::Output | [src] |
impl<'a> Sub<&'a Coord> for Size
[src]
impl<'a> Sub<&'a Coord> for Size
type Output = Coord
The resulting type after applying the -
operator.
fn sub(self, &'a Coord) -> <Size as Sub<&'a Coord>>::Output | [src] |
impl<T> MulAssign<T> for Size where
Size: Mul<T>,
<Size as Mul<T>>::Output == Size,
[src]
impl<T> MulAssign<T> for Size where
Size: Mul<T>,
<Size as Mul<T>>::Output == Size,
fn mul_assign(&mut self, rhs: T) | [src] |
impl Debug for Size
[src]
impl Debug for Size
impl<'a> Mul<u32> for &'a Size
[src]
impl<'a> Mul<u32> for &'a Size
type Output = Size
The resulting type after applying the *
operator.
fn mul(self, rhs: u32) -> <&'a Size as Mul<u32>>::Output | [src] |
impl Mul<u32> for Size
[src]
impl Mul<u32> for Size
type Output = Size
The resulting type after applying the *
operator.
fn mul(self, rhs: u32) -> <Size as Mul<u32>>::Output | [src] |
impl From<(u32, u32)> for Size
[src]
impl From<(u32, u32)> for Size
impl From<[u32; 2]> for Size
[src]
impl From<[u32; 2]> for Size
impl<T> DivAssign<T> for Size where
Size: Div<T>,
<Size as Div<T>>::Output == Size,
[src]
impl<T> DivAssign<T> for Size where
Size: Div<T>,
<Size as Div<T>>::Output == Size,
fn div_assign(&mut self, rhs: T) | [src] |
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)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> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where |
Sets value
as a parameter of self
.