pub trait LiteralExt: Sized + Sealed {
Show 34 methods
// Required methods
fn i8_suffixed_spanned(span: Span, integer: i8) -> Self;
fn i8_unsuffixed_spanned(span: Span, integer: i8) -> Self;
fn i16_suffixed_spanned(span: Span, integer: i16) -> Self;
fn i16_unsuffixed_spanned(span: Span, integer: i16) -> Self;
fn i32_suffixed_spanned(span: Span, integer: i32) -> Self;
fn i32_unsuffixed_spanned(span: Span, integer: i32) -> Self;
fn i64_suffixed_spanned(span: Span, integer: i64) -> Self;
fn i64_unsuffixed_spanned(span: Span, integer: i64) -> Self;
fn i128_suffixed_spanned(span: Span, integer: i128) -> Self;
fn i128_unsuffixed_spanned(span: Span, integer: i128) -> Self;
fn isize_suffixed_spanned(span: Span, integer: isize) -> Self;
fn isize_unsuffixed_spanned(span: Span, integer: isize) -> Self;
fn u8_suffixed_spanned(span: Span, integer: u8) -> Self;
fn u8_unsuffixed_spanned(span: Span, integer: u8) -> Self;
fn u16_suffixed_spanned(span: Span, integer: u16) -> Self;
fn u16_unsuffixed_spanned(span: Span, integer: u16) -> Self;
fn u32_suffixed_spanned(span: Span, integer: u32) -> Self;
fn u32_unsuffixed_spanned(span: Span, integer: u32) -> Self;
fn u64_suffixed_spanned(span: Span, integer: u64) -> Self;
fn u64_unsuffixed_spanned(span: Span, integer: u64) -> Self;
fn u128_suffixed_spanned(span: Span, integer: u128) -> Self;
fn u128_unsuffixed_spanned(span: Span, integer: u128) -> Self;
fn usize_suffixed_spanned(span: Span, integer: usize) -> Self;
fn usize_unsuffixed_spanned(span: Span, integer: usize) -> Self;
fn f32_suffixed_spanned(span: Span, float: f32) -> Self;
fn f32_unsuffixed_spanned(span: Span, float: f32) -> Self;
fn f64_suffixed_spanned(span: Span, float: f64) -> Self;
fn f64_unsuffixed_spanned(span: Span, float: f64) -> Self;
fn string_spanned(span: Span, string: &str) -> Self;
fn byte_string_spanned(span: Span, bytes: &[u8]) -> Self;
fn c_string_spanned(span: Span, string: &CStr) -> Self;
fn character_spanned(span: Span, character: char) -> Self;
fn byte_character_spanned(span: Span, byte: u8) -> Self;
fn equals(&self, other: &Self) -> bool;
}Expand description
Extension trait for Literal.
Required Methods§
Sourcefn i8_suffixed_spanned(span: Span, integer: i8) -> Self
fn i8_suffixed_spanned(span: Span, integer: i8) -> Self
Construct a suffixed i8 literal with the given span and integer.
Sourcefn i8_unsuffixed_spanned(span: Span, integer: i8) -> Self
fn i8_unsuffixed_spanned(span: Span, integer: i8) -> Self
Construct an unsuffixed i8 literal with the given span and integer.
Sourcefn i16_suffixed_spanned(span: Span, integer: i16) -> Self
fn i16_suffixed_spanned(span: Span, integer: i16) -> Self
Construct a suffixed i16 literal with the given span and integer.
Sourcefn i16_unsuffixed_spanned(span: Span, integer: i16) -> Self
fn i16_unsuffixed_spanned(span: Span, integer: i16) -> Self
Construct an unsuffixed i16 literal with the given span and integer.
Sourcefn i32_suffixed_spanned(span: Span, integer: i32) -> Self
fn i32_suffixed_spanned(span: Span, integer: i32) -> Self
Construct a suffixed i32 literal with the given span and integer.
Sourcefn i32_unsuffixed_spanned(span: Span, integer: i32) -> Self
fn i32_unsuffixed_spanned(span: Span, integer: i32) -> Self
Construct an unsuffixed i32 literal with the given span and integer.
Sourcefn i64_suffixed_spanned(span: Span, integer: i64) -> Self
fn i64_suffixed_spanned(span: Span, integer: i64) -> Self
Construct a suffixed i64 literal with the given span and integer.
Sourcefn i64_unsuffixed_spanned(span: Span, integer: i64) -> Self
fn i64_unsuffixed_spanned(span: Span, integer: i64) -> Self
Construct an unsuffixed i64 literal with the given span and integer.
Sourcefn i128_suffixed_spanned(span: Span, integer: i128) -> Self
fn i128_suffixed_spanned(span: Span, integer: i128) -> Self
Construct a suffixed i128 literal with the given span and integer.
Sourcefn i128_unsuffixed_spanned(span: Span, integer: i128) -> Self
fn i128_unsuffixed_spanned(span: Span, integer: i128) -> Self
Construct an unsuffixed i128 literal with the given span and integer.
Sourcefn isize_suffixed_spanned(span: Span, integer: isize) -> Self
fn isize_suffixed_spanned(span: Span, integer: isize) -> Self
Construct a suffixed isize literal with the given span and integer.
Sourcefn isize_unsuffixed_spanned(span: Span, integer: isize) -> Self
fn isize_unsuffixed_spanned(span: Span, integer: isize) -> Self
Construct an unsuffixed isize literal with the given span and integer.
Sourcefn u8_suffixed_spanned(span: Span, integer: u8) -> Self
fn u8_suffixed_spanned(span: Span, integer: u8) -> Self
Construct a suffixed u8 literal with the given span and integer.
Sourcefn u8_unsuffixed_spanned(span: Span, integer: u8) -> Self
fn u8_unsuffixed_spanned(span: Span, integer: u8) -> Self
Construct an unsuffixed u8 literal with the given span and integer.
Sourcefn u16_suffixed_spanned(span: Span, integer: u16) -> Self
fn u16_suffixed_spanned(span: Span, integer: u16) -> Self
Construct a suffixed u16 literal with the given span and integer.
Sourcefn u16_unsuffixed_spanned(span: Span, integer: u16) -> Self
fn u16_unsuffixed_spanned(span: Span, integer: u16) -> Self
Construct an unsuffixed u16 literal with the given span and integer.
Sourcefn u32_suffixed_spanned(span: Span, integer: u32) -> Self
fn u32_suffixed_spanned(span: Span, integer: u32) -> Self
Construct a suffixed u32 literal with the given span and integer.
Sourcefn u32_unsuffixed_spanned(span: Span, integer: u32) -> Self
fn u32_unsuffixed_spanned(span: Span, integer: u32) -> Self
Construct an unsuffixed u32 literal with the given span and integer.
Sourcefn u64_suffixed_spanned(span: Span, integer: u64) -> Self
fn u64_suffixed_spanned(span: Span, integer: u64) -> Self
Construct a suffixed u64 literal with the given span and integer.
Sourcefn u64_unsuffixed_spanned(span: Span, integer: u64) -> Self
fn u64_unsuffixed_spanned(span: Span, integer: u64) -> Self
Construct an unsuffixed u64 literal with the given span and integer.
Sourcefn u128_suffixed_spanned(span: Span, integer: u128) -> Self
fn u128_suffixed_spanned(span: Span, integer: u128) -> Self
Construct a suffixed u128 literal with the given span and integer.
Sourcefn u128_unsuffixed_spanned(span: Span, integer: u128) -> Self
fn u128_unsuffixed_spanned(span: Span, integer: u128) -> Self
Construct an unsuffixed u128 literal with the given span and integer.
Sourcefn usize_suffixed_spanned(span: Span, integer: usize) -> Self
fn usize_suffixed_spanned(span: Span, integer: usize) -> Self
Construct a suffixed usize literal with the given span and integer.
Sourcefn usize_unsuffixed_spanned(span: Span, integer: usize) -> Self
fn usize_unsuffixed_spanned(span: Span, integer: usize) -> Self
Construct an unsuffixed usize literal with the given span and integer.
Sourcefn f32_suffixed_spanned(span: Span, float: f32) -> Self
fn f32_suffixed_spanned(span: Span, float: f32) -> Self
Construct a suffixed f32 literal with the given span and float.
Sourcefn f32_unsuffixed_spanned(span: Span, float: f32) -> Self
fn f32_unsuffixed_spanned(span: Span, float: f32) -> Self
Construct an unsuffixed f32 literal with the given span and float.
Sourcefn f64_suffixed_spanned(span: Span, float: f64) -> Self
fn f64_suffixed_spanned(span: Span, float: f64) -> Self
Construct a suffixed f64 literal with the given span and float.
Sourcefn f64_unsuffixed_spanned(span: Span, float: f64) -> Self
fn f64_unsuffixed_spanned(span: Span, float: f64) -> Self
Construct an unsuffixed f64 literal with the given span and float.
Sourcefn string_spanned(span: Span, string: &str) -> Self
fn string_spanned(span: Span, string: &str) -> Self
Construct a string literal with the given span and string.
Sourcefn byte_string_spanned(span: Span, bytes: &[u8]) -> Self
fn byte_string_spanned(span: Span, bytes: &[u8]) -> Self
Construct a byte string literal with the given span and bytes.
Sourcefn c_string_spanned(span: Span, string: &CStr) -> Self
fn c_string_spanned(span: Span, string: &CStr) -> Self
Construct a C-string literal with the given span and c-string.
Sourcefn character_spanned(span: Span, character: char) -> Self
fn character_spanned(span: Span, character: char) -> Self
Construct a char literal with the given span and character.
Sourcefn byte_character_spanned(span: Span, byte: u8) -> Self
fn byte_character_spanned(span: Span, byte: u8) -> Self
Construct a byte character literal with the given span and byte.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.