Enum syn::Lit [−][src]
pub enum Lit {
Str(String, StrStyle),
ByteStr(Vec<u8>, StrStyle),
Byte(u8),
Char(char),
Int(u64, IntTy),
Float(String, FloatTy),
Bool(bool),
}Literal kind.
E.g. "foo", 42, 12.34 or bool
Variants
Str(String, StrStyle)A string literal ("foo")
ByteStr(Vec<u8>, StrStyle)A byte string (b"foo")
Byte(u8)A byte char (b'f')
Char(char)A character literal ('a')
Int(u64, IntTy)An integer literal (1)
Float(String, FloatTy)A float literal (1f64 or 1E10f64 or 1.0E10)
Bool(bool)A boolean literal
Trait Implementations
impl ToTokens for Lit[src]
impl ToTokens for Litimpl Debug for Lit[src]
impl Debug for Litfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Clone for Lit[src]
impl Clone for Litfn clone(&self) -> Lit[src]
fn clone(&self) -> LitReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0
[src]Performs copy-assignment from source. Read more
impl Eq for Lit[src]
impl Eq for Litimpl PartialEq for Lit[src]
impl PartialEq for Litfn eq(&self, other: &Lit) -> bool[src]
fn eq(&self, other: &Lit) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Lit) -> bool[src]
fn ne(&self, other: &Lit) -> boolThis method tests for !=.
impl Hash for Lit[src]
impl Hash for Litfn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash<__H: Hasher>(&self, state: &mut __H)Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0
[src]Feeds a slice of this type into the given [Hasher]. Read more
impl From<String> for Lit[src]
impl From<String> for Litimpl<'a> From<&'a str> for Lit[src]
impl<'a> From<&'a str> for Litimpl From<Vec<u8>> for Lit[src]
impl From<Vec<u8>> for Litimpl<'a> From<&'a [u8]> for Lit[src]
impl<'a> From<&'a [u8]> for Litimpl From<char> for Lit[src]
impl From<char> for Litimpl From<bool> for Lit[src]
impl From<bool> for Litimpl From<isize> for Lit[src]
impl From<isize> for Litimpl From<i8> for Lit[src]
impl From<i8> for Litimpl From<i16> for Lit[src]
impl From<i16> for Litimpl From<i32> for Lit[src]
impl From<i32> for Litimpl From<i64> for Lit[src]
impl From<i64> for Litimpl From<usize> for Lit[src]
impl From<usize> for Litimpl From<u8> for Lit[src]
impl From<u8> for Litimpl From<u16> for Lit[src]
impl From<u16> for Litimpl From<u32> for Lit[src]
impl From<u32> for Litimpl From<u64> for Lit[src]
impl From<u64> for Litimpl From<f32> for Lit[src]
impl From<f32> for Litimpl From<f64> for Lit[src]
impl From<f64> for Lit