pub struct VyperFunction {
pub name: String,
pub decorators: Vec<VyperDecorator>,
pub params: Vec<VyperParam>,
pub return_ty: Option<VyperType>,
pub body: Vec<VyperStmt>,
pub doc: Option<String>,
}Expand description
A Vyper function definition.
Fields§
§name: String§decorators: Vec<VyperDecorator>§params: Vec<VyperParam>§return_ty: Option<VyperType>§body: Vec<VyperStmt>§doc: Option<String>Implementations§
Source§impl VyperFunction
impl VyperFunction
pub fn new(name: impl Into<String>) -> Self
pub fn external(self) -> Self
pub fn internal(self) -> Self
pub fn view(self) -> Self
pub fn pure_fn(self) -> Self
pub fn payable(self) -> Self
pub fn nonreentrant(self, key: impl Into<String>) -> Self
Sourcepub fn abi_signature(&self) -> String
pub fn abi_signature(&self) -> String
ABI signature for selector computation.
Sourcepub fn is_external(&self) -> bool
pub fn is_external(&self) -> bool
Returns true if this function is @external.
Sourcepub fn is_read_only(&self) -> bool
pub fn is_read_only(&self) -> bool
Returns true if this function is @view or @pure.
Trait Implementations§
Source§impl Clone for VyperFunction
impl Clone for VyperFunction
Source§fn clone(&self) -> VyperFunction
fn clone(&self) -> VyperFunction
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 moreAuto Trait Implementations§
impl Freeze for VyperFunction
impl RefUnwindSafe for VyperFunction
impl Send for VyperFunction
impl Sync for VyperFunction
impl Unpin for VyperFunction
impl UnsafeUnpin for VyperFunction
impl UnwindSafe for VyperFunction
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