Punct in proc_macro - Rust (original) (raw)

Struct Punct

1.29.0 · Source

pub struct Punct(/* private fields */);

Expand description

A Punct is a single punctuation character such as +, - or #.

Multi-character operators like += are represented as two instances of Punct with different forms of Spacing returned.

Source§

1.29.0 · Source

Creates a new Punct from the given character and spacing. The ch argument must be a valid punctuation character permitted by the language, otherwise the function will panic.

The returned Punct will have the default span of Span::call_site()which can be further configured with the set_span method below.

1.29.0 · Source

Returns the value of this punctuation character as char.

1.29.0 · Source

Returns the spacing of this punctuation character, indicating whether it can be potentially combined into a multi-character operator with the following token (Joint), or whether the operator has definitely ended (Alone).

1.29.0 · Source

Returns the span for this punctuation character.

1.29.0 · Source

Configure the span for this punctuation character.

1.29.0 · Source§

1.29.0 · Source§

1.29.0 · Source§

Prints the punctuation character as a string that should be losslessly convertible back into the same character.

1.29.0 · Source§

Source§

Converts to this type from the input type.

1.52.0 · Source§

Source§

Tests for self and other values to be equal, and is used by ==.

1.0.0 · Source§

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

1.50.0 · Source§

Source§

Tests for self and other values to be equal, and is used by ==.

1.0.0 · Source§

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Source§

Source§

🔬This is a nightly-only experimental API. (proc_macro_totokens #130977)

Write self to the given TokenStream. Read more

Source§

🔬This is a nightly-only experimental API. (proc_macro_totokens #130977)

Convert self directly into a TokenStream object. Read more

Source§

🔬This is a nightly-only experimental API. (proc_macro_totokens #130977)

Convert self directly into a TokenStream object. Read more

1.29.0 · Source§

1.29.0 · Source§

§

§

§

§