Tuple Fields
0: N
1: N
Implementations
sourceimpl<N: Num> Size<N>
impl<N: Num> Size<N>
pub fn new_zero_value() -> Self
pub fn new_one_value() -> Self
pub fn width(&self) -> N
pub fn height(&self) -> N
pub fn set_width(&mut self, width: N)
pub fn set_height(&mut self, height: N)
sourcepub fn longest_side(self) -> N
pub fn longest_side(self) -> N
Returns the longest side.
Be aware it uses an absolute comparison. This means -10 is considered larger than 5.
For example … Size(-10, 5).longest_size()
will return -10.
sourcepub fn shortest_side(self) -> N
pub fn shortest_side(self) -> N
Note that for negative sizes, the
pub fn index(&self, pos: Point<N>) -> N
pub fn half(&self) -> Self
pub fn to_point(self) -> Point<N>
pub fn to_rect(self) -> Rect<N>
pub fn get_scale_diff(self, other: Self) -> Self
sourcepub fn to<T: Num + From<N>>(&self) -> Size<T>
pub fn to<T: Num + From<N>>(&self) -> Size<T>
This is to allow creating a new Size, with a new type, from the type given.
i.e. Size::new(1 as u8, 1 as u8)::to::<u32>()
pub fn abs(&self) -> Self
pub fn min(self, other: Self) -> Self
pub fn max(self, other: Self) -> Self
pub fn hypot(self) -> N
pub fn hypot_sqrd(self) -> N
pub fn interpolate_to(self, other: Size<N>, n: N) -> Size<N>
sourceimpl<N: Num + Signed> Size<N>
impl<N: Num + Signed> Size<N>
pub fn sign(&self) -> Self
pub fn sign_width(&self) -> N
pub fn sign_height(&self) -> N
pub fn flip(self) -> Self
pub fn flip_horizontal(self) -> Self
pub fn flip_vertical(self) -> Self
Trait Implementations
sourceimpl<N: Num> AddAssign<Size<N>> for Point<N>
impl<N: Num> AddAssign<Size<N>> for Point<N>
sourcefn add_assign(&mut self, other: Size<N>)
fn add_assign(&mut self, other: Size<N>)
Performs the +=
operation. Read more
sourceimpl<N: Num> AddAssign<Size<N>> for Rect<N>
impl<N: Num> AddAssign<Size<N>> for Rect<N>
sourcefn add_assign(&mut self, other: Size<N>)
fn add_assign(&mut self, other: Size<N>)
Performs the +=
operation. Read more
sourceimpl<N: Num> AddAssign<Size<N>> for Size<N>
impl<N: Num> AddAssign<Size<N>> for Size<N>
sourcefn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the +=
operation. Read more
sourceimpl<N: Num> DivAssign<Size<N>> for Line<N>
impl<N: Num> DivAssign<Size<N>> for Line<N>
sourcefn div_assign(&mut self, other: Size<N>)
fn div_assign(&mut self, other: Size<N>)
Performs the /=
operation. Read more
sourceimpl<N: Num> DivAssign<Size<N>> for Point<N>
impl<N: Num> DivAssign<Size<N>> for Point<N>
sourcefn div_assign(&mut self, other: Size<N>)
fn div_assign(&mut self, other: Size<N>)
Performs the /=
operation. Read more
sourceimpl<N: Num> DivAssign<Size<N>> for Size<N>
impl<N: Num> DivAssign<Size<N>> for Size<N>
sourcefn div_assign(&mut self, other: Self)
fn div_assign(&mut self, other: Self)
Performs the /=
operation. Read more
sourceimpl<N: Num> IntoIterator for Size<N>
impl<N: Num> IntoIterator for Size<N>
sourceimpl<N: Num> MulAssign<Size<N>> for Line<N>
impl<N: Num> MulAssign<Size<N>> for Line<N>
sourcefn mul_assign(&mut self, other: Size<N>)
fn mul_assign(&mut self, other: Size<N>)
Performs the *=
operation. Read more
sourceimpl<N: Num> MulAssign<Size<N>> for Point<N>
impl<N: Num> MulAssign<Size<N>> for Point<N>
sourcefn mul_assign(&mut self, other: Size<N>)
fn mul_assign(&mut self, other: Size<N>)
Performs the *=
operation. Read more
sourceimpl<N: Num> MulAssign<Size<N>> for Size<N>
impl<N: Num> MulAssign<Size<N>> for Size<N>
sourcefn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the *=
operation. Read more
sourceimpl<N: Num> NumTuple<N> for Size<N>
impl<N: Num> NumTuple<N> for Size<N>
fn new(width: N, height: N) -> Self
fn first(&self) -> N
fn second(&self) -> N
fn set_first(&mut self, n: N)
fn set_second(&mut self, n: N)
fn set(&mut self, first: N, second: N)
fn get(&mut self) -> (N, N)
fn min(self, other: Self) -> Self
fn max(self, other: Self) -> Self
fn is_outside(self, xy1: Self, xy2: Self) -> bool
fn is_inside(self, xy1: Self, xy2: Self) -> bool
sourceimpl<N: INum> ShlAssign<N> for Size<N>
impl<N: INum> ShlAssign<N> for Size<N>
sourcefn shl_assign(&mut self, other: N)
fn shl_assign(&mut self, other: N)
Performs the <<=
operation. Read more
sourceimpl<N: INum> ShrAssign<N> for Size<N>
impl<N: INum> ShrAssign<N> for Size<N>
sourcefn shr_assign(&mut self, other: N)
fn shr_assign(&mut self, other: N)
Performs the >>=
operation. Read more
sourceimpl<N: Num> SubAssign<Size<N>> for Point<N>
impl<N: Num> SubAssign<Size<N>> for Point<N>
sourcefn sub_assign(&mut self, other: Size<N>)
fn sub_assign(&mut self, other: Size<N>)
Performs the -=
operation. Read more
sourceimpl<N: Num> SubAssign<Size<N>> for Rect<N>
impl<N: Num> SubAssign<Size<N>> for Rect<N>
sourcefn sub_assign(&mut self, other: Size<N>)
fn sub_assign(&mut self, other: Size<N>)
Performs the -=
operation. Read more
sourceimpl<N: Num> SubAssign<Size<N>> for Size<N>
impl<N: Num> SubAssign<Size<N>> for Size<N>
sourcefn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Performs the -=
operation. Read more
sourceimpl<O: Num, N: Num + ToRounded<O>> ToRounded<Size<O>> for Size<N>
impl<O: Num, N: Num + ToRounded<O>> ToRounded<Size<O>> for Size<N>
sourcefn to_rounded(self) -> Size<O>
fn to_rounded(self) -> Size<O>
Returns the value in the new type, but clamped.
impl<N: Copy + Num> Copy for Size<N>
impl<N: Num> StructuralPartialEq for Size<N>
Auto Trait Implementations
impl<N> RefUnwindSafe for Size<N> where
N: RefUnwindSafe,
impl<N> Send for Size<N> where
N: Send,
impl<N> Sync for Size<N> where
N: Sync,
impl<N> Unpin for Size<N> where
N: Unpin,
impl<N> UnwindSafe for Size<N> where
N: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more