pub trait ScopeAttr {
    fn path(&self) -> SimplePath;
    fn apply(&self, attr: Attribute, scope: &mut Scope) -> Result<()>;

    fn support_repetition(&self) -> bool { ... }
}
Expand description

Attribute rule for Scope

Rules are matched via a path, e.g. &["foo"] matches foo and &["", "foo", "bar"] matches ::foo::bar.

Such rules are used to expand attributes within an impl_scope!.

Required Methods

Attribute path

Rules are matched via a path, e.g. &["foo"] matches foo and &["", "foo", "bar"] matches ::foo::bar.

Note that we cannot use standard path resolution, so we match only a single path, as defined.

Function type of ScopeAttr rule

Input arguments:

Provided Methods

Whether repeated application is valid

If this is false (the default), then an error will be omitted on repeated usage of the attribute. This mostly serves to emit better error messages in cases where the first application modifies the input.

Implementors