Skip to main content

AttributeHelper

Trait AttributeHelper 

Source
pub trait AttributeHelper {
    // Required methods
    fn get_attributes(&self) -> Option<&Vec<Attribute>>;
    fn get_mut_attributes(&mut self) -> Option<&mut Vec<Attribute>>;

    // Provided methods
    fn get_attribute(&self, path: &str) -> Option<&Attribute> { ... }
    fn get_mut_attribute(&mut self, path: &str) -> Option<&mut Attribute> { ... }
    fn contains_attribute(&self, path: &str) -> bool { ... }
    fn remove_attribute(&mut self, path: &str) { ... }
    fn replace_attributes(&mut self, new: Vec<Attribute>) -> Vec<Attribute> { ... }
    fn insert_front(&mut self, front: Vec<Attribute>) { ... }
    fn get_attribute_inner(&self, path: &str) -> Option<&TokenStream2> { ... }
    fn get_attribute_value(&self, path: &str) -> Option<&Expr> { ... }
}

Required Methods§

Provided Methods§

Source

fn get_attribute(&self, path: &str) -> Option<&Attribute>

Source

fn get_mut_attribute(&mut self, path: &str) -> Option<&mut Attribute>

Source

fn contains_attribute(&self, path: &str) -> bool

Source

fn remove_attribute(&mut self, path: &str)

Source

fn replace_attributes(&mut self, new: Vec<Attribute>) -> Vec<Attribute>

Source

fn insert_front(&mut self, front: Vec<Attribute>)

Expands this vector by attaching the given value to the front of this vector.

Source

fn get_attribute_inner(&self, path: &str) -> Option<&TokenStream2>

#[path(inner)]

Source

fn get_attribute_value(&self, path: &str) -> Option<&Expr>

#[path = value]

Implementations on Foreign Types§

Source§

impl AttributeHelper for Expr

Source§

impl AttributeHelper for Item

Source§

impl AttributeHelper for Field

Source§

impl AttributeHelper for ExprArray

Source§

impl AttributeHelper for ExprAssign

Source§

impl AttributeHelper for ExprAsync

Source§

impl AttributeHelper for ExprAwait

Source§

impl AttributeHelper for ExprBinary

Source§

impl AttributeHelper for ExprBlock

Source§

impl AttributeHelper for ExprBreak

Source§

impl AttributeHelper for ExprCall

Source§

impl AttributeHelper for ExprCast

Source§

impl AttributeHelper for ExprClosure

Source§

impl AttributeHelper for ExprConst

Source§

impl AttributeHelper for ExprContinue

Source§

impl AttributeHelper for ExprField

Source§

impl AttributeHelper for ExprForLoop

Source§

impl AttributeHelper for ExprGroup

Source§

impl AttributeHelper for ExprIf

Source§

impl AttributeHelper for ExprIndex

Source§

impl AttributeHelper for ExprInfer

Source§

impl AttributeHelper for ExprLet

Source§

impl AttributeHelper for ExprLit

Source§

impl AttributeHelper for ExprLoop

Source§

impl AttributeHelper for ExprMacro

Source§

impl AttributeHelper for ExprMatch

Source§

impl AttributeHelper for ExprMethodCall

Source§

impl AttributeHelper for ExprParen

Source§

impl AttributeHelper for ExprPath

Source§

impl AttributeHelper for ExprRange

Source§

impl AttributeHelper for ExprRawAddr

Source§

impl AttributeHelper for ExprReference

Source§

impl AttributeHelper for ExprRepeat

Source§

impl AttributeHelper for ExprReturn

Source§

impl AttributeHelper for ExprStruct

Source§

impl AttributeHelper for ExprTry

Source§

impl AttributeHelper for ExprTryBlock

Source§

impl AttributeHelper for ExprTuple

Source§

impl AttributeHelper for ExprUnary

Source§

impl AttributeHelper for ExprUnsafe

Source§

impl AttributeHelper for ExprWhile

Source§

impl AttributeHelper for ExprYield

Source§

impl AttributeHelper for ItemConst

Source§

impl AttributeHelper for ItemMod

Source§

impl AttributeHelper for ItemStruct

Implementors§