# 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]

#### `fn to_tokens(&self, tokens: &mut Tokens)`
[src]

Write `self` to the given `Tokens`. Read more

### `impl Debug for Lit`
[src]

#### `fn fmt(&self, __arg_0: &mut Formatter) -> Result`
[src]

Formats the value using the given formatter. Read more

### `impl Clone for Lit`
[src]

#### `fn clone(&self) -> Lit`
[src]

Returns a copy of the value. Read more

#### `fn clone_from(&mut self, source: &Self)`
1.0.0
[src]

Performs copy-assignment from `source`. Read more

### `impl Eq for Lit`
[src]

### `impl PartialEq for Lit`
[src]

#### `fn eq(&self, __arg_0: &Lit) -> bool`
[src]

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, __arg_0: &Lit) -> bool`
[src]

This method tests for `!=`.

### `impl Hash for Lit`
[src]

#### `fn hash<__H: Hasher>(&self, __arg_0: &mut __H)`
[src]

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]

Feeds a slice of this type into the given [`Hasher`]. Read more

### `impl From<String> for Lit`
[src]

#### `fn from(input: String) -> Lit`
[src]

Performs the conversion.

### `impl<'a> From<&'a str> for Lit`
[src]

#### `fn from(input: &str) -> Lit`
[src]

Performs the conversion.

### `impl From<Vec<u8>> for Lit`
[src]

#### `fn from(input: Vec<u8>) -> Lit`
[src]

Performs the conversion.

### `impl<'a> From<&'a [u8]> for Lit`
[src]

#### `fn from(input: &[u8]) -> Lit`
[src]

Performs the conversion.

### `impl From<char> for Lit`
[src]

#### `fn from(input: char) -> Lit`
[src]

Performs the conversion.

### `impl From<bool> for Lit`
[src]

#### `fn from(input: bool) -> Lit`
[src]

Performs the conversion.

### `impl From<isize> for Lit`
[src]

#### `fn from(input: isize) -> Lit`
[src]

Performs the conversion.

### `impl From<i8> for Lit`
[src]

#### `fn from(input: i8) -> Lit`
[src]

Performs the conversion.

### `impl From<i16> for Lit`
[src]

#### `fn from(input: i16) -> Lit`
[src]

Performs the conversion.

### `impl From<i32> for Lit`
[src]

#### `fn from(input: i32) -> Lit`
[src]

Performs the conversion.

### `impl From<i64> for Lit`
[src]

#### `fn from(input: i64) -> Lit`
[src]

Performs the conversion.

### `impl From<usize> for Lit`
[src]

#### `fn from(input: usize) -> Lit`
[src]

Performs the conversion.

### `impl From<u8> for Lit`
[src]

#### `fn from(input: u8) -> Lit`
[src]

Performs the conversion.

### `impl From<u16> for Lit`
[src]

#### `fn from(input: u16) -> Lit`
[src]

Performs the conversion.

### `impl From<u32> for Lit`
[src]

#### `fn from(input: u32) -> Lit`
[src]

Performs the conversion.

### `impl From<u64> for Lit`
[src]

#### `fn from(input: u64) -> Lit`
[src]

Performs the conversion.

### `impl From<f32> for Lit`
[src]

#### `fn from(input: f32) -> Lit`
[src]

Performs the conversion.

### `impl From<f64> for Lit`
[src]

#### `fn from(input: f64) -> Lit`
[src]

Performs the conversion.

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)