pub struct Constructor {
masm: MacroAssembler,
}
Expand description
Contract constructor.
Fields§
§masm: MacroAssembler
Code generator.
Implementations§
Source§impl Constructor
impl Constructor
Sourcepub fn storage(&mut self, mapping: InitStorage) -> Result<()>
pub fn storage(&mut self, mapping: InitStorage) -> Result<()>
preset storage for the contract
Sourcepub fn finish(&self, runtime_bytecode: Buffer) -> Result<Buffer>
pub fn finish(&self, runtime_bytecode: Buffer) -> Result<Buffer>
Concat the constructor code.
Here we override the memory totally with the runtime bytecode.
Sourcefn runtime_bytcode_offset(
init_code_len: usize,
runtime_bytecode_size_len: usize,
) -> usize
fn runtime_bytcode_offset( init_code_len: usize, runtime_bytecode_size_len: usize, ) -> usize
Returns the offset of runtime bytecode.
[
init_code,
pushn, runtime_bytecode_size, pushn +
Trait Implementations§
Source§impl Clone for Constructor
impl Clone for Constructor
Source§fn clone(&self) -> Constructor
fn clone(&self) -> Constructor
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 Debug for Constructor
impl Debug for Constructor
Source§impl Default for Constructor
impl Default for Constructor
Source§fn default() -> Constructor
fn default() -> Constructor
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Constructor
impl RefUnwindSafe for Constructor
impl Send for Constructor
impl Sync for Constructor
impl Unpin for Constructor
impl UnwindSafe for Constructor
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