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§