Struct ra_ap_syntax::ast::Attr
source · pub struct Attr { /* private fields */ }
Implementations§
source§impl Attr
impl Attr
pub fn meta(&self) -> Option<Meta>
pub fn excl_token(&self) -> Option<SyntaxToken>
pub fn pound_token(&self) -> Option<SyntaxToken>
pub fn l_brack_token(&self) -> Option<SyntaxToken>
pub fn r_brack_token(&self) -> Option<SyntaxToken>
source§impl Attr
impl Attr
pub fn as_simple_atom(&self) -> Option<SmolStr>
pub fn as_simple_call(&self) -> Option<(SmolStr, TokenTree)>
pub fn simple_name(&self) -> Option<SmolStr>
pub fn kind(&self) -> AttrKind
pub fn path(&self) -> Option<Path>
pub fn expr(&self) -> Option<Expr>
pub fn token_tree(&self) -> Option<TokenTree>
Trait Implementations§
source§impl AstNode for Attr
impl AstNode for Attr
fn can_cast(kind: SyntaxKind) -> bool
fn cast(syntax: SyntaxNode) -> Option<Self>
fn syntax(&self) -> &SyntaxNode
fn clone_for_update(&self) -> Selfwhere
Self: Sized,
fn clone_subtree(&self) -> Selfwhere
Self: Sized,
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<N> AstNodeEdit for N
impl<N> AstNodeEdit for N
fn indent_level(&self) -> IndentLevel
fn indent(&self, level: IndentLevel) -> Self
fn dedent(&self, level: IndentLevel) -> Self
fn reset_indent(&self) -> Self
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<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.source§impl<N> Indent for N
impl<N> Indent for N
fn indent_level(&self) -> IndentLevel
fn indent(&self, by: IndentLevel)
fn dedent(&self, by: IndentLevel)
fn reindent_to(&self, target_level: IndentLevel)
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more