Skip to main content

TaskAccessor

Trait TaskAccessor 

Source
pub trait TaskAccessor {
    // Required methods
    fn context_path(&self) -> Option<&str>;
    fn item_context_path(&self) -> Option<&str>;
    fn id(&self) -> &str;
    fn task_type(&self) -> &EvaluationTaskType;
    fn operator(&self) -> &ComparisonOperator;
    fn expected_value(&self) -> &Value;
    fn depends_on(&self) -> &[String];
    fn add_result(&mut self, result: AssertionResult);
}

Required Methods§

Source

fn context_path(&self) -> Option<&str>

Returns optional context path - avoids &Option<String> pattern

Source

fn item_context_path(&self) -> Option<&str>

When context_path resolves to an array of objects, this path is applied to each element to extract the value before the operator is evaluated.

Source

fn id(&self) -> &str

Returns assertion ID as string slice

Source

fn task_type(&self) -> &EvaluationTaskType

Source

fn operator(&self) -> &ComparisonOperator

Returns reference to comparison operator

Source

fn expected_value(&self) -> &Value

Returns reference to expected value

Source

fn depends_on(&self) -> &[String]

Returns slice of dependency IDs - more efficient than &Vec<String>

Source

fn add_result(&mut self, result: AssertionResult)

Implementors§