pub trait Contract<T, Q = Empty>where
    T: Clone + Debug + PartialEq + JsonSchema,
    Q: CustomQuery,{
    // Required methods
    fn execute(
        &self,
        deps: DepsMut<'_, Q>,
        env: Env,
        info: MessageInfo,
        msg: Vec<u8>
    ) -> AnyResult<Response<T>>;
    fn instantiate(
        &self,
        deps: DepsMut<'_, Q>,
        env: Env,
        info: MessageInfo,
        msg: Vec<u8>
    ) -> AnyResult<Response<T>>;
    fn query(
        &self,
        deps: Deps<'_, Q>,
        env: Env,
        msg: Vec<u8>
    ) -> AnyResult<Binary>;
    fn sudo(
        &self,
        deps: DepsMut<'_, Q>,
        env: Env,
        msg: Vec<u8>
    ) -> AnyResult<Response<T>>;
    fn reply(
        &self,
        deps: DepsMut<'_, Q>,
        env: Env,
        msg: Reply
    ) -> AnyResult<Response<T>>;
    fn migrate(
        &self,
        deps: DepsMut<'_, Q>,
        env: Env,
        msg: Vec<u8>
    ) -> AnyResult<Response<T>>;
}
Expand description

Interface to call into a Contract.

Required Methods§

source

fn execute( &self, deps: DepsMut<'_, Q>, env: Env, info: MessageInfo, msg: Vec<u8> ) -> AnyResult<Response<T>>

source

fn instantiate( &self, deps: DepsMut<'_, Q>, env: Env, info: MessageInfo, msg: Vec<u8> ) -> AnyResult<Response<T>>

source

fn query(&self, deps: Deps<'_, Q>, env: Env, msg: Vec<u8>) -> AnyResult<Binary>

source

fn sudo( &self, deps: DepsMut<'_, Q>, env: Env, msg: Vec<u8> ) -> AnyResult<Response<T>>

source

fn reply( &self, deps: DepsMut<'_, Q>, env: Env, msg: Reply ) -> AnyResult<Response<T>>

source

fn migrate( &self, deps: DepsMut<'_, Q>, env: Env, msg: Vec<u8> ) -> AnyResult<Response<T>>

Implementors§

source§

impl<T1, T2, T3, E1, E2, E3, C, T4, E4, E5, T6, E6, Q> Contract<C, Q> for ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, T4, E4, E5, T6, E6>where T1: DeserializeOwned + Debug + Clone, T2: DeserializeOwned + Debug + Clone, T3: DeserializeOwned + Debug + Clone, T4: DeserializeOwned, T6: DeserializeOwned, E1: Display + Debug + Send + Sync + Error + 'static, E2: Display + Debug + Send + Sync + Error + 'static, E3: Display + Debug + Send + Sync + Error + 'static, E4: Display + Debug + Send + Sync + 'static, E5: Display + Debug + Send + Sync + 'static, E6: Display + Debug + Send + Sync + 'static, C: Clone + Debug + PartialEq + JsonSchema, Q: CustomQuery + DeserializeOwned,