pub struct Evaluator {
pub facade: Arc<AreevFacade>,
pub clock: Arc<dyn Clock>,
pub connector: Option<Arc<dyn HostToolExecutor>>,
pub connector_code: Option<ConnectorCode>,
pub starter: Option<Arc<dyn RunStarter>>,
pub credentials: BTreeMap<String, CredentialSource>,
pub ns: String,
pub principal: String,
}Expand description
Evaluates triggers against one memory.
Fields§
§facade: Arc<AreevFacade>§clock: Arc<dyn Clock>§connector: Option<Arc<dyn HostToolExecutor>>Executes connector commands. None means a due polling trigger fails
loudly with TRG-E003 rather than quietly doing nothing — a poll that
silently returns no items is indistinguishable from a healthy source.
connector_code: Option<ConnectorCode>How a connector that is a GRAIN runs (#185). None means this host
runs host-command connectors only, and a trigger naming a connector
Definition refuses with TRG-E012 rather than falling back to
--connector-cmd — a fallback would run a different program than the
declaration names, which is the failure with no symptom the pin exists
to refuse.
starter: Option<Arc<dyn RunStarter>>Starts the bound workflow. None ingests the item and records the
firing without starting anything — what --no-start is for, and what
the ingest-only tests use.
credentials: BTreeMap<String, CredentialSource>Credentials the broker may attach, by name. Values live here and never
in a grain or a connector’s environment: a declaration names a
credential, it never carries one.
A SOURCE per name, not a resolved value (#113): the heartbeat is the
path that most needs short-lived credentials, because it is the one
nobody is watching. An env-var source resolves once, as before; a
cmd:/vault: source is minted per TTL window inside the broker, so a
cadence that outlives a token’s hour does not start 401’ing overnight.
ns: String§principal: StringImplementations§
Source§impl Evaluator
impl Evaluator
Sourcepub fn read_only(
facade: Arc<AreevFacade>,
clock: Arc<dyn Clock>,
ns: &str,
) -> Evaluator
pub fn read_only( facade: Arc<AreevFacade>, clock: Arc<dyn Clock>, ns: &str, ) -> Evaluator
An evaluator that can inspect but not act: no connector, no runtime, no
credentials. What list, show and status want, and the shape that
makes “reading cannot fire anything” true by construction rather than by
remembering to pass None four times.
Sourcepub fn declarations(&self) -> Result<Vec<(String, Trigger)>>
pub fn declarations(&self) -> Result<Vec<(String, Trigger)>>
Every trigger declaration in the memory, newest first.
Sourcepub fn status(&self) -> Result<Vec<TriggerStatus>>
pub fn status(&self) -> Result<Vec<TriggerStatus>>
What every trigger’s state looks like right now.
Sourcepub fn deliver(&self, trigger_hash: &str, payload: Value) -> Result<EvalReport>
pub fn deliver(&self, trigger_hash: &str, payload: Value) -> Result<EvalReport>
Ingest a payload delivered by the host for a webhook or manual
trigger.
Areev never opens a port. The host already terminates TLS and authenticates the sender — it is far better at both than a memory engine would be — and hands the payload to a one-shot invocation. That keeps the useful half of webhooks without a listening daemon.
Idempotent on the same terms as a poll: the payload’s dedup value mints the run id, so a webhook delivered twice (which every provider does) produces one run and one recorded skip.
Sourcepub fn run(&self, opts: &EvalOptions) -> Result<EvalReport>
pub fn run(&self, opts: &EvalOptions) -> Result<EvalReport>
Run one evaluation pass.
Sourcepub fn plan_head_if_stale(&self, t: &Trigger) -> Result<Option<String>>
pub fn plan_head_if_stale(&self, t: &Trigger) -> Result<Option<String>>
The current head of this trigger’s PLAN, when the plan has been edited
since the trigger was declared. None when the trigger already points
at the live version — the overwhelmingly common case, and one forward
point read to establish.
Deliberately a report and not a redirect. Following the chain at fire
time would mean a plan edit silently changes what an unattended
heartbeat runs, which is exactly what content-addressed binding exists
to prevent; the operator moves the pointer with trigger retarget when
they mean to.
Auto Trait Implementations§
impl !RefUnwindSafe for Evaluator
impl !UnwindSafe for Evaluator
impl Freeze for Evaluator
impl Send for Evaluator
impl Sync for Evaluator
impl Unpin for Evaluator
impl UnsafeUnpin for Evaluator
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Fruit for T
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> ⓘ
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> ⓘ
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