pub trait CodeExt {
// Required methods
fn code_deploy(
&mut self,
method_context: MethodContext,
contract: Address,
code: &VariableBytes<MAX_CODE_SIZE>,
) -> Result<Address, ContractError>;
fn code_store(
&mut self,
method_context: MethodContext,
contract: Address,
contract_code: &Address,
new_code: &VariableBytes<MAX_CODE_SIZE>,
) -> Result<(), ContractError>;
fn code_read(
&self,
contract: Address,
contract_code: &Address,
code: &mut VariableBytes<MAX_CODE_SIZE>,
) -> Result<(), ContractError>;
}Expand description
Required Methods§
Sourcefn code_deploy(
&mut self,
method_context: MethodContext,
contract: Address,
code: &VariableBytes<MAX_CODE_SIZE>,
) -> Result<Address, ContractError>
fn code_deploy( &mut self, method_context: MethodContext, contract: Address, code: &VariableBytes<MAX_CODE_SIZE>, ) -> Result<Address, ContractError>
Deploy a new contract with specified code
Sourcefn code_store(
&mut self,
method_context: MethodContext,
contract: Address,
contract_code: &Address,
new_code: &VariableBytes<MAX_CODE_SIZE>,
) -> Result<(), ContractError>
fn code_store( &mut self, method_context: MethodContext, contract: Address, contract_code: &Address, new_code: &VariableBytes<MAX_CODE_SIZE>, ) -> Result<(), ContractError>
Store contact’s code overriding previous code that might have been there.
Updates can only be done by the contract itself with direct calls.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".