pub trait Deployer: Sized {
// Required methods
fn deploy<T>(env: &HostEnv, init_args: T) -> Self
where T: InitArgs;
fn try_deploy<T>(env: &HostEnv, init_args: T) -> Result<Self, OdraError>
where T: InitArgs;
}
Expand description
A type which can deploy a contract.
Before any interaction with the contract, it must be deployed, either on a virtual machine or on a real blockchain.
The Deployer
trait provides a simple way to deploy a contract.
Required Methods§
sourcefn deploy<T>(env: &HostEnv, init_args: T) -> Selfwhere
T: InitArgs,
fn deploy<T>(env: &HostEnv, init_args: T) -> Selfwhere
T: InitArgs,
Deploys a contract with given init args.
If the init args are provided, the contract is deployed and initialized by calling the constructor. If the init args are not provided, the contract is deployed without initialization.
Returns a host reference to the deployed contract.
Object Safety§
This trait is not object safe.