pub struct EvalContext<'a> {
pub seen_before: Option<&'a dyn Fn(&str) -> bool>,
}Expand description
Caller-supplied runtime context for evaluate_plan.
Evaluation stays synchronous and I/O-free: instead of the engine touching
storage, callers hand in an optional seen_before predicate that decides
whether an automated reply was already sent to a sender within its
respond period.
Fields§
§seen_before: Option<&'a dyn Fn(&str) -> bool>Respond-once hook for the
vacation action (RFC 5230):
return true when a reply was already sent to this sender within
the configured period. When None, no dedup is applied and the
outcome always carries the reply (hosts can dedup themselves using
the to/days fields of
VacationReply, or use the
ready-made VacationTracker).
Implementations§
Source§impl<'a> EvalContext<'a>
impl<'a> EvalContext<'a>
Sourcepub fn with_seen_before(self, seen_before: &'a dyn Fn(&str) -> bool) -> Self
pub fn with_seen_before(self, seen_before: &'a dyn Fn(&str) -> bool) -> Self
Attach a respond-once dedup predicate.
Trait Implementations§
Source§impl<'a> Default for EvalContext<'a>
impl<'a> Default for EvalContext<'a>
Source§fn default() -> EvalContext<'a>
fn default() -> EvalContext<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for EvalContext<'a>
impl<'a> !Send for EvalContext<'a>
impl<'a> !Sync for EvalContext<'a>
impl<'a> !UnwindSafe for EvalContext<'a>
impl<'a> Freeze for EvalContext<'a>
impl<'a> Unpin for EvalContext<'a>
impl<'a> UnsafeUnpin for EvalContext<'a>
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