cairo_lang_semantic::items::attribute

Trait SemanticQueryAttrs

source
pub trait SemanticQueryAttrs {
    // Provided methods
    fn query_attr(
        &self,
        db: &dyn SemanticGroup,
        attr: &str,
    ) -> Maybe<Vec<Attribute>> { ... }
    fn find_attr(
        &self,
        db: &dyn SemanticGroup,
        attr: &str,
    ) -> Maybe<Option<Attribute>> { ... }
    fn has_attr(&self, db: &dyn SemanticGroup, attr: &str) -> Maybe<bool> { ... }
    fn has_attr_with_arg(
        &self,
        db: &dyn SemanticGroup,
        attr_name: &str,
        arg_name: &str,
    ) -> Maybe<bool> { ... }
}
Expand description

Trait for querying attributes of semantic items.

Provided Methods§

source

fn query_attr( &self, db: &dyn SemanticGroup, attr: &str, ) -> Maybe<Vec<Attribute>>

Collect all attributes attached to this node whose name (without args) is exactly attr.

source

fn find_attr( &self, db: &dyn SemanticGroup, attr: &str, ) -> Maybe<Option<Attribute>>

Find first attribute attached to this node whose name (without args) is exactly attr.

source

fn has_attr(&self, db: &dyn SemanticGroup, attr: &str) -> Maybe<bool>

Check if this node has an attribute whose name (without args) is exactly attr.

source

fn has_attr_with_arg( &self, db: &dyn SemanticGroup, attr_name: &str, arg_name: &str, ) -> Maybe<bool>

Checks if the given object has an attribute with the given name and argument.

Implementations on Foreign Types§

source§

impl SemanticQueryAttrs for FunctionWithBodyId

source§

impl SemanticQueryAttrs for ModuleId

source§

impl SemanticQueryAttrs for EnumId

source§

impl SemanticQueryAttrs for ExternTypeId

source§

impl SemanticQueryAttrs for FreeFunctionId

source§

impl SemanticQueryAttrs for ImplAliasId

source§

impl SemanticQueryAttrs for ImplDefId

source§

impl SemanticQueryAttrs for ImplFunctionId

source§

impl SemanticQueryAttrs for ImplTypeDefId

source§

impl SemanticQueryAttrs for StructId

source§

impl SemanticQueryAttrs for SubmoduleId

source§

impl SemanticQueryAttrs for TraitFunctionId

source§

impl SemanticQueryAttrs for TraitId

source§

impl SemanticQueryAttrs for TraitTypeId

Implementors§