pub struct FunctionDefinition {
pub loc_prototype: Loc,
pub loc: Loc,
pub ty: FunctionTy,
pub name: Option<Identifier>,
pub name_loc: Loc,
pub params: ParameterList,
pub attributes: Vec<FunctionAttribute>,
pub return_not_returns: Option<Loc>,
pub returns: ParameterList,
pub body: Option<Statement>,
}Expand description
A function definition.
<ty> [name](<params>,*) [attributes] [returns] [body]
Fields§
§loc_prototype: LocThe function prototype location.
loc: LocThe code location.
ty: FunctionTyThe function type.
name: Option<Identifier>The optional identifier.
This can be None for old style fallback functions.
name_loc: LocThe identifier’s code location.
params: ParameterListThe parameter list.
attributes: Vec<FunctionAttribute>The function attributes.
return_not_returns: Option<Loc>The returns keyword’s location. Some if this was return, not returns.
returns: ParameterListThe return parameter list.
body: Option<Statement>The function body.
If None, the declaration ended with a semicolon.
Implementations§
Trait Implementations§
Source§impl Clone for FunctionDefinition
impl Clone for FunctionDefinition
Source§fn clone(&self) -> FunctionDefinition
fn clone(&self) -> FunctionDefinition
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 CodeLocation for FunctionDefinition
impl CodeLocation for FunctionDefinition
Source§impl Debug for FunctionDefinition
impl Debug for FunctionDefinition
Source§impl Display for FunctionDefinition
impl Display for FunctionDefinition
Source§impl PartialEq for FunctionDefinition
impl PartialEq for FunctionDefinition
impl Eq for FunctionDefinition
impl StructuralPartialEq for FunctionDefinition
Auto Trait Implementations§
impl Freeze for FunctionDefinition
impl RefUnwindSafe for FunctionDefinition
impl Send for FunctionDefinition
impl Sync for FunctionDefinition
impl Unpin for FunctionDefinition
impl UnwindSafe for FunctionDefinition
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more