Skip to main content

LiteralExt

Trait LiteralExt 

Source
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§

Source

fn i8_suffixed_spanned(span: Span, integer: i8) -> Self

Construct a suffixed i8 literal with the given span and integer.

Source

fn i8_unsuffixed_spanned(span: Span, integer: i8) -> Self

Construct an unsuffixed i8 literal with the given span and integer.

Source

fn i16_suffixed_spanned(span: Span, integer: i16) -> Self

Construct a suffixed i16 literal with the given span and integer.

Source

fn i16_unsuffixed_spanned(span: Span, integer: i16) -> Self

Construct an unsuffixed i16 literal with the given span and integer.

Source

fn i32_suffixed_spanned(span: Span, integer: i32) -> Self

Construct a suffixed i32 literal with the given span and integer.

Source

fn i32_unsuffixed_spanned(span: Span, integer: i32) -> Self

Construct an unsuffixed i32 literal with the given span and integer.

Source

fn i64_suffixed_spanned(span: Span, integer: i64) -> Self

Construct a suffixed i64 literal with the given span and integer.

Source

fn i64_unsuffixed_spanned(span: Span, integer: i64) -> Self

Construct an unsuffixed i64 literal with the given span and integer.

Source

fn i128_suffixed_spanned(span: Span, integer: i128) -> Self

Construct a suffixed i128 literal with the given span and integer.

Source

fn i128_unsuffixed_spanned(span: Span, integer: i128) -> Self

Construct an unsuffixed i128 literal with the given span and integer.

Source

fn isize_suffixed_spanned(span: Span, integer: isize) -> Self

Construct a suffixed isize literal with the given span and integer.

Source

fn isize_unsuffixed_spanned(span: Span, integer: isize) -> Self

Construct an unsuffixed isize literal with the given span and integer.

Source

fn u8_suffixed_spanned(span: Span, integer: u8) -> Self

Construct a suffixed u8 literal with the given span and integer.

Source

fn u8_unsuffixed_spanned(span: Span, integer: u8) -> Self

Construct an unsuffixed u8 literal with the given span and integer.

Source

fn u16_suffixed_spanned(span: Span, integer: u16) -> Self

Construct a suffixed u16 literal with the given span and integer.

Source

fn u16_unsuffixed_spanned(span: Span, integer: u16) -> Self

Construct an unsuffixed u16 literal with the given span and integer.

Source

fn u32_suffixed_spanned(span: Span, integer: u32) -> Self

Construct a suffixed u32 literal with the given span and integer.

Source

fn u32_unsuffixed_spanned(span: Span, integer: u32) -> Self

Construct an unsuffixed u32 literal with the given span and integer.

Source

fn u64_suffixed_spanned(span: Span, integer: u64) -> Self

Construct a suffixed u64 literal with the given span and integer.

Source

fn u64_unsuffixed_spanned(span: Span, integer: u64) -> Self

Construct an unsuffixed u64 literal with the given span and integer.

Source

fn u128_suffixed_spanned(span: Span, integer: u128) -> Self

Construct a suffixed u128 literal with the given span and integer.

Source

fn u128_unsuffixed_spanned(span: Span, integer: u128) -> Self

Construct an unsuffixed u128 literal with the given span and integer.

Source

fn usize_suffixed_spanned(span: Span, integer: usize) -> Self

Construct a suffixed usize literal with the given span and integer.

Source

fn usize_unsuffixed_spanned(span: Span, integer: usize) -> Self

Construct an unsuffixed usize literal with the given span and integer.

Source

fn f32_suffixed_spanned(span: Span, float: f32) -> Self

Construct a suffixed f32 literal with the given span and float.

Source

fn f32_unsuffixed_spanned(span: Span, float: f32) -> Self

Construct an unsuffixed f32 literal with the given span and float.

Source

fn f64_suffixed_spanned(span: Span, float: f64) -> Self

Construct a suffixed f64 literal with the given span and float.

Source

fn f64_unsuffixed_spanned(span: Span, float: f64) -> Self

Construct an unsuffixed f64 literal with the given span and float.

Source

fn string_spanned(span: Span, string: &str) -> Self

Construct a string literal with the given span and string.

Source

fn byte_string_spanned(span: Span, bytes: &[u8]) -> Self

Construct a byte string literal with the given span and bytes.

Source

fn c_string_spanned(span: Span, string: &CStr) -> Self

Construct a C-string literal with the given span and c-string.

Source

fn character_spanned(span: Span, character: char) -> Self

Construct a char literal with the given span and character.

Source

fn byte_character_spanned(span: Span, byte: u8) -> Self

Construct a byte character literal with the given span and byte.

Source

fn equals(&self, other: &Self) -> bool

Checks if this literal is equal to other.

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.

Implementations on Foreign Types§

Source§

impl LiteralExt for Literal

Source§

fn i8_suffixed_spanned(span: Span, integer: i8) -> Self

Source§

fn i8_unsuffixed_spanned(span: Span, integer: i8) -> Self

Source§

fn i16_suffixed_spanned(span: Span, integer: i16) -> Self

Source§

fn i16_unsuffixed_spanned(span: Span, integer: i16) -> Self

Source§

fn i32_suffixed_spanned(span: Span, integer: i32) -> Self

Source§

fn i32_unsuffixed_spanned(span: Span, integer: i32) -> Self

Source§

fn i64_suffixed_spanned(span: Span, integer: i64) -> Self

Source§

fn i64_unsuffixed_spanned(span: Span, integer: i64) -> Self

Source§

fn i128_suffixed_spanned(span: Span, integer: i128) -> Self

Source§

fn i128_unsuffixed_spanned(span: Span, integer: i128) -> Self

Source§

fn isize_suffixed_spanned(span: Span, integer: isize) -> Self

Source§

fn isize_unsuffixed_spanned(span: Span, integer: isize) -> Self

Source§

fn u8_suffixed_spanned(span: Span, integer: u8) -> Self

Source§

fn u8_unsuffixed_spanned(span: Span, integer: u8) -> Self

Source§

fn u16_suffixed_spanned(span: Span, integer: u16) -> Self

Source§

fn u16_unsuffixed_spanned(span: Span, integer: u16) -> Self

Source§

fn u32_suffixed_spanned(span: Span, integer: u32) -> Self

Source§

fn u32_unsuffixed_spanned(span: Span, integer: u32) -> Self

Source§

fn u64_suffixed_spanned(span: Span, integer: u64) -> Self

Source§

fn u64_unsuffixed_spanned(span: Span, integer: u64) -> Self

Source§

fn u128_suffixed_spanned(span: Span, integer: u128) -> Self

Source§

fn u128_unsuffixed_spanned(span: Span, integer: u128) -> Self

Source§

fn usize_suffixed_spanned(span: Span, integer: usize) -> Self

Source§

fn usize_unsuffixed_spanned(span: Span, integer: usize) -> Self

Source§

fn f32_suffixed_spanned(span: Span, float: f32) -> Self

Source§

fn f32_unsuffixed_spanned(span: Span, float: f32) -> Self

Source§

fn f64_suffixed_spanned(span: Span, float: f64) -> Self

Source§

fn f64_unsuffixed_spanned(span: Span, float: f64) -> Self

Source§

fn string_spanned(span: Span, string: &str) -> Self

Source§

fn byte_string_spanned(span: Span, bytes: &[u8]) -> Self

Source§

fn c_string_spanned(span: Span, string: &CStr) -> Self

Source§

fn character_spanned(span: Span, character: char) -> Self

Source§

fn byte_character_spanned(span: Span, byte: u8) -> Self

Source§

fn equals(&self, other: &Self) -> bool

Implementors§