Module ast_traits

Source
Expand description

A set of traits implemented for various AST nodes, typically those used in AST fragments during macro expansion. The traits are not implemented exhaustively, only when actually necessary.

Macrosยง

impl_has_attrs ๐Ÿ”’
impl_has_attrs_none ๐Ÿ”’
impl_has_node_id ๐Ÿ”’
impl_has_tokens ๐Ÿ”’
impl_has_tokens_none ๐Ÿ”’
impl_not_ast_deref ๐Ÿ”’

Structsยง

AstNodeWrapper
A newtype around an AST node that implements the traits above if the node implements them.

Traitsยง

AstDeref
A utility trait to reduce boilerplate. Standard Deref(Mut) cannot be reused due to coherence.
HasAttrs
A trait for AST nodes having (or not having) attributes.
HasNodeId
A trait for AST nodes having an ID.
HasTokens
A trait for AST nodes having (or not having) collected tokens.