Struct full_moon::ast::LocalFunction
source · pub struct LocalFunction { /* private fields */ }
Expand description
A declaration of a local function, such as local function x() end
Implementations§
source§impl LocalFunction
impl LocalFunction
sourcepub fn new(name: TokenReference) -> Self
pub fn new(name: TokenReference) -> Self
Returns a new LocalFunction from the given name
sourcepub fn local_token(&self) -> &TokenReference
pub fn local_token(&self) -> &TokenReference
The local
token
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 function body, everything except local function x
in local function x(a, b, c) call() end
sourcepub fn name(&self) -> &TokenReference
pub fn name(&self) -> &TokenReference
The name of the function, the x
part of local function x() end
sourcepub fn with_local_token(self, local_token: TokenReference) -> Self
pub fn with_local_token(self, local_token: TokenReference) -> Self
Returns a new LocalFunction with the given local
token
sourcepub fn with_function_token(self, function_token: TokenReference) -> Self
pub fn with_function_token(self, function_token: TokenReference) -> Self
Returns a new LocalFunction with the given function
token
sourcepub fn with_name(self, name: TokenReference) -> Self
pub fn with_name(self, name: TokenReference) -> Self
Returns a new LocalFunction with the given name
sourcepub fn with_body(self, body: FunctionBody) -> Self
pub fn with_body(self, body: FunctionBody) -> Self
Returns a new LocalFunction with the given function body
Trait Implementations§
source§impl Clone for LocalFunction
impl Clone for LocalFunction
source§fn clone(&self) -> LocalFunction
fn clone(&self) -> LocalFunction
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 LocalFunction
impl Debug for LocalFunction
source§impl<'de> Deserialize<'de> for LocalFunction
impl<'de> Deserialize<'de> for LocalFunction
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 LocalFunction
impl Display for LocalFunction
source§impl Node for LocalFunction
impl Node for LocalFunction
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 LocalFunction
impl PartialEq for LocalFunction
source§fn eq(&self, other: &LocalFunction) -> bool
fn eq(&self, other: &LocalFunction) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for LocalFunction
impl Serialize for LocalFunction
impl StructuralPartialEq for LocalFunction
Auto Trait Implementations§
impl RefUnwindSafe for LocalFunction
impl Send for LocalFunction
impl Sync for LocalFunction
impl Unpin for LocalFunction
impl UnwindSafe for LocalFunction
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