pub trait SamplingHandler: Send + Sync {
// Required method
fn handle<'life0, 'async_trait>(
&'life0 self,
request: CreateMessageRequest,
ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<CreateMessageResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided method
fn sampling_capabilities(&self) -> SamplingCapabilities { ... }
}
Expand description
Sampling handler trait for processing sampling requests
Required Methods§
Sourcefn handle<'life0, 'async_trait>(
&'life0 self,
request: CreateMessageRequest,
ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<CreateMessageResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle<'life0, 'async_trait>(
&'life0 self,
request: CreateMessageRequest,
ctx: RequestContext,
) -> Pin<Box<dyn Future<Output = ServerResult<CreateMessageResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a sampling request
Provided Methods§
Sourcefn sampling_capabilities(&self) -> SamplingCapabilities
fn sampling_capabilities(&self) -> SamplingCapabilities
Get supported sampling capabilities