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§
sourcefn i8_suffixed(n: i8) -> Self
fn i8_suffixed(n: i8) -> Self
Suffixed integer literal.
sourcefn i16_suffixed(n: i16) -> Self
fn i16_suffixed(n: i16) -> Self
Suffixed integer literal.
sourcefn i32_suffixed(n: i32) -> Self
fn i32_suffixed(n: i32) -> Self
Suffixed integer literal.
sourcefn i64_suffixed(n: i64) -> Self
fn i64_suffixed(n: i64) -> Self
Suffixed integer literal.
sourcefn i128_suffixed(n: i128) -> Self
fn i128_suffixed(n: i128) -> Self
Suffixed integer literal.
sourcefn isize_suffixed(n: isize) -> Self
fn isize_suffixed(n: isize) -> Self
Suffixed integer literal.
sourcefn u8_suffixed(n: u8) -> Self
fn u8_suffixed(n: u8) -> Self
Suffixed integer literal.
sourcefn u16_suffixed(n: u16) -> Self
fn u16_suffixed(n: u16) -> Self
Suffixed integer literal.
sourcefn u32_suffixed(n: u32) -> Self
fn u32_suffixed(n: u32) -> Self
Suffixed integer literal.
sourcefn u64_suffixed(n: u64) -> Self
fn u64_suffixed(n: u64) -> Self
Suffixed integer literal.
sourcefn u128_suffixed(n: u128) -> Self
fn u128_suffixed(n: u128) -> Self
Suffixed integer literal.
sourcefn usize_suffixed(n: usize) -> Self
fn usize_suffixed(n: usize) -> Self
Suffixed integer literal.
sourcefn i8_unsuffixed(n: i8) -> Self
fn i8_unsuffixed(n: i8) -> Self
Unsuffixed integer literal.
sourcefn i16_unsuffixed(n: i16) -> Self
fn i16_unsuffixed(n: i16) -> Self
Unsuffixed integer literal.
sourcefn i32_unsuffixed(n: i32) -> Self
fn i32_unsuffixed(n: i32) -> Self
Unsuffixed integer literal.
sourcefn i64_unsuffixed(n: i64) -> Self
fn i64_unsuffixed(n: i64) -> Self
Unsuffixed integer literal.
sourcefn i128_unsuffixed(n: i128) -> Self
fn i128_unsuffixed(n: i128) -> Self
Unsuffixed integer literal.
sourcefn isize_unsuffixed(n: isize) -> Self
fn isize_unsuffixed(n: isize) -> Self
Unsuffixed integer literal.
sourcefn u8_unsuffixed(n: u8) -> Self
fn u8_unsuffixed(n: u8) -> Self
Unsuffixed integer literal.
sourcefn u16_unsuffixed(n: u16) -> Self
fn u16_unsuffixed(n: u16) -> Self
Unsuffixed integer literal.
sourcefn u32_unsuffixed(n: u32) -> Self
fn u32_unsuffixed(n: u32) -> Self
Unsuffixed integer literal.
sourcefn u64_unsuffixed(n: u64) -> Self
fn u64_unsuffixed(n: u64) -> Self
Unsuffixed integer literal.
sourcefn u128_unsuffixed(n: u128) -> Self
fn u128_unsuffixed(n: u128) -> Self
Unsuffixed integer literal.
sourcefn usize_unsuffixed(n: usize) -> Self
fn usize_unsuffixed(n: usize) -> Self
Unsuffixed integer literal.
sourcefn f32_suffixed(n: f32) -> Self
fn f32_suffixed(n: f32) -> Self
Suffixed floating-point literal.
sourcefn f64_suffixed(n: f64) -> Self
fn f64_suffixed(n: f64) -> Self
Suffixed floating-point literal.
sourcefn f32_unsuffixed(n: f32) -> Self
fn f32_unsuffixed(n: f32) -> Self
Unsuffixed floating-point literal.
sourcefn f64_unsuffixed(n: f64) -> Self
fn f64_unsuffixed(n: f64) -> Self
Unsuffixed floating-point literal.
sourcefn byte_character(b: u8) -> Self
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.
sourcefn byte_string(bytes: &[u8]) -> Self
fn byte_string(bytes: &[u8]) -> Self
Byte string literal.
Object Safety§
Implementations on Foreign Types§
source§impl Literal for Literal
Available on crate feature proc-macro
only.
impl Literal for Literal
proc-macro
only.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_unsuffixed(n: f32) -> Self
fn f32_suffixed(n: f32) -> Self
fn f64_unsuffixed(n: f64) -> Self
fn f64_suffixed(n: f64) -> Self
fn string(str: &str) -> Self
fn character(c: char) -> Self
fn byte_string(bytes: &[u8]) -> Self
fn byte_character(b: u8) -> Self
fn c_string(str: &CStr) -> Self
fn span(&self) -> Self::Span
fn set_span(&mut self, span: Self::Span)
source§impl Literal for Literal
Available on crate feature proc-macro2
only.
impl Literal for Literal
proc-macro2
only.