pub enum Literal {
Boolean(bool),
Integer(i128),
Float {
mantissa: String,
exponent: Option<String>,
},
Fixed {
digits: String,
scale: u8,
},
Char(char),
WChar(u32),
String(String),
WString(Vec<u32>),
Enumerator(Ref<EnumeratorNode>),
}Expand description
A literal value.
Floating-point and fixed-point literals retain their written form:
1. and 1.0 are the same number but not the same source text, and
the formatter has to render back what was written. Spec §3.5.
Variants§
Boolean(bool)
TRUE / FALSE.
Integer(i128)
Integer literal, in its evaluated form; the written radix lives in the source facet.
Float
Floating-point literal, as written.
Fields
Fixed
Fixed-point literal, as written.
Char(char)
Narrow character literal.
WChar(u32)
Wide character literal, as a code point.
String(String)
Narrow string literal, with escapes resolved.
WString(Vec<u32>)
Wide string literal, as code points.
Enumerator(Ref<EnumeratorNode>)
An enumerator used as a value.
Trait Implementations§
impl Eq for Literal
impl StructuralPartialEq for Literal
Auto Trait Implementations§
impl Freeze for Literal
impl RefUnwindSafe for Literal
impl Send for Literal
impl Sync for Literal
impl Unpin for Literal
impl UnsafeUnpin for Literal
impl UnwindSafe for Literal
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