pub enum TriggerHandlerSpec {
Local {
raw: String,
closure: Arc<VmClosure>,
},
A2a {
target: String,
allow_cleartext: bool,
},
Worker {
queue: String,
},
Persona {
binding: PersonaRuntimeBinding,
},
EvalPack {
target: String,
manifest: Box<EvalPackManifest>,
ledger_options: Option<Value>,
},
AutoResume {
worker_id: String,
},
SpawnToPool {
pool: String,
priority_from: Option<String>,
key_from: Option<String>,
task_factory: Arc<VmClosure>,
},
ReminderInject {
target: TargetExpr,
body: String,
tags: Vec<String>,
ttl_turns: Option<i64>,
dedupe_key: Option<String>,
propagate: ReminderPropagate,
role_hint: ReminderRoleHint,
preserve_on_compact: bool,
},
InterruptAndSuspend {
target_agents: AgentScope,
reason: String,
},
}Variants§
Local
A2a
Worker
Persona
Fields
binding: PersonaRuntimeBindingEvalPack
AutoResume
SpawnToPool
Composes triggers (#1870) with named agent pools (#1883). On match,
the dispatcher resolves pool by name, invokes task_factory(event)
to build the per-event closure, and submits it to the pool with the
pool’s queue strategy + backpressure policy applied (PL-04 / #1889).
Fields
ReminderInject
Composes triggers (#1870) with the reminder pipeline (#1815) by
injecting a SystemReminder into a target agent session’s transcript
when the trigger matches (CH-05 / #1876). The reminder appears at the
session’s next turn boundary — same as any other reminder. No spawn,
no resume, no signal. body is a prompt-template string rendered
against {event} / {batch.events} per match. target resolution
happens at dispatch time via TargetExpr; missing-target dispatches
are recorded as audit events rather than crashing the trigger.
InterruptAndSuspend
CH-10 (#1910): emergency “panic” broadcast. When the trigger fires,
every running worker matched by target_agents is suspended
synchronously via the cooperative suspend pipeline used by
suspend_agent (#1837), bypassing the normal turn-boundary
delivery contract. Already-suspended or terminal workers are skipped
(no double-suspend, no error). reason is propagated to the
suspension envelope, the WorkerSuspended event, and the
triggers.interrupt_and_suspend.audit audit entry per suspension.
A no-target dispatch records a single roll-up audit entry and
returns a broadcast result with suspended_count: 0 — graceful
no-op rather than dispatch failure, mirroring the ReminderInject
missing-target contract.
Implementations§
Trait Implementations§
Source§impl Clone for TriggerHandlerSpec
impl Clone for TriggerHandlerSpec
Source§fn clone(&self) -> TriggerHandlerSpec
fn clone(&self) -> TriggerHandlerSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TriggerHandlerSpec
impl Debug for TriggerHandlerSpec
Source§impl From<&TriggerHandlerSpec> for DispatchUri
impl From<&TriggerHandlerSpec> for DispatchUri
Source§fn from(value: &TriggerHandlerSpec) -> Self
fn from(value: &TriggerHandlerSpec) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for TriggerHandlerSpec
impl !UnwindSafe for TriggerHandlerSpec
impl Freeze for TriggerHandlerSpec
impl Send for TriggerHandlerSpec
impl Sync for TriggerHandlerSpec
impl Unpin for TriggerHandlerSpec
impl UnsafeUnpin for TriggerHandlerSpec
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);