Trait oasis_contract_sdk::contract::Contract
source · pub trait Contract {
type Request: Decode;
type Response: Encode;
type Error: Error;
// Required methods
fn call<C: Context>(
ctx: &mut C,
request: Self::Request,
) -> Result<Self::Response, Self::Error>;
fn query<C: Context>(
_ctx: &mut C,
_request: Self::Request,
) -> Result<Self::Response, Self::Error>;
// Provided methods
fn instantiate<C: Context>(
_ctx: &mut C,
_request: Self::Request,
) -> Result<(), Self::Error> { ... }
fn handle_reply<C: Context>(
_ctx: &mut C,
_reply: Reply,
) -> Result<Option<Self::Response>, Self::Error> { ... }
fn pre_upgrade<C: Context>(
_ctx: &mut C,
_request: Self::Request,
) -> Result<(), Self::Error> { ... }
fn post_upgrade<C: Context>(
_ctx: &mut C,
_request: Self::Request,
) -> Result<(), Self::Error> { ... }
}
Expand description
Trait that needs to be implemented by contract implementations.
Required Associated Types§
Required Methods§
Provided Methods§
sourcefn instantiate<C: Context>(
_ctx: &mut C,
_request: Self::Request,
) -> Result<(), Self::Error>
fn instantiate<C: Context>( _ctx: &mut C, _request: Self::Request, ) -> Result<(), Self::Error>
Instantiate the contract.
sourcefn handle_reply<C: Context>(
_ctx: &mut C,
_reply: Reply,
) -> Result<Option<Self::Response>, Self::Error>
fn handle_reply<C: Context>( _ctx: &mut C, _reply: Reply, ) -> Result<Option<Self::Response>, Self::Error>
Handle replies from sent messages.
Object Safety§
This trait is not object safe.