pub struct Environment {
pub id: EntityId,
pub name: String,
pub description: Option<String>,
pub color: Option<EnvironmentColor>,
pub variables: HashMap<String, String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub order: i32,
pub sharable: bool,
}
Expand description
Environment for managing variable collections
Fields§
§id: EntityId
Unique identifier
name: String
Human-readable name
description: Option<String>
Optional description
color: Option<EnvironmentColor>
Color for visual distinction in UI
variables: HashMap<String, String>
Environment variables
created_at: DateTime<Utc>
Creation timestamp
updated_at: DateTime<Utc>
Last modification timestamp
order: i32
Display order for UI sorting (lower numbers appear first)
sharable: bool
Whether this environment can be shared/synced
Implementations§
Source§impl Environment
impl Environment
Sourcepub fn new_global() -> Self
pub fn new_global() -> Self
Create a new global environment
Sourcepub fn set_variable(&mut self, key: String, value: String)
pub fn set_variable(&mut self, key: String, value: String)
Add or update a variable
Sourcepub fn remove_variable(&mut self, key: &str) -> bool
pub fn remove_variable(&mut self, key: &str) -> bool
Remove a variable
Sourcepub fn get_variable(&self, key: &str) -> Option<&String>
pub fn get_variable(&self, key: &str) -> Option<&String>
Get a variable value
Sourcepub fn set_color(&mut self, color: EnvironmentColor)
pub fn set_color(&mut self, color: EnvironmentColor)
Set the environment color
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Source§fn clone(&self) -> Environment
fn clone(&self) -> Environment
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 Environment
impl Debug for Environment
Source§impl<'de> Deserialize<'de> for Environment
impl<'de> Deserialize<'de> for Environment
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 Environment
impl RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl UnwindSafe for Environment
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