Struct gecl::Size

source ·
#[repr(C)]
pub struct Size<T> { pub width: T, pub height: T, }

Fields§

§width: T§height: T

Implementations§

source§

impl<T> Size<T>

source

pub fn new(width: T, height: T) -> Self

source

pub fn map<R>(self, f: impl FnMut(T) -> R) -> Size<R>

source§

impl<T: ToPrimitive> Size<T>

source

pub fn cast<U: NumCast>(self) -> Option<Size<U>>

Trait Implementations§

source§

impl<T, U> Add<U> for Size<T>where T: Add<T, Output = T>, U: Into<Self>,

§

type Output = Size<T>

The resulting type after applying the + operator.
source§

fn add(self, rhs: U) -> Self

Performs the + operation. Read more
source§

impl<T, U> AddAssign<U> for Size<T>where T: AddAssign, U: Into<Self>,

source§

fn add_assign(&mut self, rhs: U)

Performs the += operation. Read more
source§

impl<T: Clone> Clone for Size<T>

source§

fn clone(&self) -> Size<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for Size<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> Div<T> for Size<T>where T: Div<T, Output = T> + Copy,

§

type Output = Size<T>

The resulting type after applying the / operator.
source§

fn div(self, rhs: T) -> Self

Performs the / operation. Read more
source§

impl<T> DivAssign<T> for Size<T>where T: DivAssign + Copy,

source§

fn div_assign(&mut self, rhs: T)

Performs the /= operation. Read more
source§

impl<T: Copy> From<[T; 2]> for Size<T>

source§

fn from(src: [T; 2]) -> Size<T>

Converts to this type from the input type.
source§

impl<T> From<(T, T)> for Size<T>

source§

fn from(src: (T, T)) -> Size<T>

Converts to this type from the input type.
source§

impl<T> From<Size<T>> for Vector<T>

source§

fn from(src: Size<T>) -> Vector<T>

Converts to this type from the input type.
source§

impl<T> From<Vector<T>> for Size<T>

source§

fn from(src: Vector<T>) -> Size<T>

Converts to this type from the input type.
source§

impl<T> Mul<T> for Size<T>where T: Mul<T, Output = T> + Copy,

§

type Output = Size<T>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: T) -> Self

Performs the * operation. Read more
source§

impl<T> MulAssign<T> for Size<T>where T: MulAssign + Copy,

source§

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
source§

impl<T> PartialEq<[T; 2]> for Size<T>where T: PartialEq,

source§

fn eq(&self, other: &[T; 2]) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<(T, T)> for Size<T>where T: PartialEq,

source§

fn eq(&self, other: &(T, T)) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<Size<T>> for [T; 2]where T: PartialEq,

source§

fn eq(&self, other: &Size<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> PartialEq<Size<T>> for (T, T)where T: PartialEq,

source§

fn eq(&self, other: &Size<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: PartialEq> PartialEq<Size<T>> for Size<T>

source§

fn eq(&self, other: &Size<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, U> Sub<U> for Size<T>where T: Sub<T, Output = T>, U: Into<Self>,

§

type Output = Size<T>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: U) -> Self

Performs the - operation. Read more
source§

impl<T, U> SubAssign<U> for Size<T>where T: SubAssign, U: Into<Self>,

source§

fn sub_assign(&mut self, rhs: U)

Performs the -= operation. Read more
source§

impl<T: Copy> Copy for Size<T>

source§

impl<T: Eq> Eq for Size<T>

source§

impl<T> StructuralEq for Size<T>

source§

impl<T> StructuralPartialEq for Size<T>

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Size<T>where T: RefUnwindSafe,

§

impl<T> Send for Size<T>where T: Send,

§

impl<T> Sync for Size<T>where T: Sync,

§

impl<T> Unpin for Size<T>where T: Unpin,

§

impl<T> UnwindSafe for Size<T>where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.