Skip to main content

RuleRegistry

Trait RuleRegistry 

Source
pub trait RuleRegistry:
    Send
    + Sync
    + 'static {
    // Required method
    fn rules<'a>(
        &'a self,
    ) -> Pin<Box<dyn Future<Output = Vec<Rule>> + Send + 'a>>;

    // Provided methods
    fn mark_injected(&self, _name: &str, _turn: u64) { ... }
    fn injected_records(&self) -> Vec<(String, u64)> { ... }
    fn restore(&self, _records: Vec<(String, u64)>) { ... }
}
Expand description

Registry of TTSR rules (supplied by the host).

This is a simplified version of oxicode_sdk::ports::RuleRegistry that lives in oxicode-agent to avoid a dependency cycle.

Required Methods§

Source

fn rules<'a>(&'a self) -> Pin<Box<dyn Future<Output = Vec<Rule>> + Send + 'a>>

Returns a future that resolves to the current set of registered rules.

Provided Methods§

Source

fn mark_injected(&self, _name: &str, _turn: u64)

Mark that a rule was injected at a given turn.

Source

fn injected_records(&self) -> Vec<(String, u64)>

Return all injection records for compaction survival.

Source

fn restore(&self, _records: Vec<(String, u64)>)

Restore injection records after compaction.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§