pub struct LocalFunction {
pub attributes: Vec<Attribute>,
pub local_keyword: Token,
pub function_keyword: Token,
pub function_name: Token,
pub generics: Option<Pointer<GenericDeclaration>>,
pub parameters: BracketedList<Parameter>,
pub colon: Option<Pointer<Token>>,
pub return_type: Option<Pointer<TypeValue>>,
pub body: Block,
pub end_keyword: Token,
}Expand description
A struct representing a local function.
Fields§
§attributes: Vec<Attribute>Attributes before the function.
local_keyword: TokenThe local keyword.
function_keyword: TokenThe function keyword.
function_name: TokenThe name of the function.
generics: Option<Pointer<GenericDeclaration>>The generics of the function.
parameters: BracketedList<Parameter>The parameters that this function accepts.
colon: Option<Pointer<Token>>The : character between closing parenthesis and returns.
return_type: Option<Pointer<TypeValue>>The return type of the function
body: BlockThe body of the function.
end_keyword: TokenThe end keyword.
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 GetRange for LocalFunction
impl GetRange for LocalFunction
Source§impl Hash for LocalFunction
impl Hash for LocalFunction
Source§impl Ord for LocalFunction
impl Ord for LocalFunction
Source§fn cmp(&self, other: &LocalFunction) -> Ordering
fn cmp(&self, other: &LocalFunction) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl Parse for LocalFunction
impl Parse for LocalFunction
Source§impl PartialEq for LocalFunction
impl PartialEq for LocalFunction
Source§impl PartialOrd for LocalFunction
impl PartialOrd for LocalFunction
Source§impl Print for LocalFunction
impl Print for LocalFunction
Source§fn print_final_trivia(&self) -> String
fn print_final_trivia(&self) -> String
Prints only the very final trivia. Used for the default implementation of
Print::print, which just joins Print::print_without_final_trivia
and this function.Source§fn print_without_final_trivia(&self) -> String
fn print_without_final_trivia(&self) -> String
Prints the whole token including all surrounding trivia, excluding the
very last trailing trivia.
Source§impl TryParse for LocalFunction
impl TryParse for LocalFunction
impl Eq 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