pub trait Guard: Send + Sync {
// Provided methods
fn before_shell(&self, _lane: &str, _command: &str) -> Option<String> { ... }
fn before_write(&self, _lane: &str, _path: &str, _content: &str) -> Value { ... }
fn guard_stats(&self) -> Vec<Value> { ... }
fn begin_turn(&self) { ... }
fn cell_started(&self, _lane: &str) { ... }
fn cell_ended(&self, _lane: &str) { ... }
fn take_pending(&self, _lane: &str) -> Option<String> { ... }
}Expand description
The before-write and before-shell guards (Loki). The default allows everything.
Provided Methods§
Sourcefn before_shell(&self, _lane: &str, _command: &str) -> Option<String>
fn before_shell(&self, _lane: &str, _command: &str) -> Option<String>
A command of the cell on lane: Some(reason) blocks it, “bash command was not run: {reason}”.
Sourcefn before_write(&self, _lane: &str, _path: &str, _content: &str) -> Value
fn before_write(&self, _lane: &str, _path: &str, _content: &str) -> Value
A write of the cell on lane: {blocked, reason?, notes?} as runtime.py reads it.
Sourcefn guard_stats(&self) -> Vec<Value>
fn guard_stats(&self) -> Vec<Value>
Each file-hook guard’s statistics (fileHooks.stats()), for rlm.pool.
Sourcefn begin_turn(&self)
fn begin_turn(&self)
A new root turn began: per-turn guard times start from zero.
Sourcefn cell_started(&self, _lane: &str)
fn cell_started(&self, _lane: &str)
A cell on lane is starting (after-cell checks take their baseline).
Sourcefn cell_ended(&self, _lane: &str)
fn cell_ended(&self, _lane: &str)
A cell on lane ended (after-cell checks start in the background).
Sourcefn take_pending(&self, _lane: &str) -> Option<String>
fn take_pending(&self, _lane: &str) -> Option<String>
What after-cell checks found for lane and it has not been shown yet.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".