Pipeline

Struct Pipeline 

Source
pub struct Pipeline<T: Send + Sync + 'static> { /* private fields */ }
Expand description

The pipes manager

Implementations§

Source§

impl<T: Clone + Send + Sync + 'static> Pipeline<T>

Source

pub async fn pass(content: T) -> Self

Accepts the pipeline content/input. This is the beginning of the pipeline

Source

pub async fn pass_content(self, content: T) -> Self

Source

pub async fn through_fn<H, Args, O>(self, handler: H) -> Self
where 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

Source

pub async fn next_fn<H, Args>(self, handler: H) -> Self
where H: PipeFnHandler<Args, bool>, 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 Closure must return a boolean. False will stop the pipe flow

Source

pub async fn store_fn<H, Args, O: Clone + Send + Sync + 'static>( self, handler: H, ) -> Self
where H: PipeFnHandler<Args, O>, Args: Resolver + 'static,

Stores the result from the pipe handler

Source

pub async fn some_fn<H, Args, O: Clone + Send + Sync + 'static>( self, handler: H, ) -> Self
where H: PipeFnHandler<Args, Option<O>>, Args: Resolver + 'static,

Source

pub async fn ok_fn<H, Args, O: Clone + Send + Sync + 'static, E: Clone + Send + Sync + 'static>( self, handler: H, ) -> Self
where H: PipeFnHandler<Args, Result<O, E>>, Args: Resolver + 'static,

Source

pub async fn through<H, Args, O>(self, handler: H) -> Self
where H: FamaPipe<Args, O>, Args: Resolver + 'static,

Accepts an instance of a struct that implements fama::FamaPipe The returned result will be store for the next pipe handlers

Source

pub async fn next<H, Args>(self, handler: H) -> Self
where H: FamaPipe<Args, bool>, Args: Resolver + 'static,

Accepts an instance of a struct that implements fama::FamaPipe Must return a boolean. False will halt the flow

Source

pub async fn store<H, Args, O: Clone + Send + Sync + 'static>( self, handler: H, ) -> Self
where H: FamaPipe<Args, O>, Args: Resolver + 'static,

Source

pub async fn some<H, Args, O: Clone + Send + Sync + 'static>( self, handler: H, ) -> Self
where H: FamaPipe<Args, Option<O>>, Args: Resolver + 'static,

Source

pub async fn ok<H, Args, O: Clone + Send + Sync + 'static, E: Clone + Send + Sync + 'static>( self, handler: H, ) -> Self
where H: FamaPipe<Args, Result<O, E>>, Args: Resolver + 'static,

Source

pub async fn deliver(&self) -> T

Returns the passed variable

Source

pub async fn try_to_deliver(&self) -> Option<T>

Returns the passed variable wrapped in an Option<T>

Source

pub async fn deliver_as<R: Clone + 'static>(&self) -> R

Returns a different type that may have been set by one of the pipes

Source

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>

Source

pub fn confirm(&self) -> bool

Returns true if the content went through all the registered pipes

Trait Implementations§

Source§

impl<T: Clone + Send + Sync + 'static> Clone for Pipeline<T>

Source§

fn clone(&self) -> Pipeline<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Pipeline<T>

§

impl<T> !RefUnwindSafe for Pipeline<T>

§

impl<T> Send for Pipeline<T>

§

impl<T> Sync for Pipeline<T>

§

impl<T> Unpin for Pipeline<T>
where T: Unpin,

§

impl<T> !UnwindSafe for Pipeline<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V