pub struct ResourceManager {
pub providers: Arc<RwLock<HashMap<String, Arc<dyn ResourceProvider>>>>,
pub subscriptions: Arc<RwLock<HashMap<String, Vec<String>>>>,
pub capabilities: ResourceCapabilities,
/* private fields */
}
Fields§
§providers: Arc<RwLock<HashMap<String, Arc<dyn ResourceProvider>>>>
§subscriptions: Arc<RwLock<HashMap<String, Vec<String>>>>
§capabilities: ResourceCapabilities
Implementations§
Source§impl ResourceManager
impl ResourceManager
pub fn new(capabilities: ResourceCapabilities) -> Self
pub fn set_notification_sender(&mut self, sender: NotificationSender)
pub async fn register_provider( &self, scheme: String, provider: Arc<dyn ResourceProvider>, )
pub async fn list_resources( &self, cursor: Option<String>, ) -> Result<ListResourcesResponse, McpError>
pub async fn read_resource( &self, uri: &str, ) -> Result<ReadResourceResponse, McpError>
pub async fn list_templates(&self) -> Result<ListTemplatesResponse, McpError>
pub async fn subscribe( &self, client_id: String, uri: String, ) -> Result<(), McpError>
pub async fn unsubscribe( &self, client_id: &str, uri: &str, ) -> Result<(), McpError>
pub async fn notify_resource_updated(&self, uri: &str) -> Result<(), McpError>
pub async fn notify_list_changed(&self) -> Result<(), McpError>
Auto Trait Implementations§
impl Freeze for ResourceManager
impl !RefUnwindSafe for ResourceManager
impl Send for ResourceManager
impl Sync for ResourceManager
impl Unpin for ResourceManager
impl !UnwindSafe for ResourceManager
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