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 attributes(&self) -> impl Iterator<Item = &LuauAttribute>
Available on crate feature luau
only.
pub fn attributes(&self) -> impl Iterator<Item = &LuauAttribute>
luau
only.The attributes in the function, e.g. @native
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_attributes(self, attributes: Vec<LuauAttribute>) -> Self
Available on crate feature luau
only.
pub fn with_attributes(self, attributes: Vec<LuauAttribute>) -> Self
luau
only.Returns a new LocalFunction with the given attributes (e.g. @native
)
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 duplicate 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§impl Serialize for LocalFunction
impl Serialize for LocalFunction
impl StructuralPartialEq for LocalFunction
Auto Trait Implementations§
impl Freeze for LocalFunction
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