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§
Sourcefn 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 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
Sourcefn 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 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
Sourcefn list_roots<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ServerResult<ListRootsResult>> + 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,
List client’s root capabilities