pub trait ResourceDefinition:
Debug
+ Send
+ Sync
+ 'static
+ Serialize
+ Deserialize {
// Required methods
fn resource_type() -> ResourceType
where Self: Sized;
fn get_resource_type(&self) -> ResourceType;
fn id(&self) -> &str;
fn get_dependencies(&self) -> Vec<ResourceRef>;
fn validate_update(&self, new_config: &dyn ResourceDefinition) -> Result<()>;
fn as_any(&self) -> &dyn Any;
fn as_any_mut(&mut self) -> &mut dyn Any;
fn box_clone(&self) -> Box<dyn ResourceDefinition>;
fn resource_eq(&self, other: &dyn ResourceDefinition) -> bool;
// Provided method
fn get_permissions(&self) -> Option<&str> { ... }
}Expand description
Trait that defines the interface for all resource types in the Alien system. This trait enables extensibility by allowing new resource types to be registered and managed alongside built-in resources.
Required Methods§
Sourcefn resource_type() -> ResourceTypewhere
Self: Sized,
fn resource_type() -> ResourceTypewhere
Self: Sized,
Returns the static type identifier for this resource type (e.g., “Function”, “Storage”)
Sourcefn get_resource_type(&self) -> ResourceType
fn get_resource_type(&self) -> ResourceType
Returns the resource type for this instance (calls the static method)
Sourcefn get_dependencies(&self) -> Vec<ResourceRef>
fn get_dependencies(&self) -> Vec<ResourceRef>
Returns the list of other resources this resource depends on
Sourcefn validate_update(&self, new_config: &dyn ResourceDefinition) -> Result<()>
fn validate_update(&self, new_config: &dyn ResourceDefinition) -> Result<()>
Validates if an update from the current configuration to a new configuration is allowed
Sourcefn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Provides mutable access to the underlying concrete type for downcasting
Sourcefn box_clone(&self) -> Box<dyn ResourceDefinition>
fn box_clone(&self) -> Box<dyn ResourceDefinition>
Creates a boxed clone of this resource definition
Sourcefn resource_eq(&self, other: &dyn ResourceDefinition) -> bool
fn resource_eq(&self, other: &dyn ResourceDefinition) -> bool
For equality comparison between resource definitions
Provided Methods§
Sourcefn get_permissions(&self) -> Option<&str>
fn get_permissions(&self) -> Option<&str>
Returns the permission profile name for this resource, if it has one.
Used by ServiceAccountDependenciesMutation to wire the corresponding
{profile}-sa service account as a declared dependency so the executor
enforces ordering and propagates SA changes automatically.
Override in concrete types that carry a permissions field (Container, Function).
Trait Implementations§
Source§impl Clone for Box<dyn ResourceDefinition>
Clone implementation for boxed ResourceDefinition trait objects
impl Clone for Box<dyn ResourceDefinition>
Clone implementation for boxed ResourceDefinition trait objects