Skip to main content

FactStore

Trait FactStore 

Source
pub trait FactStore {
    // Required methods
    fn insert_authorized(
        &mut self,
        capabilities: &CapabilitySet,
        data: &mut dyn DatumStore,
        claim: Claim,
    ) -> Result<Ref>;
    fn query_authorized(
        &self,
        cx: &Cx,
        pattern: ClaimPattern,
    ) -> Result<Vec<Claim>>;
}
Expand description

Contract for storing and querying Claims under visibility rules.

This is protocol the libraries implement; the kernel ships a BTreeMap- backed BTreeFactStore and defines the capability-gated read rules, not the persistence strategy.

Required Methods§

Source

fn insert_authorized( &mut self, capabilities: &CapabilitySet, data: &mut dyn DatumStore, claim: Claim, ) -> Result<Ref>

Inserts claim after checking the caller’s capabilities, returning its content Ref; private claims require the fact-private capability.

Source

fn query_authorized(&self, cx: &Cx, pattern: ClaimPattern) -> Result<Vec<Claim>>

Returns the claims matching pattern that are visible under cx’s capabilities.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§