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§
sourcefn query_attr(
&self,
db: &dyn SemanticGroup,
attr: &str,
) -> Maybe<Vec<Attribute>>
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
.
sourcefn find_attr(
&self,
db: &dyn SemanticGroup,
attr: &str,
) -> Maybe<Option<Attribute>>
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
.
sourcefn has_attr(&self, db: &dyn SemanticGroup, attr: &str) -> Maybe<bool>
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
.
sourcefn has_attr_with_arg(
&self,
db: &dyn SemanticGroup,
attr_name: &str,
arg_name: &str,
) -> Maybe<bool>
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.