Engine

Trait Engine 

Source
pub trait Engine {
    type Policy: Policy<Effect = Self::Effect>;
    type Effect;

    // Required methods
    fn add_policy(&mut self, policy: &[u8]) -> Result<PolicyId, EngineError>;
    fn get_policy(&self, id: PolicyId) -> Result<&Self::Policy, EngineError>;
}
Expand description

The Engine manages storing and retrieving Policy.

Required Associated Types§

Source

type Policy: Policy<Effect = Self::Effect>

Source

type Effect

Required Methods§

Source

fn add_policy(&mut self, policy: &[u8]) -> Result<PolicyId, EngineError>

Add a policy to this runtime.

§Arguments
  • policy - Byte slice that holds a policy.
Source

fn get_policy(&self, id: PolicyId) -> Result<&Self::Policy, EngineError>

Get a policy from this runtime.

§Arguments
  • policy - Byte slice representing a PolicyId.

Implementors§