pub fn do_init<T, U>(
    init_fn: &dyn Fn(
        &mut Extern<ExternalStorage, ExternalApi, ExternalQuerier>,
        Env,
        T,
    ) -> InitResult<U>,
    env_ptr: u32,
    msg_ptr: u32,
) -> u32
where
    T: DeserializeOwned + JsonSchema,
    U: Serialize + Clone + fmt::Debug + PartialEq + JsonSchema,
{
    let res: InitResult<U> = _do_init(init_fn, env_ptr as *mut Region, msg_ptr as *mut Region);
    let v = to_vec(&res).unwrap();
    release_buffer(v) as u32
}
/// do_init should be wrapped in an external "C" export, containing a contract-specific function as arg
do_init should be wrapped in an external "C" export, containing a contract-specific function as arg
do_init should be wrapped in an external " C " export containing a contract - specific function as arg
pub fn do_init<T, U>(
    init_fn: &dyn Fn(
        &mut Extern<ExternalStorage, ExternalApi, ExternalQuerier>,
        Env,
        T,
    ) -> InitResult<U>,
    env_ptr: u32,
    msg_ptr: u32,
) -> u32
where
    T: DeserializeOwned + JsonSchema,
    U: Serialize + Clone + fmt::Debug + PartialEq + JsonSchema,
{
    let res: InitResult<U> = _do_init(init_fn, env_ptr as *mut Region, msg_ptr as *mut Region);
    let v = to_vec(&res).unwrap();
    release_buffer(v) as u32
}
pub fn do_init < T , U > ( init_fn : & dyn Fn ( & mut Extern < ExternalStorage , ExternalApi , ExternalQuerier > , Env , T , ) -> InitResult < U > , env_ptr : u32 , msg_ptr : u32 , ) -> u32 where T : DeserializeOwned + JsonSchema , U : Serialize + Clone + fmt :: Debug + PartialEq + JsonSchema , { let res : InitResult < U > = _do_init ( init_fn , env_ptr as * mut Region , msg_ptr as * mut Region ) ; let v = to_vec ( & res ) . unwrap ( ) ; release_buffer ( v ) as u32 }
do_init should be wrapped in an external "C" export, containing a contract-specific function as arg
do_init should be wrapped in an external " C " export containing a contract - specific function as arg
init_fn
&dyn Fn(
        &mut Extern<ExternalStorage, ExternalApi, ExternalQuerier>,
        Env,
        T,
    ) -> InitResult<U>
env_ptr
u32
msg_ptr
u32
init_fn
&dyn Fn(
        &mut Extern<ExternalStorage, ExternalApi, ExternalQuerier>,
        Env,
        T,
    ) -> InitResult<U>
env_ptr
u32
msg_ptr
u32