pub struct TypedLiteral {
pub value: ValueKind,
pub lemma_type: Arc<LemmaType>,
}Expand description
Planning-time literal: value plus resolved type.
Used by ExpressionKind::Literal and coerce/typing paths. Runtime
OperationResult / value-table slots store bare LiteralValue; the type
is on the node (NormalForm.result_type) or data definition.
Fields§
§value: ValueKind§lemma_type: Arc<LemmaType>Implementations§
Source§impl TypedLiteral
impl TypedLiteral
pub fn to_literal(&self) -> LiteralValue
pub fn into_literal(self) -> LiteralValue
Source§impl TypedLiteral
impl TypedLiteral
pub fn text(s: impl Into<Arc<str>>) -> Self
pub fn text_with_type( s: impl Into<Arc<str>>, lemma_type: Arc<LemmaType>, ) -> Self
pub fn number(n: RationalInteger) -> Self
pub fn number_from_decimal(decimal: Decimal) -> Self
pub fn number_with_type(n: RationalInteger, lemma_type: Arc<LemmaType>) -> Self
pub fn number_with_type_from_decimal( decimal: Decimal, lemma_type: Arc<LemmaType>, ) -> Self
Sourcepub fn measure_with_bound_unit(
n: RationalInteger,
unit_name: impl Into<String>,
lemma_type: Arc<LemmaType>,
) -> Self
pub fn measure_with_bound_unit( n: RationalInteger, unit_name: impl Into<String>, lemma_type: Arc<LemmaType>, ) -> Self
Build a Measure literal bound to a specific declared unit.
pub fn measure_with_type(n: RationalInteger, lemma_type: Arc<LemmaType>) -> Self
pub fn measure_with_signature( n: RationalInteger, lemma_type: Arc<LemmaType>, ) -> Self
Sourcepub fn number_interpreted_as_measure(value: RationalInteger) -> Self
pub fn number_interpreted_as_measure(value: RationalInteger) -> Self
Unit literal outside a measure type context: no family, so no dimensions.
pub fn from_bool(b: bool) -> Self
pub fn from_datetime(dt: &DateTimeValue) -> Self
pub fn date(dt: SemanticDateTime) -> Self
pub fn date_with_type(dt: SemanticDateTime, lemma_type: Arc<LemmaType>) -> Self
pub fn time(t: SemanticTime) -> Self
pub fn time_with_type(t: SemanticTime, lemma_type: Arc<LemmaType>) -> Self
pub fn calendar( value: RationalInteger, unit: SemanticCalendarUnit, lemma_type: Arc<LemmaType>, ) -> Self
pub fn calendar_from_decimal( value: Decimal, unit: SemanticCalendarUnit, lemma_type: Arc<LemmaType>, ) -> Self
pub fn calendar_with_type( value: RationalInteger, unit: SemanticCalendarUnit, lemma_type: Arc<LemmaType>, ) -> Self
pub fn ratio(r: RationalInteger) -> Self
pub fn ratio_from_decimal(r: Decimal) -> Self
pub fn ratio_with_type(r: RationalInteger, lemma_type: Arc<LemmaType>) -> Self
pub fn ratio_with_bound_unit( r: RationalInteger, unit_name: impl Into<String>, lemma_type: Arc<LemmaType>, ) -> Self
pub fn range(left: TypedLiteral, right: TypedLiteral) -> Self
pub fn display_value(&self) -> String
pub fn get_type(&self) -> &LemmaType
pub fn byte_size(&self) -> usize
Trait Implementations§
Source§impl Clone for TypedLiteral
impl Clone for TypedLiteral
Source§impl Debug for TypedLiteral
impl Debug for TypedLiteral
Source§impl Display for TypedLiteral
impl Display for TypedLiteral
impl Eq for TypedLiteral
Source§impl From<&TypedLiteral> for LiteralValue
impl From<&TypedLiteral> for LiteralValue
Source§fn from(typed: &TypedLiteral) -> Self
fn from(typed: &TypedLiteral) -> Self
Converts to this type from the input type.
Source§impl From<TypedLiteral> for LiteralValue
impl From<TypedLiteral> for LiteralValue
Source§fn from(typed: TypedLiteral) -> Self
fn from(typed: TypedLiteral) -> Self
Converts to this type from the input type.
Source§impl Hash for TypedLiteral
impl Hash for TypedLiteral
Source§impl PartialEq for TypedLiteral
impl PartialEq for TypedLiteral
impl StructuralPartialEq for TypedLiteral
Auto Trait Implementations§
impl Forget for TypedLiteral
impl Freeze for TypedLiteralwhere
*const u8 is !null: Freeze,
PhantomData<u32>: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const TypedLiteral is !null: Freeze,
PhantomData<TypedLiteral>: Freeze,
PhantomData<PathSegment>: Freeze,
*const ArcInner<RowInstance> is !null: Freeze,
PhantomData<ArcInner<RowInstance>>: Freeze,
*const InstanceKey is !null: Freeze,
PhantomData<InstanceKey>: Freeze,
*const ArcInner<[TypedLiteral]> is !null: Freeze,
PhantomData<ArcInner<[TypedLiteral]>>: Freeze,
*const ArcInner<RowStore> is !null: Freeze,
PhantomData<ArcInner<RowStore>>: Freeze,
*const ArcInner<LemmaType> is !null: Freeze,
PhantomData<ArcInner<LemmaType>>: Freeze,
*const ArcInner<KeyIndex> is !null: Freeze,
PhantomData<ArcInner<KeyIndex>>: Freeze,
impl Move for TypedLiteral
impl RefUnwindSafe for TypedLiteral
impl Send for TypedLiteral
impl Sync for TypedLiteral
impl Unpin for TypedLiteral
impl UnsafeUnpin for TypedLiteralwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u32>: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const TypedLiteral is !null: UnsafeUnpin,
PhantomData<TypedLiteral>: UnsafeUnpin,
PhantomData<PathSegment>: UnsafeUnpin,
*const ArcInner<RowInstance> is !null: UnsafeUnpin,
PhantomData<ArcInner<RowInstance>>: UnsafeUnpin,
*const InstanceKey is !null: UnsafeUnpin,
PhantomData<InstanceKey>: UnsafeUnpin,
*const ArcInner<[TypedLiteral]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[TypedLiteral]>>: UnsafeUnpin,
*const ArcInner<RowStore> is !null: UnsafeUnpin,
PhantomData<ArcInner<RowStore>>: UnsafeUnpin,
*const ArcInner<LemmaType> is !null: UnsafeUnpin,
PhantomData<ArcInner<LemmaType>>: UnsafeUnpin,
*const ArcInner<KeyIndex> is !null: UnsafeUnpin,
PhantomData<ArcInner<KeyIndex>>: UnsafeUnpin,
impl UnwindSafe for TypedLiteralwhere
RawVecInner: UnwindSafe,
Arc<str>: UnwindSafe,
BoxRaw<TypedLiteral>: UnwindSafe,
Arc<RowInstance>: UnwindSafe,
BoxRaw<InstanceKey>: UnwindSafe,
Arc<[TypedLiteral]>: UnwindSafe,
Arc<RowStore>: UnwindSafe,
Arc<LemmaType>: UnwindSafe,
Arc<KeyIndex>: UnwindSafe,
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.