Trait proclet::Literal

source ·
pub trait Literal: ProcMacro<Literal = Self> + Display + FromStr {
Show 35 methods // Required methods fn i8_suffixed(n: i8) -> Self; fn i16_suffixed(n: i16) -> Self; fn i32_suffixed(n: i32) -> Self; fn i64_suffixed(n: i64) -> Self; fn i128_suffixed(n: i128) -> Self; fn isize_suffixed(n: isize) -> Self; fn u8_suffixed(n: u8) -> Self; fn u16_suffixed(n: u16) -> Self; fn u32_suffixed(n: u32) -> Self; fn u64_suffixed(n: u64) -> Self; fn u128_suffixed(n: u128) -> Self; fn usize_suffixed(n: usize) -> Self; fn i8_unsuffixed(n: i8) -> Self; fn i16_unsuffixed(n: i16) -> Self; fn i32_unsuffixed(n: i32) -> Self; fn i64_unsuffixed(n: i64) -> Self; fn i128_unsuffixed(n: i128) -> Self; fn isize_unsuffixed(n: isize) -> Self; fn u8_unsuffixed(n: u8) -> Self; fn u16_unsuffixed(n: u16) -> Self; fn u32_unsuffixed(n: u32) -> Self; fn u64_unsuffixed(n: u64) -> Self; fn u128_unsuffixed(n: u128) -> Self; fn usize_unsuffixed(n: usize) -> Self; fn f32_suffixed(n: f32) -> Self; fn f64_suffixed(n: f64) -> Self; fn f32_unsuffixed(n: f32) -> Self; fn f64_unsuffixed(n: f64) -> Self; fn string(str: &str) -> Self; fn character(c: char) -> Self; fn byte_character(b: u8) -> Self; fn byte_string(bytes: &[u8]) -> Self; fn c_string(str: &CStr) -> Self; fn span(&self) -> Self::Span; fn set_span(&mut self, span: Self::Span);
}
Expand description

Literal API trait. See proc_macro::Literal.

This trait is implemented for Literal in proc_macro and proc_macro2 if the corresponding feature is enabled.

See also LiteralExt.

Required Methods§

source

fn i8_suffixed(n: i8) -> Self

Suffixed integer literal.

source

fn i16_suffixed(n: i16) -> Self

Suffixed integer literal.

source

fn i32_suffixed(n: i32) -> Self

Suffixed integer literal.

source

fn i64_suffixed(n: i64) -> Self

Suffixed integer literal.

source

fn i128_suffixed(n: i128) -> Self

Suffixed integer literal.

source

fn isize_suffixed(n: isize) -> Self

Suffixed integer literal.

source

fn u8_suffixed(n: u8) -> Self

Suffixed integer literal.

source

fn u16_suffixed(n: u16) -> Self

Suffixed integer literal.

source

fn u32_suffixed(n: u32) -> Self

Suffixed integer literal.

source

fn u64_suffixed(n: u64) -> Self

Suffixed integer literal.

source

fn u128_suffixed(n: u128) -> Self

Suffixed integer literal.

source

fn usize_suffixed(n: usize) -> Self

Suffixed integer literal.

source

fn i8_unsuffixed(n: i8) -> Self

Unsuffixed integer literal.

source

fn i16_unsuffixed(n: i16) -> Self

Unsuffixed integer literal.

source

fn i32_unsuffixed(n: i32) -> Self

Unsuffixed integer literal.

source

fn i64_unsuffixed(n: i64) -> Self

Unsuffixed integer literal.

source

fn i128_unsuffixed(n: i128) -> Self

Unsuffixed integer literal.

source

fn isize_unsuffixed(n: isize) -> Self

Unsuffixed integer literal.

source

fn u8_unsuffixed(n: u8) -> Self

Unsuffixed integer literal.

source

fn u16_unsuffixed(n: u16) -> Self

Unsuffixed integer literal.

source

fn u32_unsuffixed(n: u32) -> Self

Unsuffixed integer literal.

source

fn u64_unsuffixed(n: u64) -> Self

Unsuffixed integer literal.

source

fn u128_unsuffixed(n: u128) -> Self

Unsuffixed integer literal.

source

fn usize_unsuffixed(n: usize) -> Self

Unsuffixed integer literal.

source

fn f32_suffixed(n: f32) -> Self

Suffixed floating-point literal.

source

fn f64_suffixed(n: f64) -> Self

Suffixed floating-point literal.

source

fn f32_unsuffixed(n: f32) -> Self

Unsuffixed floating-point literal.

source

fn f64_unsuffixed(n: f64) -> Self

Unsuffixed floating-point literal.

source

fn string(str: &str) -> Self

String literal.

source

fn character(c: char) -> Self

Character literal.

source

fn byte_character(b: u8) -> Self

Byte character literal.

This method is currently unstable in proc-macro and is missing from proc-macro2, but this crate implements it in a way that works with both on stable.

source

fn byte_string(bytes: &[u8]) -> Self

Byte string literal.

source

fn c_string(str: &CStr) -> Self

C string literal.

This method is currently unstable in proc-macro and is missing from proc-macro2, but this crate implements it in a way that works with both on stable.

source

fn span(&self) -> Self::Span

The span of this literal.

source

fn set_span(&mut self, span: Self::Span)

Set the span of this literal.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Literal for Literal

Available on crate feature proc-macro only.
source§

fn i8_suffixed(n: i8) -> Self

source§

fn i16_suffixed(n: i16) -> Self

source§

fn i32_suffixed(n: i32) -> Self

source§

fn i64_suffixed(n: i64) -> Self

source§

fn i128_suffixed(n: i128) -> Self

source§

fn isize_suffixed(n: isize) -> Self

source§

fn u8_suffixed(n: u8) -> Self

source§

fn u16_suffixed(n: u16) -> Self

source§

fn u32_suffixed(n: u32) -> Self

source§

fn u64_suffixed(n: u64) -> Self

source§

fn u128_suffixed(n: u128) -> Self

source§

fn usize_suffixed(n: usize) -> Self

source§

fn i8_unsuffixed(n: i8) -> Self

source§

fn i16_unsuffixed(n: i16) -> Self

source§

fn i32_unsuffixed(n: i32) -> Self

source§

fn i64_unsuffixed(n: i64) -> Self

source§

fn i128_unsuffixed(n: i128) -> Self

source§

fn isize_unsuffixed(n: isize) -> Self

source§

fn u8_unsuffixed(n: u8) -> Self

source§

fn u16_unsuffixed(n: u16) -> Self

source§

fn u32_unsuffixed(n: u32) -> Self

source§

fn u64_unsuffixed(n: u64) -> Self

source§

fn u128_unsuffixed(n: u128) -> Self

source§

fn usize_unsuffixed(n: usize) -> Self

source§

fn f32_unsuffixed(n: f32) -> Self

source§

fn f32_suffixed(n: f32) -> Self

source§

fn f64_unsuffixed(n: f64) -> Self

source§

fn f64_suffixed(n: f64) -> Self

source§

fn string(str: &str) -> Self

source§

fn character(c: char) -> Self

source§

fn byte_string(bytes: &[u8]) -> Self

source§

fn byte_character(b: u8) -> Self

source§

fn c_string(str: &CStr) -> Self

source§

fn span(&self) -> Self::Span

source§

fn set_span(&mut self, span: Self::Span)

source§

impl Literal for Literal

Available on crate feature proc-macro2 only.
source§

fn i8_suffixed(n: i8) -> Self

source§

fn i16_suffixed(n: i16) -> Self

source§

fn i32_suffixed(n: i32) -> Self

source§

fn i64_suffixed(n: i64) -> Self

source§

fn i128_suffixed(n: i128) -> Self

source§

fn isize_suffixed(n: isize) -> Self

source§

fn u8_suffixed(n: u8) -> Self

source§

fn u16_suffixed(n: u16) -> Self

source§

fn u32_suffixed(n: u32) -> Self

source§

fn u64_suffixed(n: u64) -> Self

source§

fn u128_suffixed(n: u128) -> Self

source§

fn usize_suffixed(n: usize) -> Self

source§

fn i8_unsuffixed(n: i8) -> Self

source§

fn i16_unsuffixed(n: i16) -> Self

source§

fn i32_unsuffixed(n: i32) -> Self

source§

fn i64_unsuffixed(n: i64) -> Self

source§

fn i128_unsuffixed(n: i128) -> Self

source§

fn isize_unsuffixed(n: isize) -> Self

source§

fn u8_unsuffixed(n: u8) -> Self

source§

fn u16_unsuffixed(n: u16) -> Self

source§

fn u32_unsuffixed(n: u32) -> Self

source§

fn u64_unsuffixed(n: u64) -> Self

source§

fn u128_unsuffixed(n: u128) -> Self

source§

fn usize_unsuffixed(n: usize) -> Self

source§

fn f32_unsuffixed(n: f32) -> Self

source§

fn f32_suffixed(n: f32) -> Self

source§

fn f64_unsuffixed(n: f64) -> Self

source§

fn f64_suffixed(n: f64) -> Self

source§

fn string(str: &str) -> Self

source§

fn character(c: char) -> Self

source§

fn byte_string(bytes: &[u8]) -> Self

source§

fn byte_character(b: u8) -> Self

source§

fn c_string(str: &CStr) -> Self

source§

fn span(&self) -> Self::Span

source§

fn set_span(&mut self, span: Self::Span)

Implementors§