Struct zen_engine::Decision
source · pub struct Decision<Loader, CustomNode>where
Loader: DecisionLoader + 'static,
CustomNode: CustomNodeAdapter + 'static,{ /* private fields */ }Expand description
Represents a JDM decision which can be evaluated
Implementations§
source§impl<L, A> Decision<L, A>where
L: DecisionLoader + 'static,
A: CustomNodeAdapter + 'static,
impl<L, A> Decision<L, A>where
L: DecisionLoader + 'static,
A: CustomNodeAdapter + 'static,
pub fn with_loader<Loader>(self, loader: Arc<Loader>) -> Decision<Loader, A>where
Loader: DecisionLoader,
pub fn with_adapter<Adapter>(
self,
adapter: Arc<Adapter>,
) -> Decision<L, Adapter>where
Adapter: CustomNodeAdapter,
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
pub fn validate(&self) -> Result<(), DecisionGraphValidationError>
Trait Implementations§
source§impl From<Arc<DecisionContent>> for Decision<NoopLoader, NoopCustomNode>
impl From<Arc<DecisionContent>> for Decision<NoopLoader, NoopCustomNode>
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, NoopCustomNode>
impl From<DecisionContent> for Decision<NoopLoader, NoopCustomNode>
source§fn from(value: DecisionContent) -> Self
fn from(value: DecisionContent) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<Loader, CustomNode> Freeze for Decision<Loader, CustomNode>
impl<Loader, CustomNode> RefUnwindSafe for Decision<Loader, CustomNode>where
Loader: RefUnwindSafe,
CustomNode: RefUnwindSafe,
impl<Loader, CustomNode> Send for Decision<Loader, CustomNode>
impl<Loader, CustomNode> Sync for Decision<Loader, CustomNode>
impl<Loader, CustomNode> Unpin for Decision<Loader, CustomNode>
impl<Loader, CustomNode> UnwindSafe for Decision<Loader, CustomNode>where
Loader: RefUnwindSafe,
CustomNode: 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more