pub struct McpEnvironment {
pub variables: HashMap<String, String>,
pub sources: Vec<EnvironmentSource>,
pub snapshot: Option<HashMap<String, String>>,
}Fields§
§variables: HashMap<String, String>§sources: Vec<EnvironmentSource>§snapshot: Option<HashMap<String, String>>Implementations§
Source§impl McpEnvironment
impl McpEnvironment
pub fn new() -> Self
pub fn with_process_env() -> Self
pub fn load_process_env(&mut self)
pub fn load_env_file<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
pub fn set_server_config( &mut self, config_name: String, vars: HashMap<String, String>, )
pub fn set_custom(&mut self, vars: HashMap<String, String>)
pub fn get(&self, key: &str) -> Option<&String>
pub fn set(&mut self, key: String, value: String)
Sourcepub fn create_snapshot(&mut self)
pub fn create_snapshot(&mut self)
Create a snapshot of the current environment state
Sourcepub fn restore_from_snapshot(&mut self) -> Result<()>
pub fn restore_from_snapshot(&mut self) -> Result<()>
Restore environment from snapshot
Sourcepub fn clear_snapshot(&mut self)
pub fn clear_snapshot(&mut self)
Clear the snapshot
Sourcepub fn get_environment_info(&self) -> HashMap<String, String>
pub fn get_environment_info(&self) -> HashMap<String, String>
Get environment info for MCP introspection
pub fn expand_variables(&self, text: &str) -> Result<String>
Trait Implementations§
Source§impl Clone for McpEnvironment
impl Clone for McpEnvironment
Source§fn clone(&self) -> McpEnvironment
fn clone(&self) -> McpEnvironment
Returns a duplicate of the value. Read more
1.0.0 · 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 McpEnvironment
impl Debug for McpEnvironment
Auto Trait Implementations§
impl Freeze for McpEnvironment
impl RefUnwindSafe for McpEnvironment
impl Send for McpEnvironment
impl Sync for McpEnvironment
impl Unpin for McpEnvironment
impl UnwindSafe for McpEnvironment
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