pub struct ComponentConfig {
pub component_id: String,
pub component_type: String,
pub parameters: HashMap<String, ConfigValue>,
pub environment: HashMap<String, String>,
pub resources: ResourceConstraints,
pub features: HashMap<String, bool>,
}Expand description
Component configuration
Fields§
§component_id: StringComponent identifier
component_type: StringComponent type
parameters: HashMap<String, ConfigValue>Configuration parameters
environment: HashMap<String, String>Environment-specific settings
resources: ResourceConstraintsResource constraints
features: HashMap<String, bool>Feature flags
Implementations§
Source§impl ComponentConfig
impl ComponentConfig
Sourcepub fn new(component_id: &str, component_type: &str) -> Self
pub fn new(component_id: &str, component_type: &str) -> Self
Create a new component configuration
Sourcepub fn with_parameter(self, key: &str, value: ConfigValue) -> Self
pub fn with_parameter(self, key: &str, value: ConfigValue) -> Self
Add a configuration parameter
Sourcepub fn with_environment(self, key: &str, value: &str) -> Self
pub fn with_environment(self, key: &str, value: &str) -> Self
Add an environment variable
Sourcepub fn with_resources(self, resources: ResourceConstraints) -> Self
pub fn with_resources(self, resources: ResourceConstraints) -> Self
Set resource constraints
Sourcepub fn with_feature(self, feature: &str, enabled: bool) -> Self
pub fn with_feature(self, feature: &str, enabled: bool) -> Self
Add a feature flag
Sourcepub fn get_parameter(&self, key: &str) -> Option<&ConfigValue>
pub fn get_parameter(&self, key: &str) -> Option<&ConfigValue>
Get parameter value
Sourcepub fn get_environment(&self, key: &str) -> Option<&str>
pub fn get_environment(&self, key: &str) -> Option<&str>
Get environment variable
Sourcepub fn is_feature_enabled(&self, feature: &str) -> bool
pub fn is_feature_enabled(&self, feature: &str) -> bool
Check if feature is enabled
Trait Implementations§
Source§impl Clone for ComponentConfig
impl Clone for ComponentConfig
Source§fn clone(&self) -> ComponentConfig
fn clone(&self) -> ComponentConfig
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 ComponentConfig
impl Debug for ComponentConfig
Source§impl<'de> Deserialize<'de> for ComponentConfig
impl<'de> Deserialize<'de> for ComponentConfig
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 ComponentConfig
impl RefUnwindSafe for ComponentConfig
impl Send for ComponentConfig
impl Sync for ComponentConfig
impl Unpin for ComponentConfig
impl UnwindSafe for ComponentConfig
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> 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