pub struct EnvironmentManager { /* private fields */ }
Expand description
Environment manager for handling multiple environments
Implementations§
Source§impl EnvironmentManager
impl EnvironmentManager
Sourcepub fn add_environment(&mut self, environment: Environment) -> EntityId
pub fn add_environment(&mut self, environment: Environment) -> EntityId
Add an environment
Sourcepub fn get_environment(&self, id: &EntityId) -> Option<&Environment>
pub fn get_environment(&self, id: &EntityId) -> Option<&Environment>
Get an environment by ID
Sourcepub fn get_environment_mut(&mut self, id: &EntityId) -> Option<&mut Environment>
pub fn get_environment_mut(&mut self, id: &EntityId) -> Option<&mut Environment>
Get a mutable environment by ID
Sourcepub fn remove_environment(
&mut self,
id: &EntityId,
) -> Result<Environment, String>
pub fn remove_environment( &mut self, id: &EntityId, ) -> Result<Environment, String>
Remove an environment
Sourcepub fn get_all_environments(&self) -> Vec<&Environment>
pub fn get_all_environments(&self) -> Vec<&Environment>
Get all environments
Sourcepub fn get_active_environment(&self) -> Option<&Environment>
pub fn get_active_environment(&self) -> Option<&Environment>
Get the active environment
Sourcepub fn set_active_environment(&mut self, id: EntityId) -> Result<(), String>
pub fn set_active_environment(&mut self, id: EntityId) -> Result<(), String>
Set the active environment
Sourcepub fn substitute_variables(&self, template: &str) -> VariableSubstitution
pub fn substitute_variables(&self, template: &str) -> VariableSubstitution
Substitute variables in a template string
Sourcepub fn validate_environment(
&self,
environment: &Environment,
) -> EnvironmentValidationResult
pub fn validate_environment( &self, environment: &Environment, ) -> EnvironmentValidationResult
Validate an environment
Sourcepub fn export_environment(
&self,
environment_id: &EntityId,
format: EnvironmentExportFormat,
) -> Result<String, String>
pub fn export_environment( &self, environment_id: &EntityId, format: EnvironmentExportFormat, ) -> Result<String, String>
Export environment to specified format
Sourcepub fn import_environment(
&mut self,
json_data: &str,
) -> Result<EntityId, String>
pub fn import_environment( &mut self, json_data: &str, ) -> Result<EntityId, String>
Import environment from JSON
Sourcepub fn get_stats(&self) -> EnvironmentStats
pub fn get_stats(&self) -> EnvironmentStats
Get environment statistics
Sourcepub fn find_environments_by_name(&self, name_query: &str) -> Vec<&Environment>
pub fn find_environments_by_name(&self, name_query: &str) -> Vec<&Environment>
Find environments by name
Sourcepub fn get_all_variables(&self) -> HashMap<String, String>
pub fn get_all_variables(&self) -> HashMap<String, String>
Get all variables across all environments
Trait Implementations§
Source§impl Clone for EnvironmentManager
impl Clone for EnvironmentManager
Source§fn clone(&self) -> EnvironmentManager
fn clone(&self) -> EnvironmentManager
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 EnvironmentManager
impl Debug for EnvironmentManager
Auto Trait Implementations§
impl Freeze for EnvironmentManager
impl RefUnwindSafe for EnvironmentManager
impl Send for EnvironmentManager
impl Sync for EnvironmentManager
impl Unpin for EnvironmentManager
impl UnwindSafe for EnvironmentManager
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