SamplingExt

Trait SamplingExt 

Source
pub trait SamplingExt {
    // Required methods
    fn create_message<'life0, 'async_trait>(
        &'life0 self,
        request: CreateMessageRequest,
    ) -> Pin<Box<dyn Future<Output = ServerResult<CreateMessageResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn elicit<'life0, 'async_trait>(
        &'life0 self,
        request: ElicitRequest,
    ) -> Pin<Box<dyn Future<Output = ServerResult<ElicitResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_roots<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ServerResult<ListRootsResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Extension trait for RequestContext to provide sampling capabilities

Note: We use async-trait to address the async fn in trait warning

Required Methods§

Source

fn create_message<'life0, 'async_trait>( &'life0 self, request: CreateMessageRequest, ) -> Pin<Box<dyn Future<Output = ServerResult<CreateMessageResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a sampling/createMessage request to the client

Source

fn elicit<'life0, 'async_trait>( &'life0 self, request: ElicitRequest, ) -> Pin<Box<dyn Future<Output = ServerResult<ElicitResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send an elicitation request to the client for user input

Source

fn list_roots<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ServerResult<ListRootsResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List client’s root capabilities

Implementors§