pub struct ReturnStmt { /* private fields */ }Implementations§
Source§impl ReturnStmt
impl ReturnStmt
Sourcepub fn value(&self) -> Option<SyntaxNode>
pub fn value(&self) -> Option<SyntaxNode>
The value expression, if any — RETURN_STMT’s only child node.
Some/None for both grammars now: the content-ground bare
return/return <expr>/return -> x (parser/divert.rs:: return_stmt — the value is optional, and -> x is a distinct
RETURN_REDIRECT node, never this accessor’s concern; issue #1973
added the value case, previously always None here) and the
code-ground return e?; (B0.8 Wave B tail, issue #1322,
parser/stmt.rs::return_stmt — the initializer was already
optional there). See syntax_kind.rs’s RETURN_STMT doc for why
one node shape serves both grammars.
Trait Implementations§
Source§impl AstNode for ReturnStmt
impl AstNode for ReturnStmt
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.Source§impl Clone for ReturnStmt
impl Clone for ReturnStmt
Source§fn clone(&self) -> ReturnStmt
fn clone(&self) -> ReturnStmt
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReturnStmt
impl Debug for ReturnStmt
Source§impl Display for ReturnStmt
impl Display for ReturnStmt
impl Eq for ReturnStmt
Source§impl Hash for ReturnStmt
impl Hash for ReturnStmt
Source§impl PartialEq for ReturnStmt
impl PartialEq for ReturnStmt
impl StructuralPartialEq for ReturnStmt
Auto Trait Implementations§
impl !RefUnwindSafe for ReturnStmt
impl !Send for ReturnStmt
impl !Sync for ReturnStmt
impl !UnwindSafe for ReturnStmt
impl Freeze for ReturnStmt
impl Unpin for ReturnStmt
impl UnsafeUnpin for ReturnStmt
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