pub struct Attr {
pub id: AttrId,
pub path: Interned<ModPath>,
pub input: Option<Interned<AttrInput>>,
pub ctxt: SyntaxContextId,
}
Fields§
§id: AttrId
§path: Interned<ModPath>
§input: Option<Interned<AttrInput>>
§ctxt: SyntaxContextId
Implementations§
source§impl Attr
impl Attr
sourcepub fn string_value(&self) -> Option<&str>
pub fn string_value(&self) -> Option<&str>
#[path = “string”]
sourcepub fn single_ident_value(&self) -> Option<&Ident<SpanData<SyntaxContextId>>>
pub fn single_ident_value(&self) -> Option<&Ident<SpanData<SyntaxContextId>>>
#[path(ident)]
sourcepub fn token_tree_value(&self) -> Option<&Subtree<SpanData<SyntaxContextId>>>
pub fn token_tree_value(&self) -> Option<&Subtree<SpanData<SyntaxContextId>>>
#[path TokenTree]
sourcepub fn parse_path_comma_token_tree<'a>(
&'a self,
db: &'a dyn ExpandDatabase
) -> Option<impl Iterator<Item = (ModPath, SpanData<SyntaxContextId>)> + 'a>
pub fn parse_path_comma_token_tree<'a>( &'a self, db: &'a dyn ExpandDatabase ) -> Option<impl Iterator<Item = (ModPath, SpanData<SyntaxContextId>)> + 'a>
Parses this attribute as a token tree consisting of comma separated paths.
pub fn cfg(&self) -> Option<CfgExpr>
Trait Implementations§
source§impl PartialEq for Attr
impl PartialEq for Attr
impl Eq for Attr
impl StructuralPartialEq for Attr
Auto Trait Implementations§
impl Freeze for Attr
impl RefUnwindSafe for Attr
impl Send for Attr
impl Sync for Attr
impl Unpin for Attr
impl UnwindSafe for Attr
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Cast for T
impl<T> Cast for T
source§fn cast<U>(self, interner: <U as HasInterner>::Interner) -> Uwhere
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: <U as HasInterner>::Interner) -> Uwhere
Self: CastTo<U>,
U: HasInterner,
Cast a value to type
U
using CastTo
.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.