pub struct CompiledPolicyRule {
pub id: String,
pub version: String,
pub policy_hash: String,
pub bytecode: Bytecode,
pub effects: Vec<RuleEffect>,
pub match_program: Vec<Instruction>,
pub action_program: Vec<ActionInstruction>,
}Expand description
Compiled policy rule evaluated through the bytecode VM.
Fields§
§id: String§version: String§policy_hash: String§bytecode: Bytecode§effects: Vec<RuleEffect>§match_program: Vec<Instruction>§action_program: Vec<ActionInstruction>Implementations§
Source§impl CompiledPolicyRule
impl CompiledPolicyRule
pub fn from_ast(ast: &RuleAst) -> Result<Self, EngineError>
pub fn from_source(source: &str) -> Result<Self, EngineError>
pub fn evaluate(&self, ctx: &EvaluationContext) -> Result<bool, EngineError>
Sourcepub fn evaluate_match_decision(
&self,
ctx: &EvaluationContext,
) -> Result<Option<Decision>, EngineError>
pub fn evaluate_match_decision( &self, ctx: &EvaluationContext, ) -> Result<Option<Decision>, EngineError>
Preferred compiled-path evaluation: returns Some(decision) on match, None otherwise.
pub fn apply_action(&self) -> ActionResult
Trait Implementations§
Source§impl Clone for CompiledPolicyRule
impl Clone for CompiledPolicyRule
Source§fn clone(&self) -> CompiledPolicyRule
fn clone(&self) -> CompiledPolicyRule
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CompiledPolicyRule
impl RefUnwindSafe for CompiledPolicyRule
impl Send for CompiledPolicyRule
impl Sync for CompiledPolicyRule
impl Unpin for CompiledPolicyRule
impl UnsafeUnpin for CompiledPolicyRule
impl UnwindSafe for CompiledPolicyRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more