pub struct TemporalPattern {
pub name: String,
pub detector: Box<dyn PatternDetector>,
pub action: Arc<dyn Fn(State, Arc<dyn SessionWriter>) -> BoxFuture<()> + Send + Sync>,
pub cooldown: Option<Duration>,
/* private fields */
}Expand description
A named temporal pattern: detector + action + cooldown.
Fields§
§name: StringHuman-readable name for logging/debugging.
detector: Box<dyn PatternDetector>The detector that decides when to fire.
action: Arc<dyn Fn(State, Arc<dyn SessionWriter>) -> BoxFuture<()> + Send + Sync>The async action to execute when the pattern triggers.
Receives a cloned State and the session writer.
cooldown: Option<Duration>Optional minimum interval between successive firings.
Implementations§
Auto Trait Implementations§
impl !Freeze for TemporalPattern
impl !RefUnwindSafe for TemporalPattern
impl Send for TemporalPattern
impl Sync for TemporalPattern
impl Unpin for TemporalPattern
impl !UnwindSafe for TemporalPattern
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