pub trait ContextProvider:
Send
+ Sync
+ 'static {
type Context: JsonSchema + Serialize + LLMSafe + Send + Sync + 'static;
const NAME: &'static str;
const SCOPE: TemporalScope;
// Required method
fn context<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ContextRequest,
) -> Pin<Box<dyn Future<Output = Result<Self::Context, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn subscribe(&self) -> Option<Receiver<()>> { ... }
}Required Associated Constants§
Sourceconst SCOPE: TemporalScope
const SCOPE: TemporalScope
The dimension this context belongs to
Required Associated Types§
Required Methods§
Sourcefn context<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ContextRequest,
) -> Pin<Box<dyn Future<Output = Result<Self::Context, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn context<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ContextRequest,
) -> Pin<Box<dyn Future<Output = Result<Self::Context, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Provide the JSON-serializable context view, filtered associatively via ContextRequest
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".