Struct components::foundation::Size2D
[−]#[repr(C)]pub struct Size2D<T> {
pub width: T,
pub height: T,
}Expand description
A 2d size tagged with a unit.
Fields
width: TThe extent of the element in the U units along the x axis (usually horizontal).
height: TThe extent of the element in the U units along the y axis (usually vertical).
Implementations
impl<T> Size2D<T>
impl<T> Size2D<T>
pub fn zero() -> Size2D<T> where
T: Zero,
pub fn zero() -> Size2D<T> where
T: Zero,
The same as Zero::zero() but available without importing trait.
pub fn splat(v: T) -> Size2D<T> where
T: Clone,
pub fn splat(v: T) -> Size2D<T> where
T: Clone,
Constructor setting all components to the same value.
pub fn from_untyped(p: Size2D<T>) -> Size2D<T>
pub fn from_untyped(p: Size2D<T>) -> Size2D<T>
Tag a unitless value with units.
Trait Implementations
impl<T> AddAssign<Size2D<T>> for Size2D<T> where
T: AddAssign<T>,
impl<T> AddAssign<Size2D<T>> for Size2D<T> where
T: AddAssign<T>,
fn add_assign(&mut self, other: Size2D<T>)
fn add_assign(&mut self, other: Size2D<T>)
Performs the += operation. Read more
impl<T> DivAssign<T> for Size2D<T> where
T: Copy + DivAssign<T>,
impl<T> DivAssign<T> for Size2D<T> where
T: Copy + DivAssign<T>,
fn div_assign(&mut self, other: T)
fn div_assign(&mut self, other: T)
Performs the /= operation. Read more
impl<T> MulAssign<T> for Size2D<T> where
T: Copy + MulAssign<T>,
impl<T> MulAssign<T> for Size2D<T> where
T: Copy + MulAssign<T>,
fn mul_assign(&mut self, other: T)
fn mul_assign(&mut self, other: T)
Performs the *= operation. Read more
impl<T> SubAssign<Size2D<T>> for Size2D<T> where
T: SubAssign<T>,
impl<T> SubAssign<Size2D<T>> for Size2D<T> where
T: SubAssign<T>,
fn sub_assign(&mut self, other: Size2D<T>)
fn sub_assign(&mut self, other: Size2D<T>)
Performs the -= operation. Read more
impl<T> Copy for Size2D<T> where
T: Copy,
impl<T> Eq for Size2D<T> where
T: Eq,
Auto Trait Implementations
impl<T> RefUnwindSafe for Size2D<T> where
T: RefUnwindSafe,
impl<T> Send for Size2D<T> where
T: Send,
impl<T> Sync for Size2D<T> where
T: Sync,
impl<T> Unpin for Size2D<T> where
T: Unpin,
impl<T> UnwindSafe for Size2D<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
fn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value as a parameter of self.