Enum dmntk_feel::values::Value
source · pub enum Value {
Show 38 variants
Boolean(bool),
BuiltInFunction(Bif),
ExpressionList(Values),
Context(FeelContext),
ContextEntry(Name, Box<Value>),
ContextEntryKey(Name),
ContextType(FeelType),
ContextTypeEntry(Name, FeelType),
ContextTypeEntryKey(Name),
Date(FeelDate),
DateTime(FeelDateTime),
DaysAndTimeDuration(FeelDaysAndTimeDuration),
FeelType(FeelType),
FormalParameter(Name, FeelType),
FormalParameters(Vec<(Name, FeelType)>),
FunctionBody(FunctionBody),
FunctionDefinition(Vec<(Name, FeelType)>, FunctionBody, FeelType),
IntervalEnd(Box<Value>, bool),
IntervalStart(Box<Value>, bool),
Irrelevant,
List(Values),
NamedParameter(Box<Value>, Box<Value>),
NamedParameters(BTreeMap<Name, (Value, usize)>),
NegatedCommaList(Values),
Null(Option<String>),
Number(FeelNumber),
ParameterName(Name),
ParameterTypes(Vec<Value>),
PositionalParameters(Values),
QualifiedNameSegment(Name),
Range(Box<Value>, bool, Box<Value>, bool),
String(String),
Time(FeelTime),
UnaryGreater(Box<Value>),
UnaryGreaterOrEqual(Box<Value>),
UnaryLess(Box<Value>),
UnaryLessOrEqual(Box<Value>),
YearsAndMonthsDuration(FeelYearsAndMonthsDuration),
}
Expand description
FEEL
value.
Variants§
Boolean(bool)
Value representing FEEL
boolean type.
BuiltInFunction(Bif)
Value for storing built-in function definition.
ExpressionList(Values)
Value representing a collection of comma-separated list of expressions.
Context(FeelContext)
Value representing a context.
ContextEntry(Name, Box<Value>)
Value representing a context entry.
ContextEntryKey(Name)
Value representing a key of the context entry.
ContextType(FeelType)
Value representing the context type.
ContextTypeEntry(Name, FeelType)
Value representing a context entry in context type definition.
ContextTypeEntryKey(Name)
Value representing a key of the context entry in context type definition.
Date(FeelDate)
Value for storing dates as FeelDate.
DateTime(FeelDateTime)
Value for storing date and time as FeelDateTime.
DaysAndTimeDuration(FeelDaysAndTimeDuration)
Value for days and time durations.
FeelType(FeelType)
Value representing the FEEL
type of a value.
FormalParameter(Name, FeelType)
Value representing function’s formal parameter with name and type.
FormalParameters(Vec<(Name, FeelType)>)
List of formal parameters.
FunctionBody(FunctionBody)
Definition of the function body.
FunctionDefinition(Vec<(Name, FeelType)>, FunctionBody, FeelType)
Value representing the function definition. This value holds the list of function’s formal parameters, the function’s body and expected result type.
IntervalEnd(Box<Value>, bool)
Value representing interval end.
IntervalStart(Box<Value>, bool)
Value representing interval start.
Irrelevant
Value representing FEEL
irrelevant
value.
List(Values)
Value representing a list of values.
NamedParameter(Box<Value>, Box<Value>)
Named parameter.
NamedParameters(BTreeMap<Name, (Value, usize)>)
Value representing a collection of named parameters.
NegatedCommaList(Values)
Value representing a collection of values representing a negated comma-separated list of expressions.
Null(Option<String>)
Null value with optional tracing message.
Number(FeelNumber)
Value representing FEEL
number type.
ParameterName(Name)
Name of the parameter.
ParameterTypes(Vec<Value>)
Value representing a list of function’s parameter types.
PositionalParameters(Values)
List of positional parameters.
QualifiedNameSegment(Name)
Value representing a segment of a qualified name.
Range(Box<Value>, bool, Box<Value>, bool)
Value representing a range
.
String(String)
String
value…
Time(FeelTime)
Value for storing time as FeelTime.
UnaryGreater(Box<Value>)
UnaryGreater value…
UnaryGreaterOrEqual(Box<Value>)
UnaryGreaterOrEqual value…
UnaryLess(Box<Value>)
UnaryLess value…
UnaryLessOrEqual(Box<Value>)
UnaryLessOrEqual value…
YearsAndMonthsDuration(FeelYearsAndMonthsDuration)
Value for storing years and months duration.
Implementations§
source§impl Value
impl Value
sourcepub fn is_null(&self) -> bool
pub fn is_null(&self) -> bool
Returns true
when the value is of type Value::Null.
sourcepub fn is_true(&self) -> bool
pub fn is_true(&self) -> bool
Returns true
when the value is of type Value::Boolean and is equal to true
.
sourcepub fn is_number(&self) -> bool
pub fn is_number(&self) -> bool
Returns true
when the value is of type Value::Number.
sourcepub fn try_from_xsd_integer(text: &str) -> Result<Self>
pub fn try_from_xsd_integer(text: &str) -> Result<Self>
Tries to convert xsd:integer
string into valid Value representing a number.
sourcepub fn try_from_xsd_decimal(text: &str) -> Result<Self>
pub fn try_from_xsd_decimal(text: &str) -> Result<Self>
Tries to convert xsd:decimal
string into valid Value representing a number.
sourcepub fn try_from_xsd_double(text: &str) -> Result<Self>
pub fn try_from_xsd_double(text: &str) -> Result<Self>
Tries to convert xsd:double
string into valid Value representing a number.
sourcepub fn try_from_xsd_boolean(text: &str) -> Result<Self>
pub fn try_from_xsd_boolean(text: &str) -> Result<Self>
Tries to convert xsd:boolean
string into valid Value representing a boolean.
sourcepub fn try_from_xsd_date(text: &str) -> Result<Self>
pub fn try_from_xsd_date(text: &str) -> Result<Self>
Tries to convert xsd:date
string into valid Value representing a date.
FEEL date format is fully conformant with xsd:date
.
sourcepub fn try_from_xsd_time(text: &str) -> Result<Self>
pub fn try_from_xsd_time(text: &str) -> Result<Self>
Tries to convert xsd:time
string into valid Value representing a time.
FEEL time format is fully conformant with xsd:time
.
sourcepub fn try_from_xsd_date_time(text: &str) -> Result<Self>
pub fn try_from_xsd_date_time(text: &str) -> Result<Self>
Tries to convert xsd:dateTime
string into valid Value representing a date and time.
FEEL date and time format is fully conformant with xsd:dateTime
.
sourcepub fn try_from_xsd_duration(text: &str) -> Result<Self>
pub fn try_from_xsd_duration(text: &str) -> Result<Self>
Tries to convert xsd:duration
string into valid Value representing a date and time.
FEEL durations are conformant with xsd:duration
but spit into two ranges.
Trait Implementations§
source§impl From<FeelContext> for Value
impl From<FeelContext> for Value
source§fn from(ctx: FeelContext) -> Self
fn from(ctx: FeelContext) -> Self
Converts this FeelContext to its Value representation.
source§impl PartialEq<Value> for Value
impl PartialEq<Value> for Value
source§impl ToFeelString for Value
impl ToFeelString for Value
source§fn to_feel_string(&self) -> String
fn to_feel_string(&self) -> String
Converts Value into FEEL
string.