Skip to main content

Guard

Trait Guard 

Source
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§

Source

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}”.

Source

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.

Source

fn guard_stats(&self) -> Vec<Value>

Each file-hook guard’s statistics (fileHooks.stats()), for rlm.pool.

Source

fn begin_turn(&self)

A new root turn began: per-turn guard times start from zero.

Source

fn cell_started(&self, _lane: &str)

A cell on lane is starting (after-cell checks take their baseline).

Source

fn cell_ended(&self, _lane: &str)

A cell on lane ended (after-cell checks start in the background).

Source

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".

Implementors§