pub enum Lit<'a> {
Null,
String(StringLit<'a>),
Number(Cow<'a, str>),
Boolean(bool),
RegEx(RegEx<'a>),
Template(TemplateLit<'a>),
}
Expand description
A literal value
Variants
Null
null
String(StringLit<'a>)
"string"
'string'
Number(Cow<'a, str>)
0
0.0
.0
0.0e1
.0E1
0xf
0o7
0b1
Boolean(bool)
true
false
RegEx(RegEx<'a>)
/.+/g
Template(TemplateLit<'a>)
`I have ${0} apples`
Implementations
sourceimpl<'a> Lit<'a>
impl<'a> Lit<'a>
pub fn number_from(s: &'a str) -> Self
pub fn single_string_from(s: &'a str) -> Self
pub fn double_string_from(s: &'a str) -> Self
Trait Implementations
sourceimpl<'a> PartialEq<Lit<'a>> for Lit<'a>
impl<'a> PartialEq<Lit<'a>> for Lit<'a>
impl<'a> StructuralPartialEq for Lit<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for Lit<'a>
impl<'a> Send for Lit<'a>
impl<'a> Sync for Lit<'a>
impl<'a> Unpin for Lit<'a>
impl<'a> UnwindSafe for Lit<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more