Skip to main content

TransformExt

Trait TransformExt 

Source
pub trait TransformExt<T>:
    Transform<T>
    + Sized
    + 'static {
    // Provided methods
    fn then<U>(self, next: U) -> Chain<Self, U>
       where U: Transform<Self::Output> { ... }
    fn when<P>(self, predicate: P) -> Conditional<Self, P>
       where P: Fn(&T) -> bool + Send + Sync { ... }
    fn boxed(self) -> Box<dyn Transform<T, Output = Self::Output> + Send + Sync> { ... }
}
Expand description

Extension trait for chainable transform operations

Provided Methods§

Source

fn then<U>(self, next: U) -> Chain<Self, U>
where U: Transform<Self::Output>,

Chain this transform with another

Creates a new transform that applies this transform first, then the next.

Source

fn when<P>(self, predicate: P) -> Conditional<Self, P>
where P: Fn(&T) -> bool + Send + Sync,

Apply this transform conditionally based on a predicate

The transform is only applied if the predicate returns true for the input.

Source

fn boxed(self) -> Box<dyn Transform<T, Output = Self::Output> + Send + Sync>

Convert to a boxed trait object for dynamic dispatch

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T, U: Transform<T> + 'static> TransformExt<T> for U