pub trait AttributeIdent {
    const IDENTS: &'static [&'static str];

    // Provided methods
    fn is_ident(path: &Path) -> bool { ... }
    fn ident() -> &'static str { ... }
}
Expand description

Helper trait providing the path for an attribute.

Automatically derived with FromAttr, if #[attribute(ident = "some_ident")] is provided.

Required Associated Constants§

source

const IDENTS: &'static [&'static str]

List of idents, must contain at least one ident.

Provided Methods§

source

fn is_ident(path: &Path) -> bool

Tests if Attribute matches one of the idents.

source

fn ident() -> &'static str

Returns default ident.

§Panics

The default implementation panics if IDENTS is empty. Implementors should ensure this is not the case.

Object Safety§

This trait is not object safe.

Implementors§