rustc_ast::ast_traits

Trait AstDeref

Source
pub trait AstDeref {
    type Target;

    // Required methods
    fn ast_deref(&self) -> &Self::Target;
    fn ast_deref_mut(&mut self) -> &mut Self::Target;
}
Expand description

A utility trait to reduce boilerplate. Standard Deref(Mut) cannot be reused due to coherence.

Required Associated Types§

Required Methods§

Source

fn ast_deref(&self) -> &Self::Target

Source

fn ast_deref_mut(&mut self) -> &mut Self::Target

Implementors§

Source§

impl !AstDeref for Expr

Source§

impl !AstDeref for Item

Source§

impl !AstDeref for Stmt

Source§

impl !AstDeref for AssocItem

Source§

impl !AstDeref for ForeignItem

Source§

impl<T> AstDeref for P<T>

Source§

impl<Wrapped, Tag> AstDeref for AstNodeWrapper<Wrapped, Tag>

Source§

type Target = Wrapped