proc_macro2::imp

Enum Literal

source
pub(crate) enum Literal {
    Compiler(Literal),
    Fallback(Literal),
}

Variants§

§

Compiler(Literal)

§

Fallback(Literal)

Implementations§

source§

impl Literal

source

pub(crate) fn from_str_checked(repr: &str) -> Result<Self, LexError>

source

pub(crate) unsafe fn from_str_unchecked(repr: &str) -> Self

source

pub(crate) fn u8_suffixed(n: u8) -> Literal

source

pub(crate) fn u16_suffixed(n: u16) -> Literal

source

pub(crate) fn u32_suffixed(n: u32) -> Literal

source

pub(crate) fn u64_suffixed(n: u64) -> Literal

source

pub(crate) fn u128_suffixed(n: u128) -> Literal

source

pub(crate) fn usize_suffixed(n: usize) -> Literal

source

pub(crate) fn i8_suffixed(n: i8) -> Literal

source

pub(crate) fn i16_suffixed(n: i16) -> Literal

source

pub(crate) fn i32_suffixed(n: i32) -> Literal

source

pub(crate) fn i64_suffixed(n: i64) -> Literal

source

pub(crate) fn i128_suffixed(n: i128) -> Literal

source

pub(crate) fn isize_suffixed(n: isize) -> Literal

source

pub(crate) fn f32_suffixed(n: f32) -> Literal

source

pub(crate) fn f64_suffixed(n: f64) -> Literal

source

pub(crate) fn u8_unsuffixed(n: u8) -> Literal

source

pub(crate) fn u16_unsuffixed(n: u16) -> Literal

source

pub(crate) fn u32_unsuffixed(n: u32) -> Literal

source

pub(crate) fn u64_unsuffixed(n: u64) -> Literal

source

pub(crate) fn u128_unsuffixed(n: u128) -> Literal

source

pub(crate) fn usize_unsuffixed(n: usize) -> Literal

source

pub(crate) fn i8_unsuffixed(n: i8) -> Literal

source

pub(crate) fn i16_unsuffixed(n: i16) -> Literal

source

pub(crate) fn i32_unsuffixed(n: i32) -> Literal

source

pub(crate) fn i64_unsuffixed(n: i64) -> Literal

source

pub(crate) fn i128_unsuffixed(n: i128) -> Literal

source

pub(crate) fn isize_unsuffixed(n: isize) -> Literal

source

pub(crate) fn f32_unsuffixed(f: f32) -> Literal

source

pub(crate) fn f64_unsuffixed(f: f64) -> Literal

source

pub(crate) fn string(string: &str) -> Literal

source

pub(crate) fn character(ch: char) -> Literal

source

pub(crate) fn byte_character(byte: u8) -> Literal

source

pub(crate) fn byte_string(bytes: &[u8]) -> Literal

source

pub(crate) fn c_string(string: &CStr) -> Literal

source

pub(crate) fn span(&self) -> Span

source

pub(crate) fn set_span(&mut self, span: Span)

source

pub(crate) fn subspan<R: RangeBounds<usize>>(&self, range: R) -> Option<Span>

source

fn unwrap_nightly(self) -> Literal

Trait Implementations§

source§

impl Clone for Literal

source§

fn clone(&self) -> Literal

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Literal

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Literal

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.