[−][src]Struct exr::math::Vec2
Simple two-dimensional vector of any numerical type. Supports only few mathematical operations as this is used mainly as data struct.
Methods
impl<T> Vec2<T>
[src]
pub fn map<B>(self, map: impl Fn(T) -> B) -> Vec2<B>
[src]
Maps all components of this vector to a new type, yielding a vector of that new type.
pub fn try_from<S>(value: Vec2<S>) -> Result<Self, T::Error> where
T: TryFrom<S>,
[src]
T: TryFrom<S>,
Try to convert all components of this vector to a new type, yielding either a vector of that new type, or an error.
pub fn area(self) -> T where
T: Mul<T, Output = T>,
[src]
T: Mul<T, Output = T>,
Seeing this vector as a dimension or size (width and height),
this returns the area that this dimensions contains (width * height
).
impl Vec2<i32>
[src]
pub fn to_usize(self, error_message: &'static str) -> Result<Vec2<usize>>
[src]
Try to convert to Vec2<usize>
, returning an error on negative numbers.
impl Vec2<usize>
[src]
Trait Implementations
impl<T: Add<T>> Add<Vec2<T>> for Vec2<T>
[src]
type Output = Vec2<T::Output>
The resulting type after applying the +
operator.
fn add(self, other: Vec2<T>) -> Self::Output
[src]
impl<T: Clone> Clone for Vec2<T>
[src]
impl<T: Copy> Copy for Vec2<T>
[src]
impl<T: Debug> Debug for Vec2<T>
[src]
impl<T: Default> Default for Vec2<T>
[src]
impl<T: Div<T>> Div<Vec2<T>> for Vec2<T>
[src]
type Output = Vec2<T::Output>
The resulting type after applying the /
operator.
fn div(self, other: Vec2<T>) -> Self::Output
[src]
impl<T: Eq> Eq for Vec2<T>
[src]
impl<T: Hash> Hash for Vec2<T>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: Mul<T>> Mul<Vec2<T>> for Vec2<T>
[src]
type Output = Vec2<T::Output>
The resulting type after applying the *
operator.
fn mul(self, other: Vec2<T>) -> Self::Output
[src]
impl<T: PartialEq> PartialEq<Vec2<T>> for Vec2<T>
[src]
impl<T> StructuralEq for Vec2<T>
[src]
impl<T> StructuralPartialEq for Vec2<T>
[src]
impl<T: Sub<T>> Sub<Vec2<T>> for Vec2<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Vec2<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Vec2<T> where
T: Send,
T: Send,
impl<T> Sync for Vec2<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Vec2<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Vec2<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<R, P> ReadPrimitive<R> for P where
P: Default,
R: ReadEndian<P> + Read,
[src]
P: Default,
R: ReadEndian<P> + Read,
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
[src]
fn read_from_big_endian(read: &mut R) -> Result<Self, Error>
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,