proc_macro::Literal - Rust
Description: API documentation for the Rust `Literal` struct in crate `proc_macro`.
Keywords: rust, rustlang, rust-lang, Literal

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

#### `fn integer(n: i128) -> Literal`

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

Integer literal

#### `fn u8(n: u8) -> Literal`

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

Integer literal.

#### `fn i8(n: i8) -> Literal`

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

Integer literal.

#### `fn u16(n: u16) -> Literal`

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

Integer literal.

#### `fn i16(n: i16) -> Literal`

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

Integer literal.

#### `fn u32(n: u32) -> Literal`

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

Integer literal.

#### `fn i32(n: i32) -> Literal`

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

Integer literal.

#### `fn u64(n: u64) -> Literal`

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

Integer literal.

#### `fn i64(n: i64) -> Literal`

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

Integer literal.

#### `fn usize(n: usize) -> Literal`

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

Integer literal.

#### `fn isize(n: isize) -> Literal`

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

Integer literal.

#### `fn float(n: f64) -> Literal`

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

Floating point literal.

#### `fn f32(n: f32) -> Literal`

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

Floating point literal.

#### `fn f64(n: f64) -> Literal`

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

Floating point literal.

#### `fn string(string: &str) -> Literal`

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

String literal.

#### `fn character(ch: char) -> Literal`

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

Character literal.

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

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

Byte string literal.

## Trait Implementations

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

#### `fn clone(&self) -> Literal`

Returns a copy of the value. Read more

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

Performs copy-assignment from `source`. Read more

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

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

Formats the value using the given formatter.

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

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

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
⏎
  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`)