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 async fn pass(content: T) -> Self
pub async fn pass(content: T) -> Self
Accepts the pipeline content/input. This is the beginning of the pipeline
pub async fn pass_content(self, content: T) -> Self
Sourcepub async fn through_fn<H, Args, O>(self, handler: H) -> Selfwhere
H: PipeFnHandler<Args, O>,
Args: Resolver + 'static,
pub async fn through_fn<H, Args, O>(self, handler: H) -> Selfwhere
H: PipeFnHandler<Args, O>,
Args: Resolver + '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) -> Self
pub async fn next_fn<H, Args>(self, handler: H) -> Self
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: Resolver + 'static,
pub async fn store_fn<H, Args, O: Clone + Send + Sync + 'static>(
self,
handler: H,
) -> Selfwhere
H: PipeFnHandler<Args, O>,
Args: Resolver + 'static,
Stores the result from the pipe handler
pub async fn some_fn<H, Args, O: Clone + Send + Sync + 'static>( self, handler: H, ) -> Self
pub async fn ok_fn<H, Args, O: Clone + Send + Sync + 'static, E: Clone + Send + Sync + 'static>( self, handler: H, ) -> Self
Sourcepub async fn through<H, Args, O>(self, handler: H) -> Self
pub async fn through<H, Args, O>(self, handler: H) -> Self
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) -> Self
pub async fn next<H, Args>(self, handler: H) -> Self
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, ) -> Self
pub async fn some<H, Args, O: Clone + Send + Sync + 'static>( self, handler: H, ) -> Self
pub async fn ok<H, Args, O: Clone + Send + Sync + 'static, E: Clone + Send + Sync + 'static>( self, handler: H, ) -> Self
Sourcepub async fn try_to_deliver(&self) -> Option<T>
pub async fn try_to_deliver(&self) -> Option<T>
Returns the passed variable wrapped in an Option<T>
Sourcepub async fn deliver_as<R: Clone + 'static>(&self) -> R
pub async fn deliver_as<R: Clone + 'static>(&self) -> R
Returns a different type that may have been set by one of the pipes
Sourcepub async fn try_deliver_as<R: Clone + 'static>(&self) -> Option<R>
pub async 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>