pub struct Pipeline<T: Send + Sync + 'static> { /* private fields */ }Expand description
The pipes manager
Implementations§
source§impl<T: Clone + Send + Sync + 'static> Pipeline<T>
impl<T: Clone + Send + Sync + 'static> Pipeline<T>
sourcepub fn pass(content: T) -> Self
pub fn pass(content: T) -> Self
Accepts the pipeline content/input. This is the beginning of the pipeline
sourcepub async fn through_fn<H, Args, O>(self, handler: H) -> Selfwhere
H: PipeFnHandler<Args, O>,
Args: Injectable + 'static,
pub async fn through_fn<H, Args, O>(self, handler: H) -> Selfwhere H: PipeFnHandler<Args, O>, Args: Injectable + 'static,
Accepts a closure or function as a pipe. The closure can accept zero or more arguments. Unlike a struct pipe, a closure does not have to use a tuple for multiple arguments. Arguments can be up to 17
sourcepub async fn next_fn<H, Args>(self, handler: H) -> Selfwhere
H: PipeFnHandler<Args, bool>,
Args: Injectable + 'static,
pub async fn next_fn<H, Args>(self, handler: H) -> Selfwhere H: PipeFnHandler<Args, bool>, Args: Injectable + 'static,
Accepts a closure or function as a pipe.
The closure can accept zero or more arguments.
Unlike a struct pipe, a closure does not have to use a tuple
for multiple arguments. Arguments can be up to 17
Closure must return a boolean. False will stop the pipe flow
sourcepub async fn store_fn<H, Args, O: Clone + Send + Sync + 'static>(
self,
handler: H
) -> Selfwhere
H: PipeFnHandler<Args, O>,
Args: Injectable + 'static,
pub async fn store_fn<H, Args, O: Clone + Send + Sync + 'static>( self, handler: H ) -> Selfwhere H: PipeFnHandler<Args, O>, Args: Injectable + 'static,
Stores the result from the pipe handler
pub async fn some_fn<H, Args, O: Clone + Send + Sync + 'static>( self, handler: H ) -> Selfwhere H: PipeFnHandler<Args, Option<O>>, Args: Injectable + 'static,
pub async fn ok_fn<H, Args, O: Clone + Send + Sync + 'static, E: Clone + Send + Sync + 'static>( self, handler: H ) -> Selfwhere H: PipeFnHandler<Args, Result<O, E>>, Args: Injectable + 'static,
sourcepub async fn through<H, Args, O>(self, handler: H) -> Selfwhere
H: FamaPipe<Args, O>,
Args: Injectable + 'static,
pub async fn through<H, Args, O>(self, handler: H) -> Selfwhere H: FamaPipe<Args, O>, Args: Injectable + 'static,
Accepts an instance of a struct that implements fama::FamaPipe
The returned result will be store for the next pipe handlers
sourcepub async fn next<H, Args>(self, handler: H) -> Selfwhere
H: FamaPipe<Args, bool>,
Args: Injectable + 'static,
pub async fn next<H, Args>(self, handler: H) -> Selfwhere H: FamaPipe<Args, bool>, Args: Injectable + 'static,
Accepts an instance of a struct that implements fama::FamaPipe
Must return a boolean. False will halt the flow
pub async fn store<H, Args, O: Clone + Send + Sync + 'static>( self, handler: H ) -> Selfwhere H: FamaPipe<Args, O>, Args: Injectable + 'static,
pub async fn some<H, Args, O: Clone + Send + Sync + 'static>( self, handler: H ) -> Selfwhere H: FamaPipe<Args, Option<O>>, Args: Injectable + 'static,
pub async fn ok<H, Args, O: Clone + Send + Sync + 'static, E: Clone + Send + Sync + 'static>( self, handler: H ) -> Selfwhere H: FamaPipe<Args, Result<O, E>>, Args: Injectable + 'static,
sourcepub fn try_to_deliver(&self) -> Option<T>
pub fn try_to_deliver(&self) -> Option<T>
Returns the passed variable wrapped in an Option<T>
sourcepub fn deliver_as<R: Clone + 'static>(&self) -> R
pub fn deliver_as<R: Clone + 'static>(&self) -> R
Returns a different type that may have been set by one of the pipes
sourcepub fn try_deliver_as<R: Clone + 'static>(&self) -> Option<R>
pub fn try_deliver_as<R: Clone + 'static>(&self) -> Option<R>
Returns a different type that may have been set
by one of the pipes. The returned type will be wrapped
in an Option<T>