pub struct DerivedParameter {
pub name: ParameterName,
pub kind: ValueKind,
pub expression: Expression,
pub labels: Labels,
pub tags: Tags,
}Expand description
A parameter whose value is computed from other already-bound values
by an Expression.
Derived parameters may not be used as axes (SRD-0004 D9) — that’s enforced by the test-plan layer.
Fields§
§name: ParameterNameParameter name.
kind: ValueKindDeclared output kind (Integer/Double/Boolean/String).
expression: ExpressionThe expression that produces the value.
labels: LabelsIntrinsic facts.
Organisational tags.
Implementations§
Source§impl DerivedParameter
impl DerivedParameter
Sourcepub fn new(
name: ParameterName,
kind: ValueKind,
expression: Expression,
) -> Result<Self>
pub fn new( name: ParameterName, kind: ValueKind, expression: Expression, ) -> Result<Self>
Construct a derived parameter. Rejects ValueKind::Selection.
Sourcepub fn compute(
&self,
bindings: &ValueBindings,
) -> Result<Value, DerivationError>
pub fn compute( &self, bindings: &ValueBindings, ) -> Result<Value, DerivationError>
Evaluate the expression against the given bindings and wrap the
result in a Value with Derived provenance.
Sourcepub fn with_label(self, key: LabelKey, value: LabelValue) -> Result<Self>
pub fn with_label(self, key: LabelKey, value: LabelValue) -> Result<Self>
Add a label.
Trait Implementations§
Source§impl Attributed for DerivedParameter
impl Attributed for DerivedParameter
Source§impl Clone for DerivedParameter
impl Clone for DerivedParameter
Source§fn clone(&self) -> DerivedParameter
fn clone(&self) -> DerivedParameter
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 moreSource§impl Debug for DerivedParameter
impl Debug for DerivedParameter
Source§impl<'de> Deserialize<'de> for DerivedParameter
impl<'de> Deserialize<'de> for DerivedParameter
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DerivedParameter
impl PartialEq for DerivedParameter
Source§impl Serialize for DerivedParameter
impl Serialize for DerivedParameter
impl StructuralPartialEq for DerivedParameter
Auto Trait Implementations§
impl Freeze for DerivedParameter
impl RefUnwindSafe for DerivedParameter
impl Send for DerivedParameter
impl Sync for DerivedParameter
impl Unpin for DerivedParameter
impl UnsafeUnpin for DerivedParameter
impl UnwindSafe for DerivedParameter
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