Struct solang_parser::pt::FunctionDefinition
source · pub struct FunctionDefinition {
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: Loc
The code location.
ty: FunctionTy
The function type.
name: Option<Identifier>
The optional identifier.
This can be None
for old style fallback functions.
name_loc: Loc
The identifier’s code location.
params: ParameterList
The 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: ParameterList
The 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 copy 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
source§fn eq(&self, other: &FunctionDefinition) -> bool
fn eq(&self, other: &FunctionDefinition) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for FunctionDefinition
impl StructuralEq for FunctionDefinition
impl StructuralPartialEq for FunctionDefinition
Auto Trait Implementations§
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