pub struct Resource {
pub resource_id: String,
pub name: String,
pub resource_type: ResourceType,
pub department: Option<String>,
pub role: Option<String>,
pub is_active: bool,
pub capabilities: Vec<String>,
pub cost_per_hour: Option<f64>,
}Expand description
Resource (user or system) that performs activities.
Fields§
§resource_id: StringUnique resource identifier
name: StringHuman-readable name
resource_type: ResourceTypeType of resource
department: Option<String>Department (for users)
role: Option<String>Role (for users)
is_active: boolIs the resource currently active
capabilities: Vec<String>Activity types this resource can perform
cost_per_hour: Option<f64>Cost per hour (for workload analysis)
Implementations§
Source§impl Resource
impl Resource
Sourcepub fn with_department(self, department: &str) -> Self
pub fn with_department(self, department: &str) -> Self
Set the department.
Sourcepub fn with_capabilities(self, capabilities: Vec<&str>) -> Self
pub fn with_capabilities(self, capabilities: Vec<&str>) -> Self
Add capabilities.
Sourcepub fn can_perform(&self, activity_id: &str) -> bool
pub fn can_perform(&self, activity_id: &str) -> bool
Check if this resource can perform an activity.
Sourcepub fn erp_system() -> Self
pub fn erp_system() -> Self
Create a standard ERP system resource.
Sourcepub fn workflow_system() -> Self
pub fn workflow_system() -> Self
Create a standard workflow system resource.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Resource
impl<'de> Deserialize<'de> for Resource
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 Resource
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnwindSafe for Resource
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