pub trait CallbackHandler: Send + Sync {
// Required methods
fn handle<'life0, 'async_trait>(
&'life0 self,
payload: CallbackPayload,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn name(&self) -> &str;
fn is_enabled_for(&self, event_type: CallbackEventType) -> bool;
}Expand description
Callback handler trait.
Required Methods§
Sourcefn handle<'life0, 'async_trait>(
&'life0 self,
payload: CallbackPayload,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle<'life0, 'async_trait>(
&'life0 self,
payload: CallbackPayload,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a callback event.
Sourcefn is_enabled_for(&self, event_type: CallbackEventType) -> bool
fn is_enabled_for(&self, event_type: CallbackEventType) -> bool
Check if the handler is enabled for an event type.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".