pub struct Trigger {
pub state: TriggerState,
pub kind: TriggerKind,
pub eligible_at_ms: Option<i64>,
pub interval_ms: Option<i64>,
}Expand description
A trigger’s schedulable state: everything due-ness and step need, and
nothing about which ticket or project the demand points at. Targeting is a
storage-side join; whether the demand is live is a decision.
Fields§
§state: TriggerState§kind: TriggerKind§eligible_at_ms: Option<i64>§interval_ms: Option<i64>Implementations§
Source§impl Trigger
impl Trigger
Sourcepub fn is_due(&self, now_ms: i64) -> bool
pub fn is_due(&self, now_ms: i64) -> bool
The definition of due-ness. The SQL scan in work_state::trigger
carries a predicate that mirrors this so a large queue does not have to
be read into memory to be filtered, but this function is the
definition, and a test asserts the two agree over the whole matrix of
kinds, states, and schedules.
A schedule-carrying kind with no eligible_at_ms is never due: an
unscheduled at is a corrupt row, and answering “due” would fire it
immediately, which is the opposite of what it asked for. That matches
SQL, where NULL <= ? is not true.
Trait Implementations§
impl Copy for Trigger
impl Eq for Trigger
Source§impl From<&QueuedTrigger> for Trigger
impl From<&QueuedTrigger> for Trigger
Source§fn from(queued: &QueuedTrigger) -> Self
fn from(queued: &QueuedTrigger) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Trigger
Auto Trait Implementations§
impl Freeze for Trigger
impl RefUnwindSafe for Trigger
impl Send for Trigger
impl Sync for Trigger
impl Unpin for Trigger
impl UnsafeUnpin for Trigger
impl UnwindSafe for Trigger
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.