Struct boot_core::ContractWrapper
source · pub struct ContractWrapper<T1, T2, T3, E1, E2, E3, C = Empty, Q = Empty, T4 = Empty, E4 = Error, E5 = Error, T6 = Empty, E6 = Error>where
T1: DeserializeOwned + Debug,
T2: DeserializeOwned,
T3: DeserializeOwned,
T4: DeserializeOwned,
T6: DeserializeOwned,
E1: Display + Debug + Send + Sync + 'static,
E2: Display + Debug + Send + Sync + 'static,
E3: Display + Debug + Send + Sync + 'static,
E4: Display + Debug + Send + Sync + 'static,
E5: Display + Debug + Send + Sync + 'static,
E6: Display + Debug + Send + Sync + 'static,
C: Clone + Debug + PartialEq<C> + JsonSchema,
Q: CustomQuery + DeserializeOwned + 'static,{ /* private fields */ }
Expand description
Wraps the exported functions from a contract and provides the normalized format Place T4 and E4 at the end, as we just want default placeholders for most contracts that don’t have sudo
Implementations§
source§impl<T1, T2, T3, E1, E2, E3, C, Q> ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, Empty, Error, Error, Empty, Error>where
T1: DeserializeOwned + Debug + 'static,
T2: DeserializeOwned + 'static,
T3: DeserializeOwned + 'static,
E1: Display + Debug + Send + Sync + 'static,
E2: Display + Debug + Send + Sync + 'static,
E3: Display + Debug + Send + Sync + 'static,
C: Clone + Debug + PartialEq<C> + JsonSchema + 'static,
Q: CustomQuery + DeserializeOwned + 'static,
impl<T1, T2, T3, E1, E2, E3, C, Q> ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, Empty, Error, Error, Empty, Error>where T1: DeserializeOwned + Debug + 'static, T2: DeserializeOwned + 'static, T3: DeserializeOwned + 'static, E1: Display + Debug + Send + Sync + 'static, E2: Display + Debug + Send + Sync + 'static, E3: Display + Debug + Send + Sync + 'static, C: Clone + Debug + PartialEq<C> + JsonSchema + 'static, Q: CustomQuery + DeserializeOwned + 'static,
pub fn new( execute_fn: fn(_: DepsMut<'_, Q>, _: Env, _: MessageInfo, _: T1) -> Result<Response<C>, E1>, instantiate_fn: fn(_: DepsMut<'_, Q>, _: Env, _: MessageInfo, _: T2) -> Result<Response<C>, E2>, query_fn: fn(_: Deps<'_, Q>, _: Env, _: T3) -> Result<Binary, E3> ) -> ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, Empty, Error, Error, Empty, Error>
sourcepub fn new_with_empty(
execute_fn: fn(_: DepsMut<'_, Empty>, _: Env, _: MessageInfo, _: T1) -> Result<Response<Empty>, E1>,
instantiate_fn: fn(_: DepsMut<'_, Empty>, _: Env, _: MessageInfo, _: T2) -> Result<Response<Empty>, E2>,
query_fn: fn(_: Deps<'_, Empty>, _: Env, _: T3) -> Result<Binary, E3>
) -> ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, Empty, Error, Error, Empty, Error>
pub fn new_with_empty( execute_fn: fn(_: DepsMut<'_, Empty>, _: Env, _: MessageInfo, _: T1) -> Result<Response<Empty>, E1>, instantiate_fn: fn(_: DepsMut<'_, Empty>, _: Env, _: MessageInfo, _: T2) -> Result<Response<Empty>, E2>, query_fn: fn(_: Deps<'_, Empty>, _: Env, _: T3) -> Result<Binary, E3> ) -> ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, Empty, Error, Error, Empty, Error>
this will take a contract that returns Response
source§impl<T1, T2, T3, E1, E2, E3, C, Q, T4, E4, E5, T6, E6> ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, T4, E4, E5, T6, E6>where
T1: DeserializeOwned + Debug + 'static,
T2: DeserializeOwned + 'static,
T3: DeserializeOwned + 'static,
T4: DeserializeOwned + 'static,
T6: DeserializeOwned + 'static,
E1: Display + Debug + Send + Sync + 'static,
E2: Display + Debug + Send + Sync + 'static,
E3: Display + Debug + Send + Sync + 'static,
E4: Display + Debug + Send + Sync + 'static,
E5: Display + Debug + Send + Sync + 'static,
E6: Display + Debug + Send + Sync + 'static,
C: Clone + Debug + PartialEq<C> + JsonSchema + 'static,
Q: CustomQuery + DeserializeOwned + 'static,
impl<T1, T2, T3, E1, E2, E3, C, Q, T4, E4, E5, T6, E6> ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, T4, E4, E5, T6, E6>where T1: DeserializeOwned + Debug + 'static, T2: DeserializeOwned + 'static, T3: DeserializeOwned + 'static, T4: DeserializeOwned + 'static, T6: DeserializeOwned + 'static, E1: Display + Debug + Send + Sync + 'static, E2: Display + Debug + Send + Sync + 'static, E3: Display + Debug + Send + Sync + 'static, E4: Display + Debug + Send + Sync + 'static, E5: Display + Debug + Send + Sync + 'static, E6: Display + Debug + Send + Sync + 'static, C: Clone + Debug + PartialEq<C> + JsonSchema + 'static, Q: CustomQuery + DeserializeOwned + 'static,
pub fn with_sudo<T4A, E4A>( self, sudo_fn: fn(_: DepsMut<'_, Q>, _: Env, _: T4A) -> Result<Response<C>, E4A> ) -> ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, T4A, E4A, E5, T6, E6>where T4A: DeserializeOwned + 'static, E4A: Display + Debug + Send + Sync + 'static,
pub fn with_sudo_empty<T4A, E4A>( self, sudo_fn: fn(_: DepsMut<'_, Q>, _: Env, _: T4A) -> Result<Response<Empty>, E4A> ) -> ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, T4A, E4A, E5, T6, E6>where T4A: DeserializeOwned + 'static, E4A: Display + Debug + Send + Sync + 'static,
pub fn with_reply<E5A>( self, reply_fn: fn(_: DepsMut<'_, Q>, _: Env, _: Reply) -> Result<Response<C>, E5A> ) -> ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, T4, E4, E5A, T6, E6>where E5A: Display + Debug + Send + Sync + 'static,
sourcepub fn with_reply_empty<E5A>(
self,
reply_fn: fn(_: DepsMut<'_, Q>, _: Env, _: Reply) -> Result<Response<Empty>, E5A>
) -> ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, T4, E4, E5A, T6, E6>where
E5A: Display + Debug + Send + Sync + 'static,
pub fn with_reply_empty<E5A>( self, reply_fn: fn(_: DepsMut<'_, Q>, _: Env, _: Reply) -> Result<Response<Empty>, E5A> ) -> ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, T4, E4, E5A, T6, E6>where E5A: Display + Debug + Send + Sync + 'static,
A correlate of new_with_empty
pub fn with_migrate<T6A, E6A>( self, migrate_fn: fn(_: DepsMut<'_, Q>, _: Env, _: T6A) -> Result<Response<C>, E6A> ) -> ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, T4, E4, E5, T6A, E6A>where T6A: DeserializeOwned + 'static, E6A: Display + Debug + Send + Sync + 'static,
pub fn with_migrate_empty<T6A, E6A>( self, migrate_fn: fn(_: DepsMut<'_, Q>, _: Env, _: T6A) -> Result<Response<Empty>, E6A> ) -> ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, T4, E4, E5, T6A, E6A>where T6A: DeserializeOwned + 'static, E6A: Display + Debug + Send + Sync + 'static,
Trait Implementations§
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<C> + JsonSchema,
Q: CustomQuery + DeserializeOwned,
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<C> + JsonSchema, Q: CustomQuery + DeserializeOwned,
fn execute( &self, deps: DepsMut<'_, Q>, env: Env, info: MessageInfo, msg: Vec<u8, Global> ) -> Result<Response<C>, Error>
fn instantiate( &self, deps: DepsMut<'_, Q>, env: Env, info: MessageInfo, msg: Vec<u8, Global> ) -> Result<Response<C>, Error>
fn query( &self, deps: Deps<'_, Q>, env: Env, msg: Vec<u8, Global> ) -> Result<Binary, Error>
fn sudo( &self, deps: DepsMut<'_, Q>, env: Env, msg: Vec<u8, Global> ) -> Result<Response<C>, Error>
fn reply( &self, deps: DepsMut<'_, Q>, env: Env, reply_data: Reply ) -> Result<Response<C>, Error>
fn migrate( &self, deps: DepsMut<'_, Q>, env: Env, msg: Vec<u8, Global> ) -> Result<Response<C>, Error>
Auto Trait Implementations§
impl<T1, T2, T3, E1, E2, E3, C = Empty, Q = Empty, T4 = Empty, E4 = Error, E5 = Error, T6 = Empty, E6 = Error> !RefUnwindSafe for ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, T4, E4, E5, T6, E6>
impl<T1, T2, T3, E1, E2, E3, C = Empty, Q = Empty, T4 = Empty, E4 = Error, E5 = Error, T6 = Empty, E6 = Error> !Send for ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, T4, E4, E5, T6, E6>
impl<T1, T2, T3, E1, E2, E3, C = Empty, Q = Empty, T4 = Empty, E4 = Error, E5 = Error, T6 = Empty, E6 = Error> !Sync for ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, T4, E4, E5, T6, E6>
impl<T1, T2, T3, E1, E2, E3, C, Q, T4, E4, E5, T6, E6> Unpin for ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, T4, E4, E5, T6, E6>
impl<T1, T2, T3, E1, E2, E3, C = Empty, Q = Empty, T4 = Empty, E4 = Error, E5 = Error, T6 = Empty, E6 = Error> !UnwindSafe for ContractWrapper<T1, T2, T3, E1, E2, E3, C, Q, T4, E4, E5, T6, E6>
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request