Skip to main content

CognitumRunGate

Trait CognitumRunGate 

Source
pub trait CognitumRunGate: Send + Sync {
    // Required method
    fn check(&self, req: &RunRequest<'_>) -> Result<RunVerdict, RunRefusal>;

    // Provided methods
    fn claims(&self, _sha256: &str, _blake3: &str) -> bool { ... }
    fn revoked(&self, _blake3: &str) -> bool { ... }
}
Expand description

The gate a workload-host asks before it installs or starts a Cognitum-origin cog.

Required Methods§

Source

fn check(&self, req: &RunRequest<'_>) -> Result<RunVerdict, RunRefusal>

Decide req (hashes computed from the bytes that will run).

Provided Methods§

Source

fn claims(&self, _sha256: &str, _blake3: &str) -> bool

True when these bytes are known Cognitum bytes (listed by a held grant, or a revoked artifact hash) whatever the package says.

Source

fn revoked(&self, _blake3: &str) -> bool

True when this BLAKE3 is revoked as an ArtifactHash.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§