pub enum LiteralExpression {
True(Option<Token>),
False(Option<Token>),
Nil(Option<Token>),
Number(NumberExpression),
String(StringExpression),
Table(Box<LiteralTable>),
}Expand description
A literal expression in Luau.
Literal expressions are used in function attribute arguments
(e.g., @[attr(true, 42, "text")]).
Variants§
True(Option<Token>)
The boolean literal true
False(Option<Token>)
The boolean literal false
Nil(Option<Token>)
The nil literal
Number(NumberExpression)
A numeric literal (e.g., 42, 3.14)
String(StringExpression)
A string literal (e.g., "hello", [[text]])
Table(Box<LiteralTable>)
A table literal (e.g., { key = value })
Implementations§
Trait Implementations§
Source§impl Clone for LiteralExpression
impl Clone for LiteralExpression
Source§fn clone(&self) -> LiteralExpression
fn clone(&self) -> LiteralExpression
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 LiteralExpression
impl Debug for LiteralExpression
Source§impl From<BinaryNumber> for LiteralExpression
impl From<BinaryNumber> for LiteralExpression
Source§fn from(number: BinaryNumber) -> Self
fn from(number: BinaryNumber) -> Self
Converts to this type from the input type.
Source§impl From<DecimalNumber> for LiteralExpression
impl From<DecimalNumber> for LiteralExpression
Source§fn from(number: DecimalNumber) -> Self
fn from(number: DecimalNumber) -> Self
Converts to this type from the input type.
Source§impl From<HexNumber> for LiteralExpression
impl From<HexNumber> for LiteralExpression
Source§impl From<LiteralExpression> for Expression
impl From<LiteralExpression> for Expression
Source§fn from(literal: LiteralExpression) -> Self
fn from(literal: LiteralExpression) -> Self
Converts to this type from the input type.
Source§impl From<LiteralExpression> for LiteralTableEntry
impl From<LiteralExpression> for LiteralTableEntry
Source§fn from(v: LiteralExpression) -> Self
fn from(v: LiteralExpression) -> Self
Converts to this type from the input type.
Source§impl From<LiteralTable> for LiteralExpression
impl From<LiteralTable> for LiteralExpression
Source§fn from(v: LiteralTable) -> Self
fn from(v: LiteralTable) -> Self
Converts to this type from the input type.
Source§impl From<NumberExpression> for LiteralExpression
impl From<NumberExpression> for LiteralExpression
Source§fn from(v: NumberExpression) -> Self
fn from(v: NumberExpression) -> Self
Converts to this type from the input type.
Source§impl<T: Into<LiteralExpression>> From<Option<T>> for LiteralExpression
impl<T: Into<LiteralExpression>> From<Option<T>> for LiteralExpression
Source§impl From<StringExpression> for LiteralExpression
impl From<StringExpression> for LiteralExpression
Source§fn from(v: StringExpression) -> Self
fn from(v: StringExpression) -> Self
Converts to this type from the input type.
Source§impl From<bool> for LiteralExpression
impl From<bool> for LiteralExpression
Source§impl From<u16> for LiteralExpression
impl From<u16> for LiteralExpression
Source§impl From<u32> for LiteralExpression
impl From<u32> for LiteralExpression
Source§impl From<u8> for LiteralExpression
impl From<u8> for LiteralExpression
Source§impl PartialEq for LiteralExpression
impl PartialEq for LiteralExpression
Source§impl TryFrom<f32> for LiteralExpression
impl TryFrom<f32> for LiteralExpression
Source§impl TryFrom<f64> for LiteralExpression
impl TryFrom<f64> for LiteralExpression
Source§impl TryFrom<i16> for LiteralExpression
impl TryFrom<i16> for LiteralExpression
Source§impl TryFrom<i32> for LiteralExpression
impl TryFrom<i32> for LiteralExpression
Source§impl TryFrom<i64> for LiteralExpression
impl TryFrom<i64> for LiteralExpression
Source§impl TryFrom<i8> for LiteralExpression
impl TryFrom<i8> for LiteralExpression
Source§impl TryFrom<u64> for LiteralExpression
impl TryFrom<u64> for LiteralExpression
impl Eq for LiteralExpression
impl StructuralPartialEq for LiteralExpression
Auto Trait Implementations§
impl Freeze for LiteralExpression
impl RefUnwindSafe for LiteralExpression
impl Send for LiteralExpression
impl Sync for LiteralExpression
impl Unpin for LiteralExpression
impl UnsafeUnpin for LiteralExpression
impl UnwindSafe for LiteralExpression
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
Converts
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>
Converts
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