pub enum OperationResult {
Value(BoundValueKind),
Veto(VetoType),
}Expand description
Result of evaluating a rule, expression, or data leaf.
Variants§
Value(BoundValueKind)
Operation produced a value (canonical magnitude + optional written unit)
Veto(VetoType)
Operation was vetoed (valid result, no value)
Implementations§
Source§impl OperationResult
impl OperationResult
Sourcepub fn from_literal(value: LiteralValue) -> Self
pub fn from_literal(value: LiteralValue) -> Self
Wrap a typeless literal with no written-unit binding.
pub fn from_bound(bound: BoundValueKind) -> Self
pub fn vetoed(&self) -> bool
Sourcepub fn is_missing_data(&self) -> bool
pub fn is_missing_data(&self) -> bool
True when this result is a VetoType::MissingData or VetoType::MissingRowData veto.
pub fn value(&self) -> Option<&BoundValueKind>
Sourcepub fn literal_value(&self) -> Option<LiteralValue>
pub fn literal_value(&self) -> Option<LiteralValue>
Typeless payload (written unit dropped). Prefer Self::value when the binding matters.
pub fn number(number: Decimal) -> Self
pub fn measure( value: Decimal, unit: impl Into<String>, lemma_type: Option<LemmaType>, ) -> Self
pub fn text(text: impl Into<String>) -> Self
pub fn date(date: impl Into<SemanticDateTime>) -> Self
pub fn time(time: impl Into<SemanticTime>) -> Self
pub fn boolean(boolean: bool) -> Self
pub fn ratio(rational: Decimal) -> Self
pub fn veto(veto: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for OperationResult
impl Clone for OperationResult
Source§impl Debug for OperationResult
impl Debug for OperationResult
impl Eq for OperationResult
Source§impl Hash for OperationResult
impl Hash for OperationResult
Source§impl PartialEq for OperationResult
impl PartialEq for OperationResult
Source§impl Serialize for OperationResult
impl Serialize for OperationResult
impl StructuralPartialEq for OperationResult
Auto Trait Implementations§
impl Freeze for OperationResult
impl RefUnwindSafe for OperationResult
impl Send for OperationResult
impl Sync for OperationResult
impl Unpin for OperationResult
impl UnsafeUnpin for OperationResult
impl UnwindSafe for OperationResult
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.