Struct zingen::Constructor
source · pub struct Constructor {
pub masm: MacroAssembler,
pub init_code: Buffer,
pub runtime_bytecode: Buffer,
}
Expand description
Contract constructor.
§Bytecode
CREATE
instructionINIT_CODE
INIT_LOGIC
RETURN RUNTIME_BYTECODE
RUNTIME_BYTECODE
TODO: introduce ABI for constructor
Fields§
§masm: MacroAssembler
Code generator.
init_code: Buffer
Code buffer.
runtime_bytecode: Buffer
Runtime bytecode.
Implementations§
source§impl Constructor
impl Constructor
sourcepub fn new(
constructor: Option<FuncType>,
runtime_bytecode: Buffer
) -> Result<Self>
pub fn new( constructor: Option<FuncType>, runtime_bytecode: Buffer ) -> Result<Self>
Create a new constructor.
sourcepub fn finish(&mut self) -> Result<Buffer>
pub fn finish(&mut self) -> Result<Buffer>
Concat the constructor code.
Here we override the memory totally with the runtime bytecode.
sourcefn return_instr_length(
init_code_length: usize,
runtime_bytecode_length: usize
) -> usize
fn return_instr_length( init_code_length: usize, runtime_bytecode_length: usize ) -> usize
Returns the length of instructions.
Auto Trait Implementations§
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