[][src]Struct proc_macro2::Literal

pub struct Literal { /* fields omitted */ }

A literal string ("hello"), byte string (b"hello"), character ('a'), byte character (b'a'), an integer or floating point number with or without a suffix (1, 1u8, 2.3, 2.3f32).

Boolean literals like true and false do not belong here, they are Idents.

Methods

impl Literal
[src]

Creates a new suffixed integer literal with the specified value.

This function will create an integer like 1u32 where the integer value specified is the first part of the token and the integral is also suffixed at the end. Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new suffixed integer literal with the specified value.

This function will create an integer like 1u32 where the integer value specified is the first part of the token and the integral is also suffixed at the end. Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new suffixed integer literal with the specified value.

This function will create an integer like 1u32 where the integer value specified is the first part of the token and the integral is also suffixed at the end. Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new suffixed integer literal with the specified value.

This function will create an integer like 1u32 where the integer value specified is the first part of the token and the integral is also suffixed at the end. Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new suffixed integer literal with the specified value.

This function will create an integer like 1u32 where the integer value specified is the first part of the token and the integral is also suffixed at the end. Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new suffixed integer literal with the specified value.

This function will create an integer like 1u32 where the integer value specified is the first part of the token and the integral is also suffixed at the end. Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new suffixed integer literal with the specified value.

This function will create an integer like 1u32 where the integer value specified is the first part of the token and the integral is also suffixed at the end. Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new suffixed integer literal with the specified value.

This function will create an integer like 1u32 where the integer value specified is the first part of the token and the integral is also suffixed at the end. Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new suffixed integer literal with the specified value.

This function will create an integer like 1u32 where the integer value specified is the first part of the token and the integral is also suffixed at the end. Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new suffixed integer literal with the specified value.

This function will create an integer like 1u32 where the integer value specified is the first part of the token and the integral is also suffixed at the end. Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new suffixed integer literal with the specified value.

This function will create an integer like 1u32 where the integer value specified is the first part of the token and the integral is also suffixed at the end. Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new suffixed integer literal with the specified value.

This function will create an integer like 1u32 where the integer value specified is the first part of the token and the integral is also suffixed at the end. Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new unsuffixed integer literal with the specified value.

This function will create an integer like 1 where the integer value specified is the first part of the token. No suffix is specified on this token, meaning that invocations like Literal::i8_unsuffixed(1) are equivalent to Literal::u32_unsuffixed(1). Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new unsuffixed integer literal with the specified value.

This function will create an integer like 1 where the integer value specified is the first part of the token. No suffix is specified on this token, meaning that invocations like Literal::i8_unsuffixed(1) are equivalent to Literal::u32_unsuffixed(1). Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new unsuffixed integer literal with the specified value.

This function will create an integer like 1 where the integer value specified is the first part of the token. No suffix is specified on this token, meaning that invocations like Literal::i8_unsuffixed(1) are equivalent to Literal::u32_unsuffixed(1). Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new unsuffixed integer literal with the specified value.

This function will create an integer like 1 where the integer value specified is the first part of the token. No suffix is specified on this token, meaning that invocations like Literal::i8_unsuffixed(1) are equivalent to Literal::u32_unsuffixed(1). Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new unsuffixed integer literal with the specified value.

This function will create an integer like 1 where the integer value specified is the first part of the token. No suffix is specified on this token, meaning that invocations like Literal::i8_unsuffixed(1) are equivalent to Literal::u32_unsuffixed(1). Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new unsuffixed integer literal with the specified value.

This function will create an integer like 1 where the integer value specified is the first part of the token. No suffix is specified on this token, meaning that invocations like Literal::i8_unsuffixed(1) are equivalent to Literal::u32_unsuffixed(1). Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new unsuffixed integer literal with the specified value.

This function will create an integer like 1 where the integer value specified is the first part of the token. No suffix is specified on this token, meaning that invocations like Literal::i8_unsuffixed(1) are equivalent to Literal::u32_unsuffixed(1). Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new unsuffixed integer literal with the specified value.

This function will create an integer like 1 where the integer value specified is the first part of the token. No suffix is specified on this token, meaning that invocations like Literal::i8_unsuffixed(1) are equivalent to Literal::u32_unsuffixed(1). Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new unsuffixed integer literal with the specified value.

This function will create an integer like 1 where the integer value specified is the first part of the token. No suffix is specified on this token, meaning that invocations like Literal::i8_unsuffixed(1) are equivalent to Literal::u32_unsuffixed(1). Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new unsuffixed integer literal with the specified value.

This function will create an integer like 1 where the integer value specified is the first part of the token. No suffix is specified on this token, meaning that invocations like Literal::i8_unsuffixed(1) are equivalent to Literal::u32_unsuffixed(1). Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new unsuffixed integer literal with the specified value.

This function will create an integer like 1 where the integer value specified is the first part of the token. No suffix is specified on this token, meaning that invocations like Literal::i8_unsuffixed(1) are equivalent to Literal::u32_unsuffixed(1). Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new unsuffixed integer literal with the specified value.

This function will create an integer like 1 where the integer value specified is the first part of the token. No suffix is specified on this token, meaning that invocations like Literal::i8_unsuffixed(1) are equivalent to Literal::u32_unsuffixed(1). Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Literals created through this method have the Span::call_site() span by default, which can be configured with the set_span method below.

Creates a new unsuffixed floating-point literal.

This constructor is similar to those like Literal::i8_unsuffixed where the float's value is emitted directly into the token but no suffix is used, so it may be inferred to be a f64 later in the compiler. Literals created from negative numbers may not survive rountrips through TokenStream or strings and may be broken into two tokens (- and positive literal).

Panics

This function requires that the specified float is finite, for example if it is infinity or NaN this function will panic.

Trait Implementations

impl Clone for Literal
[src]

Performs copy-assignment from source. Read more

impl From<Literal> for TokenTree
[src]

impl Display for Literal
[src]

impl Debug for Literal
[src]

Auto Trait Implementations

impl !Send for Literal

impl !Sync for Literal

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.