pub struct ContractBuilder { /* private fields */ }
Implementations§
Source§impl ContractBuilder
impl ContractBuilder
pub fn new(name: String, is_abstract: bool) -> Self
pub fn build(self) -> ContractDefinition
pub fn inherits(&mut self, name: impl Into<String>) -> &mut Self
pub fn inherits_with_args( &mut self, name: impl Into<String>, args: Vec<Expression>, ) -> &mut Self
pub fn state_variable( &mut self, type_name: TypeName, name: impl Into<String>, visibility: Option<Visibility>, initial_value: Option<Expression>, ) -> &mut Self
pub fn constant_variable( &mut self, type_name: TypeName, name: impl Into<String>, initial_value: Expression, ) -> &mut Self
pub fn function<F>(
&mut self,
name: impl Into<String>,
build_function: F,
) -> &mut Selfwhere
F: FnOnce(&mut FunctionBuilder),
pub fn constructor<F>(&mut self, build_constructor: F) -> &mut Selfwhere
F: FnOnce(&mut ConstructorBuilder),
pub fn modifier<F>(
&mut self,
name: impl Into<String>,
build_modifier: F,
) -> &mut Selfwhere
F: FnOnce(&mut ModifierBuilder),
pub fn event<F>(&mut self, name: impl Into<String>, build_event: F) -> &mut Selfwhere
F: FnOnce(&mut EventBuilder),
pub fn error<F>(&mut self, name: impl Into<String>, build_error: F) -> &mut Selfwhere
F: FnOnce(&mut ErrorBuilder),
pub fn struct_def<F>(
&mut self,
name: impl Into<String>,
build_struct: F,
) -> &mut Selfwhere
F: FnOnce(&mut StructBuilder),
pub fn enum_def( &mut self, name: impl Into<String>, values: Vec<impl Into<String>>, ) -> &mut Self
Trait Implementations§
Source§impl Clone for ContractBuilder
impl Clone for ContractBuilder
Source§fn clone(&self) -> ContractBuilder
fn clone(&self) -> ContractBuilder
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 ContractBuilder
impl RefUnwindSafe for ContractBuilder
impl Send for ContractBuilder
impl Sync for ContractBuilder
impl Unpin for ContractBuilder
impl UnwindSafe for ContractBuilder
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