caffeine_lang/value
Types
Unit suffix on a duration literal. Round-trippable with duration_unit_to_string.
pub type DurationUnit {
Millisecond
Second
Minute
Hour
Day
}
Constructors
-
Millisecond -
Second -
Minute -
Hour -
Day
A typed value ADT that carries type information forward through the pipeline. Replaces the use of Dynamic for values in the compiler pipeline.
pub type Value {
StringValue(String)
IntValue(Int)
FloatValue(Float)
PercentageValue(Float)
BoolValue(Bool)
ListValue(List(Value))
DictValue(dict.Dict(String, Value))
DurationValue(amount: Float, unit: DurationUnit)
NilValue
}
Constructors
-
StringValue(String) -
IntValue(Int) -
FloatValue(Float) -
PercentageValue(Float) -
BoolValue(Bool) -
ListValue(List(Value)) -
-
DurationValue(amount: Float, unit: DurationUnit)A duration literal such as
10d,50ms,0.200s.amountis the as-written magnitude;unitthe as-written suffix. Useduration_to_millisecondsfor unit-normalized comparison. -
NilValueRepresents an absent Optional or Defaulted value.