pub trait OriginalMessageResolver: Send + Sync {
// Required method
fn resolve_msg_secret<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
chat: &'life1 str,
sender: &'life2 str,
msg_id: &'life3 str,
) -> Pin<Box<dyn Future<Output = Option<[u8; 32]>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait;
}Expand description
App-supplied fallback returning a parent message’s 32-byte messageSecret
on a store miss, keyed by the non-AD (chat, sender, msg_id).
Lets an app that keeps its own message store own secret retention entirely
(the secret rides on the stored message and is read back on demand), and is
what makes the MsgSecretPolicy::Disabled tier able to decrypt add-ons
whose parent the core never persisted. Consulted only after the in-core
store and LID/PN alternate lookups miss.
The call is run under a bounded timeout (configurable, default 5s) because it executes inside the per-chat receive lane; an implementation that blocks past the bound is treated as a miss, so keep it fast or internally bounded.
The Send + Sync bound is dropped on wasm32 (single-threaded), so a
resolver there may be backed by !Send JS handles; native builds keep it
because the resolver is shared across the multi-threaded receive lanes.
Required Methods§
fn resolve_msg_secret<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
chat: &'life1 str,
sender: &'life2 str,
msg_id: &'life3 str,
) -> Pin<Box<dyn Future<Output = Option<[u8; 32]>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".