# Struct proc_macro::Literal [−] [src]

    pub struct Literal(_);

🔬 This is a nightly-only experimental API. (`proc_macro` #38356)

A literal character (`'a'`), string (`"hello"`), or number (`2.3`).

## Methods

### `impl Literal`
[src]

#### `pub fn integer(n: i128) -> Literal`
[src]

🔬 This is a nightly-only experimental API. (`proc_macro` #38356)

Integer literal

#### `pub fn u8(n: u8) -> Literal`
[src]

🔬 This is a nightly-only experimental API. (`proc_macro` #38356)

Integer literal.

#### `pub fn i8(n: i8) -> Literal`
[src]

🔬 This is a nightly-only experimental API. (`proc_macro` #38356)

Integer literal.

#### `pub fn u16(n: u16) -> Literal`
[src]

🔬 This is a nightly-only experimental API. (`proc_macro` #38356)

Integer literal.

#### `pub fn i16(n: i16) -> Literal`
[src]

🔬 This is a nightly-only experimental API. (`proc_macro` #38356)

Integer literal.

#### `pub fn u32(n: u32) -> Literal`
[src]

🔬 This is a nightly-only experimental API. (`proc_macro` #38356)

Integer literal.

#### `pub fn i32(n: i32) -> Literal`
[src]

🔬 This is a nightly-only experimental API. (`proc_macro` #38356)

Integer literal.

#### `pub fn u64(n: u64) -> Literal`
[src]

🔬 This is a nightly-only experimental API. (`proc_macro` #38356)

Integer literal.

#### `pub fn i64(n: i64) -> Literal`
[src]

🔬 This is a nightly-only experimental API. (`proc_macro` #38356)

Integer literal.

#### `pub fn usize(n: usize) -> Literal`
[src]

🔬 This is a nightly-only experimental API. (`proc_macro` #38356)

Integer literal.

#### `pub fn isize(n: isize) -> Literal`
[src]

🔬 This is a nightly-only experimental API. (`proc_macro` #38356)

Integer literal.

#### `pub fn float(n: f64) -> Literal`
[src]

🔬 This is a nightly-only experimental API. (`proc_macro` #38356)

Floating point literal.

#### `pub fn f32(n: f32) -> Literal`
[src]

🔬 This is a nightly-only experimental API. (`proc_macro` #38356)

Floating point literal.

#### `pub fn f64(n: f64) -> Literal`
[src]

🔬 This is a nightly-only experimental API. (`proc_macro` #38356)

Floating point literal.

#### `pub fn string(string: &str) -> Literal`
[src]

🔬 This is a nightly-only experimental API. (`proc_macro` #38356)

String literal.

#### `pub fn character(ch: char) -> Literal`
[src]

🔬 This is a nightly-only experimental API. (`proc_macro` #38356)

Character literal.

#### `pub fn byte_string(bytes: &[u8]) -> Literal`
[src]

🔬 This is a nightly-only experimental API. (`proc_macro` #38356)

Byte string literal.

## Trait Implementations

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

#### `fn clone(&self) -> Literal`
[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 Debug for Literal`
[src]

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

Formats the value using the given formatter. Read more

### `impl Display for Literal`
[src]

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

Formats the value using the given formatter. Read more

# 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
+ / -
  Collapse/expand 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`)