TransformArgument

Enum TransformArgument 

Source
pub enum TransformArgument {
    Single(Transform),
    Many(Vec<Transform>),
}
Expand description

A TransformArgument is a transform that should be applied to the invocation of a Rule.

See the From and Into implementations which produce this type to find out what kind of argument each type becomes.

Variants§

§

Single(Transform)

A single transform that corresponds to one invocation with the given transform.

§

Many(Vec<Transform>)

An arbitrary number of transforms (e.g. from Replicate) that correspond to one invocation each.

Trait Implementations§

Source§

impl Debug for TransformArgument

Source§

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

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

impl From<&[Transform]> for TransformArgument

A slice of transforms will be sequentially composed into a single transform and correspond to one invocation.

Source§

fn from(transforms: &[Transform]) -> Self

Converts to this type from the input type.
Source§

impl From<Option<Transform>> for TransformArgument

An optional transform will of course correspond to one invocation. This implementation also allows you to pass None to invoke rules unmodified.

Source§

fn from(maybe_input: Option<Transform>) -> Self

Converts to this type from the input type.
Source§

impl From<Transform> for TransformArgument

A single transform will correspond to one invocation.

Source§

fn from(transform: Transform) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<Replicate>> for TransformArgument

A vector of replications will be composed sequentially, which means the number of corresponding rule invocations is the product of each replication. A vector with a replication of transform A 36 times then replication of B 10 times will yield transforms for every sequence of A then B (e.g. (A_1, B_1), (A_1, B_2), …, (A_36, B_36)), so 360 total.

Source§

fn from(replications: Vec<Replicate>) -> TransformArgument

Converts to this type from the input type.
Source§

impl From<Vec<Transform>> for TransformArgument

A vector of transforms will be sequentially composed into a single transform and correspond to one invocation.

Source§

fn from(transforms: Vec<Transform>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<TransformArgument>> for TransformArgument

Source§

fn from(args: Vec<TransformArgument>) -> Self

Converts to this type from the input type.
Source§

impl Into<TransformArgument> for Replicate

The replication will become n transforms, corresponding to one invocation each.

Source§

fn into(self) -> TransformArgument

Converts this type into the (usually inferred) input type.
Source§

impl Into<Vec<Transform>> for TransformArgument

Source§

fn into(self) -> Vec<Transform>

Converts this type into the (usually inferred) input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Component + Float, Swp: WhitePoint, Dwp: WhitePoint, D: AdaptFrom<S, Swp, Dwp, T>,

Source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<Swp, Dwp, T>,

Convert the source color to the destination color using the specified method
Source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default
Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

unsafe fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.