pub struct FunctionExpr(/* private fields */);Implementations§
Source§impl FunctionExpr
impl FunctionExpr
pub fn lparen_index(&self) -> Option<usize>
pub fn rparen_index(&self) -> Option<usize>
Sourcepub fn params(&self) -> Vec<Param>
pub fn params(&self) -> Vec<Param>
Iterate the parameters of the function. Each entry yields the parameter name and the range of its name token. Default-value tokens are skipped (function param defaults are raw tokens in the param list, not nodes).
Sourcepub fn body(&self) -> Option<SyntaxElement<RLanguage>>
pub fn body(&self) -> Option<SyntaxElement<RLanguage>>
The function body — the expression that follows the ). May be any
expression node (a BLOCK_EXPR for function(x) { ... }, or any other
expression for function(x) x + 1). Returns None if the body was
missing or replaced by an error-recovery placeholder.
Trait Implementations§
Source§impl AstNode for FunctionExpr
impl AstNode for FunctionExpr
Source§impl Clone for FunctionExpr
impl Clone for FunctionExpr
Source§fn clone(&self) -> FunctionExpr
fn clone(&self) -> FunctionExpr
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 FunctionExpr
impl Debug for FunctionExpr
impl Eq for FunctionExpr
Source§impl Hash for FunctionExpr
impl Hash for FunctionExpr
Source§impl PartialEq for FunctionExpr
impl PartialEq for FunctionExpr
impl StructuralPartialEq for FunctionExpr
Auto Trait Implementations§
impl !RefUnwindSafe for FunctionExpr
impl !Send for FunctionExpr
impl !Sync for FunctionExpr
impl !UnwindSafe for FunctionExpr
impl Freeze for FunctionExpr
impl Unpin for FunctionExpr
impl UnsafeUnpin for FunctionExpr
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