pub struct MultiAppConfig {
pub version: u32,
pub apps: HashMap<String, ProviderManager>,
pub mcp: McpRoot,
pub prompts: PromptRoot,
pub skills: SkillStore,
pub common_config_snippets: CommonConfigSnippets,
pub claude_common_config_snippet: Option<String>,
}Expand description
多应用配置结构(向后兼容)
Fields§
§version: u32§apps: HashMap<String, ProviderManager>应用管理器(claude/codex)
mcp: McpRootMCP 配置(按客户端分治)
prompts: PromptRootPrompt 配置(按客户端分治)
skills: SkillStoreClaude Skills 配置
common_config_snippets: CommonConfigSnippets通用配置片段(按应用分治)
claude_common_config_snippet: Option<String>Claude 通用配置片段(旧字段,用于向后兼容迁移)
Implementations§
Source§impl MultiAppConfig
impl MultiAppConfig
Sourcepub fn get_manager(&self, app: &AppType) -> Option<&ProviderManager>
pub fn get_manager(&self, app: &AppType) -> Option<&ProviderManager>
获取指定应用的管理器
Sourcepub fn get_manager_mut(&mut self, app: &AppType) -> Option<&mut ProviderManager>
pub fn get_manager_mut(&mut self, app: &AppType) -> Option<&mut ProviderManager>
获取指定应用的管理器(可变引用)
Sourcepub fn ensure_app(&mut self, app: &AppType)
pub fn ensure_app(&mut self, app: &AppType)
确保应用存在
Sourcepub fn mcp_for_mut(&mut self, app: &AppType) -> &mut McpConfig
pub fn mcp_for_mut(&mut self, app: &AppType) -> &mut McpConfig
获取指定客户端的 MCP 配置(可变引用)
Sourcepub fn migrate_mcp_to_unified(&mut self) -> Result<bool, AppError>
pub fn migrate_mcp_to_unified(&mut self) -> Result<bool, AppError>
将 v3.6.x 的分应用 MCP 结构迁移到 v3.7.0 的统一结构
迁移策略:
- 检查是否已经迁移(mcp.servers 是否存在)
- 收集所有应用的 MCP,按 ID 去重合并
- 生成统一的 McpServer 结构,标记应用到哪些客户端
- 清空旧的分应用配置
Trait Implementations§
Source§impl Clone for MultiAppConfig
impl Clone for MultiAppConfig
Source§fn clone(&self) -> MultiAppConfig
fn clone(&self) -> MultiAppConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MultiAppConfig
impl Debug for MultiAppConfig
Source§impl Default for MultiAppConfig
impl Default for MultiAppConfig
Source§impl<'de> Deserialize<'de> for MultiAppConfig
impl<'de> Deserialize<'de> for MultiAppConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MultiAppConfig
impl RefUnwindSafe for MultiAppConfig
impl Send for MultiAppConfig
impl Sync for MultiAppConfig
impl Unpin for MultiAppConfig
impl UnsafeUnpin for MultiAppConfig
impl UnwindSafe for MultiAppConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more