pub enum DataValue {
Definition {
base: Option<ParentType>,
constraints: Option<Vec<Constraint>>,
value: Option<Value>,
},
Import {
spec_ref: SpecRef,
bindings: Vec<UsesBinding>,
},
}Expand description
Parse-time data value (before type resolution)
Variants§
Definition
Declares data: optional explicit parent type, optional constraints (-> ...),
and optional literal value.
Examples:
data x: 3.14→base: None,value: Some(Number)data x: number -> minimum 0→base: Some(Number),constraints: Some(...)data x: finance.money→base: Some(Qualified { spec_alias: "finance", inner: Custom("money") })
Import
Import from another spec (surface syntax is uses; alias is [LemmaData::reference]).
Implementations§
Source§impl DataValue
impl DataValue
pub fn import(spec_ref: SpecRef) -> Self
Sourcepub fn is_definition_literal_only(&self) -> bool
pub fn is_definition_literal_only(&self) -> bool
Whether this is only a literal RHS (data x: 3.14), valid as a binding value.
Sourcepub fn definition_needs_type_resolution(&self) -> bool
pub fn definition_needs_type_resolution(&self) -> bool
Whether planning must resolve this [LemmaData] row through the type resolver / named types.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DataValue
impl<'de> Deserialize<'de> for DataValue
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
impl StructuralPartialEq for DataValue
Auto Trait Implementations§
impl Freeze for DataValue
impl RefUnwindSafe for DataValue
impl Send for DataValue
impl Sync for DataValue
impl Unpin for DataValue
impl UnsafeUnpin for DataValue
impl UnwindSafe for DataValue
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