#[non_exhaustive]pub enum Expression<'a> {
Literal(LiteralExpression<'a>),
Variable(VariableExpression<'a>),
Function(FunctionExpression<'a>),
}Expand description
An expression: an operand with an optional function, or a function alone.
Not exhaustive: the spec says future versions may add expression shapes.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Literal(LiteralExpression<'a>)
{|literal| :fn …} or {literal}.
Variable(VariableExpression<'a>)
{$var :fn …} or {$var}.
Function(FunctionExpression<'a>)
{:fn …}.
Implementations§
Source§impl<'a> Expression<'a>
impl<'a> Expression<'a>
Sourcepub fn function(&self) -> Option<&FunctionRef<'a>>
pub fn function(&self) -> Option<&FunctionRef<'a>>
The function, if the expression has one.
Sourcepub fn attributes(&self) -> &Attributes<'a>
pub fn attributes(&self) -> &Attributes<'a>
The expression’s attributes.
Sourcepub fn into_owned(self) -> Expression<'static>
pub fn into_owned(self) -> Expression<'static>
The same expression with every string owned.
Trait Implementations§
Source§impl<'a> Clone for Expression<'a>
impl<'a> Clone for Expression<'a>
Source§impl<'a> Debug for Expression<'a>
impl<'a> Debug for Expression<'a>
Source§impl<'de: 'a, 'a> Deserialize<'de> for Expression<'a>
Available on crate feature serde only.
impl<'de: 'a, 'a> Deserialize<'de> for Expression<'a>
Available on crate feature
serde only.Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl<'a> Eq for Expression<'a>
Source§impl<'a> Hash for Expression<'a>
impl<'a> Hash for Expression<'a>
Source§impl<'a> PartialEq for Expression<'a>
impl<'a> PartialEq for Expression<'a>
Source§impl Serialize for Expression<'_>
Available on crate feature serde only.
impl Serialize for Expression<'_>
Available on crate feature
serde only.impl<'a> StructuralPartialEq for Expression<'a>
Auto Trait Implementations§
impl<'a> Freeze for Expression<'a>
impl<'a> RefUnwindSafe for Expression<'a>
impl<'a> Send for Expression<'a>
impl<'a> Sync for Expression<'a>
impl<'a> Unpin for Expression<'a>
impl<'a> UnsafeUnpin for Expression<'a>
impl<'a> UnwindSafe for Expression<'a>
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