Skip to main content

Transform

Trait Transform 

Source
pub trait Transform<T> {
    // Required methods
    fn name(&self) -> &'static str;
    fn apply(&self, value: T) -> T;
}
Expand description

A structure-preserving mutation of a value.

Required Methods§

Source

fn name(&self) -> &'static str

Human-readable name for diagnostics.

Source

fn apply(&self, value: T) -> T

Apply the transform, returning a new value. Must be deterministic.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Transform<IacResource> for Vec<ResourceOp>

A sequence of ops runs in order and is itself a Transform.

Source§

fn name(&self) -> &'static str

Source§

fn apply(&self, r: IacResource) -> IacResource

Implementors§

Source§

impl Transform<IacResource> for ResourceOp

A single op is also a Transform.

Source§

impl<T, A, B> Transform<T> for ComposeTransforms<A, B>
where A: Transform<T>, B: Transform<T>,

Source§

impl<T> Transform<T> for Identity