pub enum DataValue {
Literal(Value),
SpecReference(SpecRef),
TypeDeclaration {
base: ParentType,
constraints: Option<Vec<Constraint>>,
from: Option<SpecRef>,
},
Reference {
target: Reference,
constraints: Option<Vec<Constraint>>,
},
}Expand description
Parse-time data value (before type resolution)
Variants§
Literal(Value)
A literal value (parse-time; type will be resolved during planning)
SpecReference(SpecRef)
A reference to another spec
TypeDeclaration
A type declaration: data x: number -> minimum 5 or data y: x -> minimum 5
Reference
A value-copy reference to another data or rule, with optional additional constraints.
Two surface forms produce this variant:
- Dotted RHS in any position — e.g.
data license2: law.otherordata license2: law.other -> minimum 5. A dotted RHS is never a typedef name, so it unambiguously means “copy from this data or rule.” - Non-dotted RHS in a binding LHS — e.g.
data license.other: src. When the LHS has segments (a binding path into another spec) the RHS is read as a value-copy reference to a name in the enclosing spec, not as a typedef.
data x: someident (LHS without segments, RHS without dots) is the one
case that stays a TypeDeclaration — someident is treated as a typedef
name. See parser parse_data_value for the discriminator.
The target is resolved during planning to either a DataPath or a RulePath.
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.