Struct full_moon::ast::FunctionDeclaration
source · pub struct FunctionDeclaration { /* private fields */ }
Expand description
A normal function declaration, supports simple declarations like function x() end
as well as complicated declarations such as function x.y.z:a() end
Implementations§
source§impl FunctionDeclaration
impl FunctionDeclaration
sourcepub fn new(name: FunctionName) -> Self
pub fn new(name: FunctionName) -> Self
Creates a new FunctionDeclaration from the given name
sourcepub fn function_token(&self) -> &TokenReference
pub fn function_token(&self) -> &TokenReference
The function
token
sourcepub fn body(&self) -> &FunctionBody
pub fn body(&self) -> &FunctionBody
The body of the function
sourcepub fn name(&self) -> &FunctionName
pub fn name(&self) -> &FunctionName
The name of the function
sourcepub fn with_function_token(self, function_token: TokenReference) -> Self
pub fn with_function_token(self, function_token: TokenReference) -> Self
Returns a new FunctionDeclaration with the given function
token
sourcepub fn with_name(self, name: FunctionName) -> Self
pub fn with_name(self, name: FunctionName) -> Self
Returns a new FunctionDeclaration with the given function name
sourcepub fn with_body(self, body: FunctionBody) -> Self
pub fn with_body(self, body: FunctionBody) -> Self
Returns a new FunctionDeclaration with the given function body
Trait Implementations§
source§impl Clone for FunctionDeclaration
impl Clone for FunctionDeclaration
source§fn clone(&self) -> FunctionDeclaration
fn clone(&self) -> FunctionDeclaration
Returns a copy of the value. Read more
1.0.0 · 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 FunctionDeclaration
impl Debug for FunctionDeclaration
source§impl<'de> Deserialize<'de> for FunctionDeclaration
impl<'de> Deserialize<'de> for FunctionDeclaration
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for FunctionDeclaration
impl Display for FunctionDeclaration
source§impl Node for FunctionDeclaration
impl Node for FunctionDeclaration
source§fn start_position(&self) -> Option<Position>
fn start_position(&self) -> Option<Position>
The start position of a node. None if can’t be determined
source§fn end_position(&self) -> Option<Position>
fn end_position(&self) -> Option<Position>
The end position of a node. None if it can’t be determined
source§fn similar(&self, other: &Self) -> bool
fn similar(&self, other: &Self) -> bool
Whether another node of the same type is the same as this one semantically, ignoring position
source§impl PartialEq for FunctionDeclaration
impl PartialEq for FunctionDeclaration
source§fn eq(&self, other: &FunctionDeclaration) -> bool
fn eq(&self, other: &FunctionDeclaration) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for FunctionDeclaration
impl Serialize for FunctionDeclaration
impl StructuralPartialEq for FunctionDeclaration
Auto Trait Implementations§
impl RefUnwindSafe for FunctionDeclaration
impl Send for FunctionDeclaration
impl Sync for FunctionDeclaration
impl Unpin for FunctionDeclaration
impl UnwindSafe for FunctionDeclaration
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