Struct proc_macro::Op[][src]

pub struct Op { /* fields omitted */ }
🔬 This is a nightly-only experimental API. (proc_macro #38356)

An Op is an operator like + or -, and only represents one character.

Operators like += are represented as two instance of Op with different forms of Spacing returned.

Methods

impl Op
[src]

🔬 This is a nightly-only experimental API. (proc_macro #38356)

Creates a new Op from the given character and spacing.

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

🔬 This is a nightly-only experimental API. (proc_macro #38356)

Returns the character this operation represents, for example '+'

🔬 This is a nightly-only experimental API. (proc_macro #38356)

Returns the spacing of this operator, indicating whether it's a joint operator with more operators coming next in the token stream or an Alone meaning that the operator has ended.

🔬 This is a nightly-only experimental API. (proc_macro #38356)

Returns the span for this operator character

🔬 This is a nightly-only experimental API. (proc_macro #38356)

Configure the span for this operator's character

Trait Implementations

impl From<Op> for TokenTree
[src]

Performs the conversion.

impl Copy for Op
[src]

impl Clone for Op
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Op
[src]

Formats the value using the given formatter. Read more

impl !Send for Op
[src]

impl !Sync for Op
[src]

impl Display for Op
[src]

Formats the value using the given formatter. Read more