pub struct Rule {
pub name: String,
pub content: String,
pub description: Option<String>,
pub condition: Vec<Regex>,
pub scope: Vec<ScopeToken>,
pub interrupt_mode: InterruptMode,
pub globs: Vec<String>,
pub always_apply: bool,
pub source: RuleSource,
}Expand description
A TTSR rule. Condition is a regex matched against streaming output.
Fields§
§name: StringRule name (unique identifier).
content: StringRule body injected into the system prompt when conditions match.
description: Option<String>Human-readable summary of what the rule does.
condition: Vec<Regex>Regex patterns to match against stream text.
scope: Vec<ScopeToken>Scope tokens limiting which stream sources trigger.
interrupt_mode: InterruptModeWhen (if ever) this rule interrupts the agent loop.
globs: Vec<String>File globs that further restrict the rule’s applicability.
always_apply: boolIf true, always included in system prompt.
source: RuleSourceWhere the rule was loaded from.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnsafeUnpin for Rule
impl UnwindSafe for Rule
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