pub enum DataValue {
Definition {
base: Option<ParentType>,
constraints: Option<Vec<Constraint>>,
value: Option<Value>,
},
Import(SpecRef),
Fill(FillRhs),
}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(SpecRef)
Import from another spec (surface syntax is uses; alias is LemmaData::reference).
Fill(FillRhs)
Value assignment into an existing data slot (surface syntax is fill). Planning folds
this into resolved slot values; it does not declare a new type row.
data x: someident (LHS without segments, RHS without dots) uses DataValue::Definition
with someident as the parent type name. See parser [crate::parsing::parser::Parser::parse_data_value].
Implementations§
Source§impl DataValue
impl DataValue
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more