pub struct FunctionDef {
pub name: String,
pub visibility: Visibility,
pub mutability: Mutability,
pub modifiers: Vec<String>,
pub params: Vec<Param>,
pub return_params: Vec<Param>,
pub body: Vec<Statement>,
pub line: usize,
pub is_constructor: bool,
pub is_fallback: bool,
pub is_receive: bool,
}Expand description
A full function definition with parsed body.
Fields§
§name: String§visibility: Visibility§mutability: Mutability§modifiers: Vec<String>§params: Vec<Param>§return_params: Vec<Param>§body: Vec<Statement>§line: usize§is_constructor: bool§is_fallback: bool§is_receive: boolImplementations§
Source§impl FunctionDef
impl FunctionDef
Sourcepub fn modifies_state(&self) -> bool
pub fn modifies_state(&self) -> bool
Whether this function can modify state.
Sourcepub fn has_reentrancy_guard(&self) -> bool
pub fn has_reentrancy_guard(&self) -> bool
Whether this function has a reentrancy guard modifier.
Sourcepub fn has_access_control(&self, contract: &Contract) -> bool
pub fn has_access_control(&self, contract: &Contract) -> bool
Whether this function has any access-control modifiers.
Trait Implementations§
Source§impl Clone for FunctionDef
impl Clone for FunctionDef
Source§fn clone(&self) -> FunctionDef
fn clone(&self) -> FunctionDef
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FunctionDef
impl RefUnwindSafe for FunctionDef
impl Send for FunctionDef
impl Sync for FunctionDef
impl Unpin for FunctionDef
impl UnsafeUnpin for FunctionDef
impl UnwindSafe for FunctionDef
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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