SemanticQueryAttrs

Trait SemanticQueryAttrs 

Source
pub trait SemanticQueryAttrs<'db> {
    // Provided methods
    fn query_attr(
        &self,
        db: &'db dyn Database,
        attr: &str,
    ) -> Maybe<impl Iterator<Item = &'db Attribute<'db>>> { ... }
    fn find_attr(
        &self,
        db: &'db dyn Database,
        attr: &str,
    ) -> Maybe<Option<&'db Attribute<'db>>> { ... }
    fn has_attr(&self, db: &'db dyn Database, attr: &str) -> Maybe<bool> { ... }
    fn has_attr_with_arg(
        &self,
        db: &'db dyn Database,
        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: &'db dyn Database, attr: &str, ) -> Maybe<impl Iterator<Item = &'db Attribute<'db>>>

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

Source

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

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

Source

fn has_attr(&self, db: &'db dyn Database, 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: &'db dyn Database, attr_name: &str, arg_name: &str, ) -> Maybe<bool>

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'db> SemanticQueryAttrs<'db> for FunctionWithBodyId<'db>

Source§

impl<'db> SemanticQueryAttrs<'db> for ModuleId<'db>

Source§

impl<'db> SemanticQueryAttrs<'db> for EnumId<'db>

Source§

impl<'db> SemanticQueryAttrs<'db> for ExternTypeId<'db>

Source§

impl<'db> SemanticQueryAttrs<'db> for FreeFunctionId<'db>

Source§

impl<'db> SemanticQueryAttrs<'db> for ImplAliasId<'db>

Source§

impl<'db> SemanticQueryAttrs<'db> for ImplDefId<'db>

Source§

impl<'db> SemanticQueryAttrs<'db> for ImplFunctionId<'db>

Source§

impl<'db> SemanticQueryAttrs<'db> for ImplTypeDefId<'db>

Source§

impl<'db> SemanticQueryAttrs<'db> for StructId<'db>

Source§

impl<'db> SemanticQueryAttrs<'db> for SubmoduleId<'db>

Source§

impl<'db> SemanticQueryAttrs<'db> for TraitFunctionId<'db>

Source§

impl<'db> SemanticQueryAttrs<'db> for TraitId<'db>

Source§

impl<'db> SemanticQueryAttrs<'db> for TraitTypeId<'db>

Implementors§