pub struct Attr {
pub id: AttrId,
pub path: Interned<ModPath>,
pub input: Option<Interned<AttrInput>>,
}
Fields§
§id: AttrId
§path: Interned<ModPath>
§input: Option<Interned<AttrInput>>
Implementations§
source§impl Attr
impl Attr
sourcepub fn string_value(&self) -> Option<&SmolStr>
pub fn string_value(&self) -> Option<&SmolStr>
#[path = “string”]
sourcepub fn single_ident_value(&self) -> Option<&Ident>
pub fn single_ident_value(&self) -> Option<&Ident>
#[path(ident)]
sourcepub fn token_tree_value(&self) -> Option<&Subtree>
pub fn token_tree_value(&self) -> Option<&Subtree>
#[path TokenTree]
sourcepub fn parse_path_comma_token_tree(
&self
) -> Option<impl Iterator<Item = ModPath>>
pub fn parse_path_comma_token_tree(
&self
) -> Option<impl Iterator<Item = ModPath>>
Parses this attribute as a token tree consisting of comma separated paths.
Trait Implementations§
source§impl PartialEq<Attr> for Attr
impl PartialEq<Attr> for Attr
impl Eq for Attr
impl StructuralEq for Attr
impl StructuralPartialEq for Attr
Auto Trait Implementations§
impl RefUnwindSafe for Attr
impl Send for Attr
impl Sync for Attr
impl Unpin for Attr
impl UnwindSafe for Attr
Blanket Implementations§
§impl<T> Cast for T
impl<T> Cast for T
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.