Trait ludomath::vec2d::Transformation
[−]
[src]
pub trait Transformation<T>: MaybeInvertible { fn transform(self, operand: T) -> T; fn transform_mut(self, operand: &mut T)
where
T: Copy, { ... } fn inverse_transform(self, operand: T) -> T { ... } fn inverse_transform_checked(self, operand: T) -> Option<T> { ... } }
A trait describing the transformation of some type T
.
Required Methods
fn transform(self, operand: T) -> T
Returns a transformed copy of an object.
Implementors only need to implement this function, as the other have default implementations based on this.
Provided Methods
fn transform_mut(self, operand: &mut T) where
T: Copy,
T: Copy,
Transforms an object, mutating it.
fn inverse_transform(self, operand: T) -> T
Transforms an object by the inverse of a transformation.
Should not panic even if the transformation isn't invertible.
fn inverse_transform_checked(self, operand: T) -> Option<T>
Transforms an object by the inverse of a transformation.
Returns Some(result)
if the transformation is invertible,
returns None
otherwise.