pub struct EventFold { /* private fields */ }Expand description
The brain as a meta-fold: Fold<Event, BrainState>.
Processes the existing Event substrate stream. Each event is interpreted
via event::interpret() and routed to the relevant posteriors.
Deterministic: same events in the same order → same BrainState.
Implementations§
Trait Implementations§
Source§impl Fold<Event, BrainState> for EventFold
impl Fold<Event, BrainState> for EventFold
Source§fn initial(&self, _context: &FoldContext) -> BrainState
fn initial(&self, _context: &FoldContext) -> BrainState
Get the initial state before any entries are processed.
Source§fn step(
&self,
state: BrainState,
event: &Event,
_ctx: &FoldContext,
) -> BrainState
fn step( &self, state: BrainState, event: &Event, _ctx: &FoldContext, ) -> BrainState
Process a single entry and return the new state. Read more
Source§fn finalize(&self, state: BrainState, _context: &FoldContext) -> BrainState
fn finalize(&self, state: BrainState, _context: &FoldContext) -> BrainState
Finalize the state after all entries are processed. Read more
Source§fn derive<'a, I>(&self, entries: I, context: &FoldContext) -> FoldOutcome<S>
fn derive<'a, I>(&self, entries: I, context: &FoldContext) -> FoldOutcome<S>
Derive state from an iterator of entries. Read more
Source§fn derive_filtered<'a, I, F>(
&self,
entries: I,
context: &FoldContext,
filter: F,
) -> FoldOutcome<S>
fn derive_filtered<'a, I, F>( &self, entries: I, context: &FoldContext, filter: F, ) -> FoldOutcome<S>
Derive state with a filter.
Auto Trait Implementations§
impl Freeze for EventFold
impl RefUnwindSafe for EventFold
impl Send for EventFold
impl Sync for EventFold
impl Unpin for EventFold
impl UnsafeUnpin for EventFold
impl UnwindSafe for EventFold
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