Trait TokenTreePunct

Source
pub trait TokenTreePunct: Sealed {
Show 25 methods // Required methods fn is_equals(&self) -> bool; fn is_less_than(&self) -> bool; fn is_greater_than(&self) -> bool; fn is_exclamation(&self) -> bool; fn is_tilde(&self) -> bool; fn is_plus(&self) -> bool; fn is_minus(&self) -> bool; fn is_asterix(&self) -> bool; fn is_slash(&self) -> bool; fn is_percent(&self) -> bool; fn is_caret(&self) -> bool; fn is_and(&self) -> bool; fn is_pipe(&self) -> bool; fn is_at(&self) -> bool; fn is_dot(&self) -> bool; fn is_comma(&self) -> bool; fn is_semi(&self) -> bool; fn is_colon(&self) -> bool; fn is_pound(&self) -> bool; fn is_dollar(&self) -> bool; fn is_question(&self) -> bool; fn is_quote(&self) -> bool; fn is_alone(&self) -> bool; fn is_joint(&self) -> bool; fn alone(self) -> Self;
}
Expand description

Trait to test for punctuation

Required Methods§

Source

fn is_equals(&self) -> bool

Tests if the token is =

Source

fn is_less_than(&self) -> bool

Tests if the token is <

Source

fn is_greater_than(&self) -> bool

Tests if the token is >

Source

fn is_exclamation(&self) -> bool

Tests if the token is !

Source

fn is_tilde(&self) -> bool

Tests if the token is ~

Source

fn is_plus(&self) -> bool

Tests if the token is +

Source

fn is_minus(&self) -> bool

Tests if the token is -

Source

fn is_asterix(&self) -> bool

Tests if the token is *

Source

fn is_slash(&self) -> bool

Tests if the token is /

Source

fn is_percent(&self) -> bool

Tests if the token is %

Source

fn is_caret(&self) -> bool

Tests if the token is ^

Source

fn is_and(&self) -> bool

Tests if the token is &

Source

fn is_pipe(&self) -> bool

Tests if the token is |

Source

fn is_at(&self) -> bool

Tests if the token is @

Source

fn is_dot(&self) -> bool

Tests if the token is .

Source

fn is_comma(&self) -> bool

Tests if the token is ,

Source

fn is_semi(&self) -> bool

Tests if the token is ;

Source

fn is_colon(&self) -> bool

Tests if the token is :

Source

fn is_pound(&self) -> bool

Tests if the token is #

Source

fn is_dollar(&self) -> bool

Tests if the token is $

Source

fn is_question(&self) -> bool

Tests if the token is ?

Source

fn is_quote(&self) -> bool

Tests if the token is '

Source

fn is_alone(&self) -> bool

Tests if token is followed by some none punctuation token or whitespace.

Source

fn is_joint(&self) -> bool

Tests if token is followed by another punct and can potentially be combined into a multi-character operator.

Source

fn alone(self) -> Self

If sets the spacing of a punct to Alone.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl TokenTreePunct for TokenTree

Available on crate feature proc-macro only.
Source§

fn is_equals(&self) -> bool

Tests if the token is =

Source§

fn is_less_than(&self) -> bool

Tests if the token is <

Source§

fn is_greater_than(&self) -> bool

Tests if the token is >

Source§

fn is_exclamation(&self) -> bool

Tests if the token is !

Source§

fn is_tilde(&self) -> bool

Tests if the token is ~

Source§

fn is_plus(&self) -> bool

Tests if the token is +

Source§

fn is_minus(&self) -> bool

Tests if the token is -

Source§

fn is_asterix(&self) -> bool

Tests if the token is *

Source§

fn is_slash(&self) -> bool

Tests if the token is /

Source§

fn is_percent(&self) -> bool

Tests if the token is %

Source§

fn is_caret(&self) -> bool

Tests if the token is ^

Source§

fn is_and(&self) -> bool

Tests if the token is &

Source§

fn is_pipe(&self) -> bool

Tests if the token is |

Source§

fn is_at(&self) -> bool

Tests if the token is @

Source§

fn is_dot(&self) -> bool

Tests if the token is .

Source§

fn is_comma(&self) -> bool

Tests if the token is ,

Source§

fn is_semi(&self) -> bool

Tests if the token is ;

Source§

fn is_colon(&self) -> bool

Tests if the token is :

Source§

fn is_pound(&self) -> bool

Tests if the token is #

Source§

fn is_dollar(&self) -> bool

Tests if the token is $

Source§

fn is_question(&self) -> bool

Tests if the token is ?

Source§

fn is_quote(&self) -> bool

Tests if the token is '

Source§

fn is_alone(&self) -> bool

Tests if token is followed by some none punctuation token or whitespace.

Source§

fn is_joint(&self) -> bool

Tests if token is followed by another punct and can potentially be combined into a multi-character operator.

Source§

fn alone(self) -> Self

If sets the spacing of a punct to Alone.

Source§

impl TokenTreePunct for TokenTree

Available on crate feature proc-macro2 only.
Source§

fn is_equals(&self) -> bool

Tests if the token is =

Source§

fn is_less_than(&self) -> bool

Tests if the token is <

Source§

fn is_greater_than(&self) -> bool

Tests if the token is >

Source§

fn is_exclamation(&self) -> bool

Tests if the token is !

Source§

fn is_tilde(&self) -> bool

Tests if the token is ~

Source§

fn is_plus(&self) -> bool

Tests if the token is +

Source§

fn is_minus(&self) -> bool

Tests if the token is -

Source§

fn is_asterix(&self) -> bool

Tests if the token is *

Source§

fn is_slash(&self) -> bool

Tests if the token is /

Source§

fn is_percent(&self) -> bool

Tests if the token is %

Source§

fn is_caret(&self) -> bool

Tests if the token is ^

Source§

fn is_and(&self) -> bool

Tests if the token is &

Source§

fn is_pipe(&self) -> bool

Tests if the token is |

Source§

fn is_at(&self) -> bool

Tests if the token is @

Source§

fn is_dot(&self) -> bool

Tests if the token is .

Source§

fn is_comma(&self) -> bool

Tests if the token is ,

Source§

fn is_semi(&self) -> bool

Tests if the token is ;

Source§

fn is_colon(&self) -> bool

Tests if the token is :

Source§

fn is_pound(&self) -> bool

Tests if the token is #

Source§

fn is_dollar(&self) -> bool

Tests if the token is $

Source§

fn is_question(&self) -> bool

Tests if the token is ?

Source§

fn is_quote(&self) -> bool

Tests if the token is '

Source§

fn is_alone(&self) -> bool

Tests if token is followed by some none punctuation token or whitespace.

Source§

fn is_joint(&self) -> bool

Tests if token is followed by another punct and can potentially be combined into a multi-character operator.

Source§

fn alone(self) -> Self

If sets the spacing of a punct to Alone.

Source§

impl TokenTreePunct for Punct

Available on crate feature proc-macro only.
Source§

fn is_equals(&self) -> bool

Source§

fn is_less_than(&self) -> bool

Source§

fn is_greater_than(&self) -> bool

Source§

fn is_exclamation(&self) -> bool

Source§

fn is_tilde(&self) -> bool

Source§

fn is_plus(&self) -> bool

Source§

fn is_minus(&self) -> bool

Source§

fn is_asterix(&self) -> bool

Source§

fn is_slash(&self) -> bool

Source§

fn is_percent(&self) -> bool

Source§

fn is_caret(&self) -> bool

Source§

fn is_and(&self) -> bool

Source§

fn is_pipe(&self) -> bool

Source§

fn is_at(&self) -> bool

Source§

fn is_dot(&self) -> bool

Source§

fn is_comma(&self) -> bool

Source§

fn is_semi(&self) -> bool

Source§

fn is_colon(&self) -> bool

Source§

fn is_pound(&self) -> bool

Source§

fn is_dollar(&self) -> bool

Source§

fn is_question(&self) -> bool

Source§

fn is_quote(&self) -> bool

Source§

fn is_alone(&self) -> bool

Source§

fn is_joint(&self) -> bool

Source§

fn alone(self) -> Self

Source§

impl TokenTreePunct for Punct

Available on crate feature proc-macro2 only.
Source§

fn is_equals(&self) -> bool

Source§

fn is_less_than(&self) -> bool

Source§

fn is_greater_than(&self) -> bool

Source§

fn is_exclamation(&self) -> bool

Source§

fn is_tilde(&self) -> bool

Source§

fn is_plus(&self) -> bool

Source§

fn is_minus(&self) -> bool

Source§

fn is_asterix(&self) -> bool

Source§

fn is_slash(&self) -> bool

Source§

fn is_percent(&self) -> bool

Source§

fn is_caret(&self) -> bool

Source§

fn is_and(&self) -> bool

Source§

fn is_pipe(&self) -> bool

Source§

fn is_at(&self) -> bool

Source§

fn is_dot(&self) -> bool

Source§

fn is_comma(&self) -> bool

Source§

fn is_semi(&self) -> bool

Source§

fn is_colon(&self) -> bool

Source§

fn is_pound(&self) -> bool

Source§

fn is_dollar(&self) -> bool

Source§

fn is_question(&self) -> bool

Source§

fn is_quote(&self) -> bool

Source§

fn is_alone(&self) -> bool

Source§

fn is_joint(&self) -> bool

Source§

fn alone(self) -> Self

Implementors§