Struct dyer::plugin::pipeline::PipeLine [−][src]
the end of data flow, plugin that consume the extracted Entity
, In general, the default
method does nothing, and customization is requird to store the data. An example:
async fn process_item(items: &mut Arc<Mutex<Vec<I>>>) { let itms = items.lock().unwrap(); for _ in itms.len() { itms.pop(); } println!("consumed {} items", itms.len() ) } let pipeline = PipeLine::builder().process_item(&|items: &mut Arc<Mutex<Vec<I>>>| process_item(items).boxed_local() );
the member not specified is by default assigned to the default method
Fields
open_pipeline: &'pl dyn Fn() -> LocalBoxFuture<'pl, &'pl Option<C>>
close_pipeline: &'pl dyn Fn() -> LocalBoxFuture<'pl, ()>
process_item: &'pl dyn Fn(&mut Arc<Mutex<Vec<I>>>) -> LocalBoxFuture<'_, ()>
process_yerr: &'pl dyn Fn(&mut Arc<Mutex<Vec<String>>>) -> LocalBoxFuture<'_, ()>
Implementations
impl<'pl, I, C> PipeLine<'pl, I, C> where
C: 'pl,
I: Send + Sync + Debug + 'pl,
[src]
C: 'pl,
I: Send + Sync + Debug + 'pl,
pub fn builder() -> PipeLineBuilder<'pl, ((), (), (), ()), I, C>
[src]
Create a builder for building PipeLine
.
On the builder, call .open_pipeline(...)
(optional), .close_pipeline(...)
(optional), .process_item(...)
(optional), .process_yerr(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of PipeLine
.
Auto Trait Implementations
impl<'pl, I, C> !RefUnwindSafe for PipeLine<'pl, I, C>
impl<'pl, I, C> !Send for PipeLine<'pl, I, C>
impl<'pl, I, C> !Sync for PipeLine<'pl, I, C>
impl<'pl, I, C> Unpin for PipeLine<'pl, I, C>
impl<'pl, I, C> !UnwindSafe for PipeLine<'pl, I, C>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,