Operation

Trait Operation 

Source
pub trait Operation {
    // Required methods
    fn apply(&self, value: &Value) -> Result<Value>;
    fn description(&self) -> String;

    // Provided method
    fn is_applicable(&self, value: &Value) -> bool { ... }
}
Expand description

Trait for operations that can be applied to values

This trait provides a common interface for all data operations, allowing them to be composed and chained together.

Required Methods§

Source

fn apply(&self, value: &Value) -> Result<Value>

Apply the operation to a value

Source

fn description(&self) -> String

Get a description of what this operation does

Provided Methods§

Source

fn is_applicable(&self, value: &Value) -> bool

Check if this operation can be applied to the given value type

Implementors§