pub struct CachePlugin { /* private fields */ }
Expand description
Plugin for caching responses with TTL
Implementations§
Source§impl CachePlugin
impl CachePlugin
Sourcepub fn new(config: PluginConfig) -> Self
pub fn new(config: PluginConfig) -> Self
Create a new cache plugin
Trait Implementations§
Source§impl ClientPlugin for CachePlugin
impl ClientPlugin for CachePlugin
Source§fn description(&self) -> Option<&str>
fn description(&self) -> Option<&str>
Optional plugin description
Source§fn initialize<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 PluginContext,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn initialize<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 PluginContext,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Initialize the plugin Read more
Source§fn before_request<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 mut RequestContext,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn before_request<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 mut RequestContext,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Hook called before sending a request to the server Read more
Source§fn after_response<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 mut ResponseContext,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn after_response<'life0, 'life1, 'async_trait>(
&'life0 self,
context: &'life1 mut ResponseContext,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Hook called after receiving a response from the server Read more
Source§fn handle_custom<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
params: Option<Value>,
) -> Pin<Box<dyn Future<Output = PluginResult<Option<Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_custom<'life0, 'life1, 'async_trait>(
&'life0 self,
method: &'life1 str,
params: Option<Value>,
) -> Pin<Box<dyn Future<Output = PluginResult<Option<Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle custom methods not part of the standard MCP protocol Read more
Source§fn dependencies(&self) -> Vec<&str>
fn dependencies(&self) -> Vec<&str>
Plugin dependencies (other plugins that must be registered first)
Auto Trait Implementations§
impl Freeze for CachePlugin
impl RefUnwindSafe for CachePlugin
impl Send for CachePlugin
impl Sync for CachePlugin
impl Unpin for CachePlugin
impl UnwindSafe for CachePlugin
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