pub enum Expression {
Literal(LiteralExpression),
Parenthesized(ParenthesizedExpression),
NamedComponent(NamedComponentExpression),
Indexing(IndexingExpression),
Unary(UnaryExpression),
Binary(BinaryExpression),
FunctionCall(FunctionCallExpression),
TypeOrIdentifier(TypeExpression),
}Variants§
Literal(LiteralExpression)
Parenthesized(ParenthesizedExpression)
NamedComponent(NamedComponentExpression)
Indexing(IndexingExpression)
Unary(UnaryExpression)
Binary(BinaryExpression)
FunctionCall(FunctionCallExpression)
TypeOrIdentifier(TypeExpression)
Implementations§
Source§impl Expression
impl Expression
Sourcepub const fn is_literal(&self) -> bool
pub const fn is_literal(&self) -> bool
Returns true if this value is of type Literal. Returns false otherwise
Sourcepub const fn is_parenthesized(&self) -> bool
pub const fn is_parenthesized(&self) -> bool
Returns true if this value is of type Parenthesized. Returns false otherwise
Sourcepub const fn is_named_component(&self) -> bool
pub const fn is_named_component(&self) -> bool
Returns true if this value is of type NamedComponent. Returns false otherwise
Sourcepub const fn is_indexing(&self) -> bool
pub const fn is_indexing(&self) -> bool
Returns true if this value is of type Indexing. Returns false otherwise
Sourcepub const fn is_unary(&self) -> bool
pub const fn is_unary(&self) -> bool
Returns true if this value is of type Unary. Returns false otherwise
Sourcepub const fn is_binary(&self) -> bool
pub const fn is_binary(&self) -> bool
Returns true if this value is of type Binary. Returns false otherwise
Sourcepub const fn is_function_call(&self) -> bool
pub const fn is_function_call(&self) -> bool
Returns true if this value is of type FunctionCall. Returns false otherwise
Sourcepub const fn is_type_or_identifier(&self) -> bool
pub const fn is_type_or_identifier(&self) -> bool
Returns true if this value is of type TypeOrIdentifier. Returns false otherwise
Source§impl Expression
impl Expression
Sourcepub fn unwrap_literal(self) -> LiteralExpression
pub fn unwrap_literal(self) -> LiteralExpression
Unwraps this value to the Expression::Literal variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_parenthesized(self) -> ParenthesizedExpression
pub fn unwrap_parenthesized(self) -> ParenthesizedExpression
Unwraps this value to the Expression::Parenthesized variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_named_component(self) -> NamedComponentExpression
pub fn unwrap_named_component(self) -> NamedComponentExpression
Unwraps this value to the Expression::NamedComponent variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_indexing(self) -> IndexingExpression
pub fn unwrap_indexing(self) -> IndexingExpression
Unwraps this value to the Expression::Indexing variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_unary(self) -> UnaryExpression
pub fn unwrap_unary(self) -> UnaryExpression
Unwraps this value to the Expression::Unary variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_binary(self) -> BinaryExpression
pub fn unwrap_binary(self) -> BinaryExpression
Unwraps this value to the Expression::Binary variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_function_call(self) -> FunctionCallExpression
pub fn unwrap_function_call(self) -> FunctionCallExpression
Unwraps this value to the Expression::FunctionCall variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_type_or_identifier(self) -> TypeExpression
pub fn unwrap_type_or_identifier(self) -> TypeExpression
Unwraps this value to the Expression::TypeOrIdentifier variant.
Panics if this value is of any other type.
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Expression
impl Debug for Expression
Source§impl Display for Expression
impl Display for Expression
Source§impl From<BinaryExpression> for Expression
impl From<BinaryExpression> for Expression
Source§fn from(value: BinaryExpression) -> Self
fn from(value: BinaryExpression) -> Self
Source§impl From<Expression> for ReturnStatement
impl From<Expression> for ReturnStatement
Source§fn from(expression: Expression) -> Self
fn from(expression: Expression) -> Self
Source§impl From<FunctionCall> for Expression
impl From<FunctionCall> for Expression
Source§fn from(value: FunctionCallExpression) -> Self
fn from(value: FunctionCallExpression) -> Self
Source§impl From<Ident> for Expression
impl From<Ident> for Expression
Source§impl From<IndexingExpression> for Expression
impl From<IndexingExpression> for Expression
Source§fn from(value: IndexingExpression) -> Self
fn from(value: IndexingExpression) -> Self
Source§impl From<LiteralExpression> for Expression
impl From<LiteralExpression> for Expression
Source§fn from(value: LiteralExpression) -> Self
fn from(value: LiteralExpression) -> Self
Source§impl From<NamedComponentExpression> for Expression
impl From<NamedComponentExpression> for Expression
Source§fn from(value: NamedComponentExpression) -> Self
fn from(value: NamedComponentExpression) -> Self
Source§impl From<ParenthesizedExpression> for Expression
impl From<ParenthesizedExpression> for Expression
Source§fn from(value: ParenthesizedExpression) -> Self
fn from(value: ParenthesizedExpression) -> Self
Source§impl From<TypeExpression> for Expression
impl From<TypeExpression> for Expression
Source§fn from(value: TypeExpression) -> Self
fn from(value: TypeExpression) -> Self
Source§impl From<UnaryExpression> for Expression
impl From<UnaryExpression> for Expression
Source§fn from(value: UnaryExpression) -> Self
fn from(value: UnaryExpression) -> Self
Source§impl From<bool> for Expression
impl From<bool> for Expression
Source§impl From<f32> for Expression
impl From<f32> for Expression
Source§impl From<f64> for Expression
impl From<f64> for Expression
Source§impl From<i32> for Expression
impl From<i32> for Expression
Source§impl From<i64> for Expression
impl From<i64> for Expression
Source§impl From<u32> for Expression
impl From<u32> for Expression
Source§impl FromStr for Expression
impl FromStr for Expression
Source§impl PartialEq for Expression
impl PartialEq for Expression
impl StructuralPartialEq for Expression
Auto Trait Implementations§
impl Freeze for Expression
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnwindSafe for Expression
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more