pub struct FoldOperator<F, T>{
pub name: String,
pub initial: T,
pub func: Arc<F>,
}Expand description
Fold operator - accumulates values
Fields§
§name: String§initial: T§func: Arc<F>Implementations§
Trait Implementations§
Source§impl<F, T> StreamOperator for FoldOperator<F, T>
impl<F, T> StreamOperator for FoldOperator<F, T>
Source§impl<F, T> StreamProcessor for FoldOperator<F, T>
impl<F, T> StreamProcessor for FoldOperator<F, T>
Source§fn process_item<'life0, 'life1, 'async_trait>(
&'life0 self,
item: Value,
_ctx: &'life1 Context,
) -> Pin<Box<dyn Future<Output = RuleResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn process_item<'life0, 'life1, 'async_trait>(
&'life0 self,
item: Value,
_ctx: &'life1 Context,
) -> Pin<Box<dyn Future<Output = RuleResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Process a single item from the stream
Source§fn process_chunk<'life0, 'life1, 'async_trait>(
&'life0 self,
items: Vec<Value>,
_ctx: &'life1 Context,
) -> Pin<Box<dyn Future<Output = Result<Vec<Value>, RuleError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn process_chunk<'life0, 'life1, 'async_trait>(
&'life0 self,
items: Vec<Value>,
_ctx: &'life1 Context,
) -> Pin<Box<dyn Future<Output = Result<Vec<Value>, RuleError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Process a chunk of items (for batch operations)
Auto Trait Implementations§
impl<F, T> Freeze for FoldOperator<F, T>where
T: Freeze,
impl<F, T> RefUnwindSafe for FoldOperator<F, T>where
T: RefUnwindSafe,
F: RefUnwindSafe,
impl<F, T> Send for FoldOperator<F, T>
impl<F, T> Sync for FoldOperator<F, T>
impl<F, T> Unpin for FoldOperator<F, T>where
T: Unpin,
impl<F, T> UnwindSafe for FoldOperator<F, T>where
T: UnwindSafe,
F: RefUnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more