pub struct VarDecl { /* private fields */ }Implementations§
Source§impl VarDecl
impl VarDecl
pub fn name_token(&self) -> Option<SyntaxToken>
Sourcepub fn value(&self) -> Option<SyntaxNode>
pub fn value(&self) -> Option<SyntaxNode>
The initializer expression’s root node, if the = clause was
present. var name = expr always parses the initializer as exactly
one child node (whatever expression-grammar kind it is) after the
IDENT, so “the first child node that is neither the leading doc
comment nor the : type annotation” is unambiguous.
Sourcepub fn type_annotation(&self) -> Option<TypeAnnotation>
pub fn type_annotation(&self) -> Option<TypeAnnotation>
The binding’s : type annotation, if written (NG-B, #1488).
Sourcepub fn doc(&self) -> Option<DocComment>
pub fn doc(&self) -> Option<DocComment>
The leading /// doc comment, if one is attached (B0.6b).
Sourcepub fn is_pub(&self) -> bool
pub fn is_pub(&self) -> bool
See FlowDecl::is_pub.
Trait Implementations§
Source§impl AstNode for VarDecl
impl AstNode for VarDecl
Source§fn can_cast(kind: SyntaxKind) -> bool
fn can_cast(kind: SyntaxKind) -> bool
Returns
true for a node with a SyntaxKind this type can wrap.Source§fn cast(node: SyntaxNode) -> Option<Self>
fn cast(node: SyntaxNode) -> Option<Self>
Try to cast a generic
SyntaxNode into this typed wrapper.Source§fn syntax(&self) -> &SyntaxNode
fn syntax(&self) -> &SyntaxNode
Access the underlying
SyntaxNode.impl Eq for VarDecl
impl StructuralPartialEq for VarDecl
Auto Trait Implementations§
impl !RefUnwindSafe for VarDecl
impl !Send for VarDecl
impl !Sync for VarDecl
impl !UnwindSafe for VarDecl
impl Freeze for VarDecl
impl Unpin for VarDecl
impl UnsafeUnpin for VarDecl
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