Struct zen_engine::Decision
source · pub struct Decision<L>where
L: DecisionLoader,{ /* private fields */ }Expand description
Represents a JDM decision which can be evaluated
Implementations§
source§impl<L> Decision<L>where
L: DecisionLoader,
impl<L> Decision<L>where L: DecisionLoader,
pub fn with_loader<NL>(self, loader: Arc<NL>) -> Decision<NL>where NL: DecisionLoader,
sourcepub async fn evaluate(
&self,
context: &Value
) -> Result<DecisionGraphResponse, Box<EvaluationError>>
pub async fn evaluate( &self, context: &Value ) -> Result<DecisionGraphResponse, Box<EvaluationError>>
Evaluates a decision using an in-memory reference stored in struct
sourcepub async fn evaluate_with_opts(
&self,
context: &Value,
options: EvaluationOptions
) -> Result<DecisionGraphResponse, Box<EvaluationError>>
pub async fn evaluate_with_opts( &self, context: &Value, options: EvaluationOptions ) -> Result<DecisionGraphResponse, Box<EvaluationError>>
Evaluates a decision using in-memory reference with advanced options
Trait Implementations§
source§impl From<Arc<DecisionContent, Global>> for Decision<NoopLoader>
impl From<Arc<DecisionContent, Global>> for Decision<NoopLoader>
source§fn from(value: Arc<DecisionContent>) -> Self
fn from(value: Arc<DecisionContent>) -> Self
Converts to this type from the input type.
source§impl From<DecisionContent> for Decision<NoopLoader>
impl From<DecisionContent> for Decision<NoopLoader>
source§fn from(value: DecisionContent) -> Self
fn from(value: DecisionContent) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<L> RefUnwindSafe for Decision<L>where L: RefUnwindSafe,
impl<L> Send for Decision<L>where L: Send + Sync,
impl<L> Sync for Decision<L>where L: Send + Sync,
impl<L> Unpin for Decision<L>
impl<L> UnwindSafe for Decision<L>where L: RefUnwindSafe,
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