pub struct EvaluateDecisionRequest<T: EvaluateDecisionRequestState> { /* private fields */ }Expand description
Request to evaluate a DMN decision
The decision to evaluate can be specified either by using its unique key (as returned by DeployResource), or using the decision ID. When using the decision ID, the latest deployed version of the decision is used.
§Examples
ⓘ
client
.evaluate_decision()
.with_decision_key(123456)
.with_decision_id(String::from("decision_id"))
.send()
.await?;Implementations§
Source§impl EvaluateDecisionRequest<Initial>
impl EvaluateDecisionRequest<Initial>
Sourcepub fn with_decision_key(
self,
decision_key: i64,
) -> EvaluateDecisionRequest<WithKey>
pub fn with_decision_key( self, decision_key: i64, ) -> EvaluateDecisionRequest<WithKey>
Source§impl EvaluateDecisionRequest<WithKey>
impl EvaluateDecisionRequest<WithKey>
Sourcepub fn with_decision_id(
self,
decision_id: String,
) -> EvaluateDecisionRequest<WithId>
pub fn with_decision_id( self, decision_id: String, ) -> EvaluateDecisionRequest<WithId>
Source§impl EvaluateDecisionRequest<WithId>
impl EvaluateDecisionRequest<WithId>
Sourcepub fn with_variables<T: Serialize>(self, data: T) -> Result<Self, ClientError>
pub fn with_variables<T: Serialize>(self, data: T) -> Result<Self, ClientError>
Sets the variables used for decision evaluation
The variables must be a JSON object, as variables will be mapped in a key-value fashion.
For example: { "a": 1, "b": 2 } will create two variables named “a” and “b”.
§Arguments
data- The variables to be used for decision evaluation
§Returns
The updated EvaluateDecisionRequest with the variables set.
§Errors
Returns a ClientError if the variables cannot be serialized to JSON.
Sourcepub async fn send<T: DeserializeOwned>(
self,
) -> Result<EvaluateDecisionResponse<T>, ClientError>
pub async fn send<T: DeserializeOwned>( self, ) -> Result<EvaluateDecisionResponse<T>, ClientError>
Sourcepub fn with_tenant_id(self, tenant_id: String) -> Self
pub fn with_tenant_id(self, tenant_id: String) -> Self
Trait Implementations§
Source§impl<T: Clone + EvaluateDecisionRequestState> Clone for EvaluateDecisionRequest<T>
impl<T: Clone + EvaluateDecisionRequestState> Clone for EvaluateDecisionRequest<T>
Source§fn clone(&self) -> EvaluateDecisionRequest<T>
fn clone(&self) -> EvaluateDecisionRequest<T>
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<T> !Freeze for EvaluateDecisionRequest<T>
impl<T> !RefUnwindSafe for EvaluateDecisionRequest<T>
impl<T> Send for EvaluateDecisionRequest<T>where
T: Send,
impl<T> Sync for EvaluateDecisionRequest<T>where
T: Sync,
impl<T> Unpin for EvaluateDecisionRequest<T>where
T: Unpin,
impl<T> !UnwindSafe for EvaluateDecisionRequest<T>
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§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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request