Struct proc_macro::Op[][src]

pub struct Op {
    op: char,
    spacing: Spacing,
    span: Span,
}
🔬 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.

Fields

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

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 Quote for Op
[src]

🔬 This is a nightly-only experimental API. (proc_macro_internals #27812)

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