pub struct ResourceTimeline {
pub resource_id: ResourceId,
pub capacity: f32,
pub usage: HashMap<NaiveDate, DayUsage>,
}Expand description
Timeline of resource usage
Fields§
§resource_id: ResourceId§capacity: f32§usage: HashMap<NaiveDate, DayUsage>Usage by date
Implementations§
Source§impl ResourceTimeline
impl ResourceTimeline
pub fn new(resource_id: ResourceId, capacity: f32) -> Self
Sourcepub fn add_usage(
&mut self,
task_id: &TaskId,
start: NaiveDate,
finish: NaiveDate,
units: f32,
)
pub fn add_usage( &mut self, task_id: &TaskId, start: NaiveDate, finish: NaiveDate, units: f32, )
Add usage for a task over a date range
Sourcepub fn remove_usage(&mut self, task_id: &TaskId)
pub fn remove_usage(&mut self, task_id: &TaskId)
Remove usage for a task
Sourcepub fn is_overallocated(&self, date: NaiveDate) -> bool
pub fn is_overallocated(&self, date: NaiveDate) -> bool
Check if over-allocated on a specific date
Sourcepub fn overallocated_periods(&self) -> Vec<OverallocationPeriod>
pub fn overallocated_periods(&self) -> Vec<OverallocationPeriod>
Get all over-allocated periods
Trait Implementations§
Source§impl Clone for ResourceTimeline
impl Clone for ResourceTimeline
Source§fn clone(&self) -> ResourceTimeline
fn clone(&self) -> ResourceTimeline
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 moreAuto Trait Implementations§
impl Freeze for ResourceTimeline
impl RefUnwindSafe for ResourceTimeline
impl Send for ResourceTimeline
impl Sync for ResourceTimeline
impl Unpin for ResourceTimeline
impl UnwindSafe for ResourceTimeline
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