pub trait ContextContributor: Send + Sync {
// Required methods
fn source_pack(&self) -> &'static str;
fn contribute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 ContextRequest,
token: &'life2 NamespaceToken,
) -> Pin<Box<dyn Future<Output = Result<Vec<ContextSlice>, RuntimeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Optional object-safe context source implemented by a pack.
Implementations must honor the supplied namespace token, return owned records, and release
all read snapshots before returning. budget_hint is advisory for the entire assembly;
it is not a per-contributor allocation. Returned scores keep their source-local semantics.
Required Methods§
Sourcefn source_pack(&self) -> &'static str
fn source_pack(&self) -> &'static str
Stable pack metadata used to attribute this source.
fn contribute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
req: &'life1 ContextRequest,
token: &'life2 NamespaceToken,
) -> Pin<Box<dyn Future<Output = Result<Vec<ContextSlice>, RuntimeError>> + 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".