pub struct Task {
pub description: String,
pub base_cost: u64,
pub min_capacity: u32,
}Expand description
Task descriptor with energy requirements.
Fields§
§description: StringTask identifier/description.
base_cost: u64Base energy cost to execute this task.
min_capacity: u32Minimum capacity required (affected by accumulated damage).
Implementations§
Source§impl Task
impl Task
Sourcepub fn new(description: String, base_cost: u64) -> Self
pub fn new(description: String, base_cost: u64) -> Self
Create new task with description and base cost.
Sourcepub fn with_capacity(
description: String,
base_cost: u64,
min_capacity: u32,
) -> Self
pub fn with_capacity( description: String, base_cost: u64, min_capacity: u32, ) -> Self
Create task requiring minimum capacity.
Sourcepub fn actual_cost(&self, damage_score: u32) -> u64
pub fn actual_cost(&self, damage_score: u32) -> u64
Calculate actual energy cost including damage penalty.
CONSEQUENCE: Accumulated damage increases energy cost. More scars = higher cost for same task.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Task
impl RefUnwindSafe for Task
impl Send for Task
impl Sync for Task
impl Unpin for Task
impl UnsafeUnpin for Task
impl UnwindSafe for Task
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