pub struct DefaultAdvancedSamplingHandler { /* private fields */ }Expand description
Default implementation of advanced sampling features
Implementations§
Source§impl DefaultAdvancedSamplingHandler
impl DefaultAdvancedSamplingHandler
pub fn new(server_info: ServerInfo) -> Self
pub fn with_tools(self, tools: Vec<ToolContextInfo>) -> Self
pub fn with_resources(self, resources: Vec<ResourceContextInfo>) -> Self
Trait Implementations§
Source§impl AdvancedSamplingHandler for DefaultAdvancedSamplingHandler
impl AdvancedSamplingHandler for DefaultAdvancedSamplingHandler
Source§fn collect_context<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
include_context: &'life1 IncludeContext,
_request: &'life2 SamplingRequest,
) -> Pin<Box<dyn Future<Output = MCPResult<Option<SamplingContext>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn collect_context<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
include_context: &'life1 IncludeContext,
_request: &'life2 SamplingRequest,
) -> Pin<Box<dyn Future<Output = MCPResult<Option<SamplingContext>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Collect context information for sampling requests
Source§fn handle_human_approval<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 SamplingRequest,
_response: &'life2 SamplingResponse,
) -> Pin<Box<dyn Future<Output = MCPResult<ApprovalStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn handle_human_approval<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 SamplingRequest,
_response: &'life2 SamplingResponse,
) -> Pin<Box<dyn Future<Output = MCPResult<ApprovalStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Handle human-in-the-loop approval workflow
Source§fn process_human_feedback<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_request: &'life1 SamplingRequest,
feedback: &'life2 HumanFeedback,
) -> Pin<Box<dyn Future<Output = MCPResult<SamplingResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn process_human_feedback<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_request: &'life1 SamplingRequest,
feedback: &'life2 HumanFeedback,
) -> Pin<Box<dyn Future<Output = MCPResult<SamplingResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Process human feedback and modifications
Source§fn estimate_cost<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 SamplingRequest,
) -> Pin<Box<dyn Future<Output = MCPResult<CostInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn estimate_cost<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 SamplingRequest,
) -> Pin<Box<dyn Future<Output = MCPResult<CostInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Estimate cost for sampling request
Source§fn validate_sampling_request<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 SamplingRequest,
) -> Pin<Box<dyn Future<Output = MCPResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn validate_sampling_request<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 SamplingRequest,
) -> Pin<Box<dyn Future<Output = MCPResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Validate sampling request with advanced checks
Auto Trait Implementations§
impl Freeze for DefaultAdvancedSamplingHandler
impl RefUnwindSafe for DefaultAdvancedSamplingHandler
impl Send for DefaultAdvancedSamplingHandler
impl Sync for DefaultAdvancedSamplingHandler
impl Unpin for DefaultAdvancedSamplingHandler
impl UnwindSafe for DefaultAdvancedSamplingHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more