pub struct AnonymousFunction { /* private fields */ }Expand description
An anonymous function, such as function() end
Implementations§
Source§impl AnonymousFunction
impl AnonymousFunction
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 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 function in function(a, b, c) call() 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 AnonymousFunction with the given attributes (e.g. @native)
Sourcepub fn with_function_token(self, function_token: TokenReference) -> Self
pub fn with_function_token(self, function_token: TokenReference) -> Self
Returns a new AnonymousFunction with the given function token
Sourcepub fn with_body(self, body: FunctionBody) -> Self
pub fn with_body(self, body: FunctionBody) -> Self
Returns a new AnonymousFunction with the given function body
Trait Implementations§
Source§impl Clone for AnonymousFunction
impl Clone for AnonymousFunction
Source§fn clone(&self) -> AnonymousFunction
fn clone(&self) -> AnonymousFunction
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 AnonymousFunction
impl Debug for AnonymousFunction
Source§impl Default for AnonymousFunction
impl Default for AnonymousFunction
Source§impl<'de> Deserialize<'de> for AnonymousFunction
impl<'de> Deserialize<'de> for AnonymousFunction
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 AnonymousFunction
impl Display for AnonymousFunction
Source§impl Node for AnonymousFunction
impl Node for AnonymousFunction
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 AnonymousFunction
impl PartialEq for AnonymousFunction
Source§impl Serialize for AnonymousFunction
impl Serialize for AnonymousFunction
impl StructuralPartialEq for AnonymousFunction
Auto Trait Implementations§
impl Freeze for AnonymousFunction
impl RefUnwindSafe for AnonymousFunction
impl Send for AnonymousFunction
impl Sync for AnonymousFunction
impl Unpin for AnonymousFunction
impl UnsafeUnpin for AnonymousFunction
impl UnwindSafe for AnonymousFunction
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