pub trait Events<T, V>where
T: Clone + IntoVal<Env, Val> + TryFromVal<Env, Val>,
V: Clone + IntoVal<Env, Val> + TryFromVal<Env, Val>,{
// Provided methods
fn on_request(_env: &Env, _topic: &T, _envelope: &Envelope) { ... }
fn on_sync_receive(_env: &Env, _topic: &T, _envelope: &Envelope, _data: &V) { ... }
fn on_async_receive(_env: &Env, _topic: &T, _envelope: &Envelope, _data: &V) { ... }
fn on_subscribe(_env: &Env, _topic: &T, _envelope: &Envelope) -> Option<V> { ... }
fn on_publish(
env: &Env,
_topic: &T,
_data: &V,
_publisher: &Address,
) -> Vec<Envelope> { ... }
}
Provided Methods§
fn on_request(_env: &Env, _topic: &T, _envelope: &Envelope)
fn on_sync_receive(_env: &Env, _topic: &T, _envelope: &Envelope, _data: &V)
fn on_async_receive(_env: &Env, _topic: &T, _envelope: &Envelope, _data: &V)
fn on_subscribe(_env: &Env, _topic: &T, _envelope: &Envelope) -> Option<V>
fn on_publish( env: &Env, _topic: &T, _data: &V, _publisher: &Address, ) -> Vec<Envelope>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.