pub struct CliEnvEntries {
pub global: BTreeMap<String, EnvValue>,
pub per_server: BTreeMap<String, BTreeMap<String, EnvValue>>,
}Expand description
Parsed --env entries, split into global and per-server maps.
Fields§
§global: BTreeMap<String, EnvValue>KEY=VALUE entries applied to every MCP server.
per_server: BTreeMap<String, BTreeMap<String, EnvValue>>SERVER:KEY=VALUE entries keyed by server name.
Implementations§
Source§impl CliEnvEntries
impl CliEnvEntries
Sourcepub fn parse(raw: &[String]) -> Result<Self, CliEnvParseError>
pub fn parse(raw: &[String]) -> Result<Self, CliEnvParseError>
Parse raw --env strings into classified entries.
Within a scope (global or per-server), last-wins for duplicate keys – entries are inserted in order, so later values replace earlier ones.
Sourcepub fn for_server(&self, name: &str) -> BTreeMap<String, EnvValue>
pub fn for_server(&self, name: &str) -> BTreeMap<String, EnvValue>
Produce the merged env overlay for a specific server: global entries with per-server entries layered on top (per-server wins on conflict).
Sourcepub fn per_server_names(&self) -> impl Iterator<Item = &str>
pub fn per_server_names(&self) -> impl Iterator<Item = &str>
Return the set of server names referenced in per-server entries.
Trait Implementations§
Source§impl Clone for CliEnvEntries
impl Clone for CliEnvEntries
Source§fn clone(&self) -> CliEnvEntries
fn clone(&self) -> CliEnvEntries
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 CliEnvEntries
impl Debug for CliEnvEntries
Source§impl Default for CliEnvEntries
impl Default for CliEnvEntries
Source§fn default() -> CliEnvEntries
fn default() -> CliEnvEntries
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CliEnvEntries
impl RefUnwindSafe for CliEnvEntries
impl Send for CliEnvEntries
impl Sync for CliEnvEntries
impl Unpin for CliEnvEntries
impl UnsafeUnpin for CliEnvEntries
impl UnwindSafe for CliEnvEntries
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