mcprotocol_rs/client_features/
roots.rs1use async_trait::async_trait;
2use serde::{Deserialize, Serialize};
3use serde_json::Value;
4
5use crate::Result;
6
7#[derive(Debug, Clone, Serialize, Deserialize)]
9pub struct Root {
10 pub path: String,
12 pub name: Option<String>,
14 pub include_pattern: Option<String>,
16 pub exclude_pattern: Option<String>,
18}
19
20#[async_trait]
22pub trait RootManager: Send + Sync {
23 fn list_roots(&self) -> Vec<Root>;
25
26 fn add_root(&mut self, root: Root) -> Result<()>;
28
29 fn remove_root(&mut self, path: &str) -> Result<()>;
31
32 async fn get_context(&self, path: &str) -> Result<Value>;
34}