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
sourceimpl 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
sourceimpl Clone for LocalFunction
impl Clone for LocalFunction
sourcefn clone(&self) -> LocalFunction
fn clone(&self) -> LocalFunction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for LocalFunction
impl Debug for LocalFunction
sourceimpl<'de> Deserialize<'de> for LocalFunction
impl<'de> Deserialize<'de> for LocalFunction
sourcefn 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
sourceimpl Display for LocalFunction
impl Display for LocalFunction
sourceimpl Node for LocalFunction
impl Node for LocalFunction
sourcefn start_position(&self) -> Option<Position>
fn start_position(&self) -> Option<Position>
The start position of a node. None if can’t be determined
sourcefn end_position(&self) -> Option<Position>
fn end_position(&self) -> Option<Position>
The end position of a node. None if it can’t be determined
sourcefn 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
sourcefn tokens<'a>(&'a self) -> Tokens<'a>ⓘNotable traits for Tokens<'a>impl<'a> Iterator for Tokens<'a> type Item = &'a TokenReference;
fn tokens<'a>(&'a self) -> Tokens<'a>ⓘNotable traits for Tokens<'a>impl<'a> Iterator for Tokens<'a> type Item = &'a TokenReference;
The token references that comprise a node
sourceimpl PartialEq<LocalFunction> for LocalFunction
impl PartialEq<LocalFunction> for LocalFunction
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &LocalFunction) -> bool
fn ne(&self, other: &LocalFunction) -> bool
This method tests for !=
.
sourceimpl 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more