pub struct GlobalFunction {
pub attributes: Vec<Attribute>,
pub function_keyword: Token,
pub function_name: GlobalFunctionName,
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.
function_keyword: TokenThe function keyword.
function_name: GlobalFunctionNameThe 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 GlobalFunction
impl Clone for GlobalFunction
Source§fn clone(&self) -> GlobalFunction
fn clone(&self) -> GlobalFunction
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 GlobalFunction
impl Debug for GlobalFunction
Source§impl GetRange for GlobalFunction
impl GetRange for GlobalFunction
Source§impl Hash for GlobalFunction
impl Hash for GlobalFunction
Source§impl Ord for GlobalFunction
impl Ord for GlobalFunction
Source§fn cmp(&self, other: &GlobalFunction) -> Ordering
fn cmp(&self, other: &GlobalFunction) -> 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 GlobalFunction
impl Parse for GlobalFunction
Source§impl PartialEq for GlobalFunction
impl PartialEq for GlobalFunction
Source§impl PartialOrd for GlobalFunction
impl PartialOrd for GlobalFunction
Source§impl Print for GlobalFunction
impl Print for GlobalFunction
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 GlobalFunction
impl TryParse for GlobalFunction
impl Eq for GlobalFunction
impl StructuralPartialEq for GlobalFunction
Auto Trait Implementations§
impl Freeze for GlobalFunction
impl RefUnwindSafe for GlobalFunction
impl !Send for GlobalFunction
impl !Sync for GlobalFunction
impl Unpin for GlobalFunction
impl UnwindSafe for GlobalFunction
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