pub enum StringExpression {
Literal(String),
GetProperty {
key: String,
fallback: String,
},
GetState {
key: String,
fallback: String,
},
Concat(Box<StringExpression>, Box<StringExpression>),
Upcase(Box<StringExpression>),
Downcase(Box<StringExpression>),
}Expand description
A string expression that evaluates to a String.
Used as the input for Match expressions.
Variants§
Literal(String)
A constant string literal.
GetProperty
Read a string feature property.
GetState
Read a string feature-state value.
Concat(Box<StringExpression>, Box<StringExpression>)
Concatenate two strings.
Upcase(Box<StringExpression>)
Uppercase.
Downcase(Box<StringExpression>)
Lowercase.
Implementations§
Source§impl StringExpression
impl StringExpression
Sourcepub fn eval(&self, ctx: &ExprEvalContext<'_>) -> String
pub fn eval(&self, ctx: &ExprEvalContext<'_>) -> String
Evaluate this string expression against a context.
Trait Implementations§
Source§impl Clone for StringExpression
impl Clone for StringExpression
Source§fn clone(&self) -> StringExpression
fn clone(&self) -> StringExpression
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StringExpression
impl Debug for StringExpression
Source§impl PartialEq for StringExpression
impl PartialEq for StringExpression
impl StructuralPartialEq for StringExpression
Auto Trait Implementations§
impl Freeze for StringExpression
impl RefUnwindSafe for StringExpression
impl Send for StringExpression
impl Sync for StringExpression
impl Unpin for StringExpression
impl UnsafeUnpin for StringExpression
impl UnwindSafe for StringExpression
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