pub trait EncHandler: MaybeSendSync {
// Required method
fn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
client: Arc<Client>,
enc_node: &'life1 Node,
info: &'life2 MessageInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Trait for handling custom encrypted message types.
Mirrors the wasm-portability convention of the sibling extension points
(EventHandler, SendContextResolver): the MaybeSendSync supertrait keeps the
Send + Sync requirement on native (the client stores Arc<dyn EncHandler>
across receive lanes) while dropping it on wasm32, where the client is !Send
and a handler may hold !Send JS handles.
Required Methods§
Sourcefn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
client: Arc<Client>,
enc_node: &'life1 Node,
info: &'life2 MessageInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
client: Arc<Client>,
enc_node: &'life1 Node,
info: &'life2 MessageInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".