pub struct IfOperation {
pub condition_ops: Vec<Box<dyn Operation + Send + Sync>>,
pub then_ops: Vec<Box<dyn Operation + Send + Sync>>,
pub else_ops: Vec<Box<dyn Operation + Send + Sync>>,
}Expand description
Conditional (if-then-else) operation
Evaluates a condition and returns the result of either the then or else branch.
Fields§
§condition_ops: Vec<Box<dyn Operation + Send + Sync>>Operations that produce the condition value
then_ops: Vec<Box<dyn Operation + Send + Sync>>Operations to evaluate if condition is truthy
else_ops: Vec<Box<dyn Operation + Send + Sync>>Operations to evaluate if condition is falsy
Implementations§
Trait Implementations§
Source§impl Operation for IfOperation
impl Operation for IfOperation
Source§fn apply_with_context(
&self,
value: &Value,
context: &mut Option<&mut dyn Context>,
) -> Result<Value>
fn apply_with_context( &self, value: &Value, context: &mut Option<&mut dyn Context>, ) -> Result<Value>
Apply the operation to a value with optional context
Source§fn description(&self) -> String
fn description(&self) -> String
Get a description of what this operation does
Source§fn is_applicable(&self, value: &Value) -> bool
fn is_applicable(&self, value: &Value) -> bool
Check if this operation can be applied to the given value type
Auto Trait Implementations§
impl Freeze for IfOperation
impl !RefUnwindSafe for IfOperation
impl Send for IfOperation
impl Sync for IfOperation
impl Unpin for IfOperation
impl !UnwindSafe for IfOperation
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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> 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