pub struct Pipeline<T> { /* private fields */ }Expand description
Named transforms run in order: each stage gets the previous one’s output.
Implementations§
Source§impl<T> Pipeline<T>
impl<T> Pipeline<T>
pub fn new() -> Self
Sourcepub fn then(
self,
name: impl Into<String>,
transform: impl Transform<T> + 'static,
) -> Self
pub fn then( self, name: impl Into<String>, transform: impl Transform<T> + 'static, ) -> Self
Add a stage at the end.
Sourcepub fn push(
&mut self,
name: impl Into<String>,
transform: Box<dyn Transform<T>>,
)
pub fn push( &mut self, name: impl Into<String>, transform: Box<dyn Transform<T>>, )
Add a boxed stage at the end.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn apply(&self, input: T) -> Result<T, PipelineError>
pub fn apply(&self, input: T) -> Result<T, PipelineError>
Run every stage in order.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Pipeline<T>
impl<T> !UnwindSafe for Pipeline<T>
impl<T> Freeze for Pipeline<T>
impl<T> Send for Pipeline<T>
impl<T> Sync for Pipeline<T>
impl<T> Unpin for Pipeline<T>
impl<T> UnsafeUnpin for Pipeline<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more