pub struct Tour { /* private fields */ }Expand description
Represents a tour, a smart container for jobs with their associated activities.
Implementations§
source§impl Tour
impl Tour
sourcepub fn new(actor: &Actor) -> Self
pub fn new(actor: &Actor) -> Self
Creates a new tour with start and optional end using actor properties.
sourcepub fn insert_last(&mut self, activity: Activity) -> &mut Tour
pub fn insert_last(&mut self, activity: Activity) -> &mut Tour
Inserts activity within its job to the end of tour.
sourcepub fn insert_at(&mut self, activity: Activity, index: usize) -> &mut Tour
pub fn insert_at(&mut self, activity: Activity, index: usize) -> &mut Tour
Inserts activity within its job at specified index.
sourcepub fn remove_activity_at(&mut self, idx: usize) -> Job
pub fn remove_activity_at(&mut self, idx: usize) -> Job
Removes activity and its job from the tour.
sourcepub fn all_activities(&self) -> Iter<'_, Activity>
pub fn all_activities(&self) -> Iter<'_, Activity>
Returns all activities in tour.
sourcepub fn activities_slice(&self, start: usize, end: usize) -> &[Activity]
pub fn activities_slice(&self, start: usize, end: usize) -> &[Activity]
Returns activities slice in specific range (all inclusive).
sourcepub fn all_activities_mut(&mut self) -> IterMut<'_, Activity>
pub fn all_activities_mut(&mut self) -> IterMut<'_, Activity>
Returns all activities in tour as mutable.
sourcepub fn job_activities<'a>(
&'a self,
job: &'a Job
) -> impl Iterator<Item = &Activity> + 'a
pub fn job_activities<'a>(
&'a self,
job: &'a Job
) -> impl Iterator<Item = &Activity> + 'a
Returns all activities in tour for specific job.
sourcepub fn get_mut(&mut self, index: usize) -> Option<&mut Activity>
pub fn get_mut(&mut self, index: usize) -> Option<&mut Activity>
Returns mutable activity by its index in tour.
sourcepub fn index(&self, job: &Job) -> Option<usize>
pub fn index(&self, job: &Job) -> Option<usize>
Returns index of first job occurrence in the tour.
sourcepub fn job_activity_count(&self) -> usize
pub fn job_activity_count(&self) -> usize
Returns total amount of job activities.