pub(crate) fn schedule(
        start: DateTime<Utc>,
        tasks_per_segment: impl IntoIterator<Item = (impl TimeSegment, impl IntoIterator<Item = TaskT>)>,
        strategy: SchedulingStrategy,
    ) -> Result<Schedule<TaskT>, Error<TaskT>>
    where
        TaskT: Task,
    {
        tasks_per_segment
            .into_iter()
            .map(|(segment, tasks)| {
                Schedule::schedule_within_segment(start, tasks, segment, strategy)
            })
            .fold(
                Ok(Schedule::default()),
                |acc_schedule, new_schedule| match (acc_schedule, new_schedule) {
                    (Err(error), _) => Err(error),
                    (_, Err(error)) => Err(error),
                    (Ok(acc_schedule), Ok(new_schedule)) => Ok(Schedule(
                        itertools::merge(acc_schedule.0, new_schedule.0).collect_vec(),
                    )),
                },
            )
    }
/// Schedules tasks according to the given strategy, using the tasks'
/// deadlines, importance and duration.
///
/// Args:
///     start: the moment when the first task can be scheduled
///     tasks: iterable of tasks to schedule
///     strategy: the scheduling algorithm to use
///     time_segment: the time segment to schedule the tasks within
/// Returns when successful an instance of Schedule which contains all
/// tasks, each bound to a certain date and time; returns None when not all
/// tasks could be scheduled.
Schedules tasks according to the given strategy, using the tasks'
deadlines, importance and duration.

the moment when the first task can be scheduled
tasks: iterable of tasks to schedule
strategy: the scheduling algorithm to use
time_segment: the time segment to schedule the tasks within
Returns when successful an instance of Schedule which contains all
tasks, each bound to a certain date and time; returns None when not all
tasks could be scheduled.
Schedules tasks according to the given strategy using the tasks ' deadlines importance and duration . the moment when the first task can be scheduled tasks : iterable of tasks to schedule strategy : the scheduling algorithm to use time_segment : the time segment to schedule the tasks within Returns when successful an instance of Schedule which contains all tasks each bound to a certain date and time ; returns None when not all tasks could be scheduled .
pub(crate) fn schedule(
        start: DateTime<Utc>,
        tasks_per_segment: impl IntoIterator<Item = (impl TimeSegment, impl IntoIterator<Item = TaskT>)>,
        strategy: SchedulingStrategy,
    ) -> Result<Schedule<TaskT>, Error<TaskT>>
    where
        TaskT: Task,
    {
        tasks_per_segment
            .into_iter()
            .map(|(segment, tasks)| {
                Schedule::schedule_within_segment(start, tasks, segment, strategy)
            })
            .fold(
                Ok(Schedule::default()),
                |acc_schedule, new_schedule| match (acc_schedule, new_schedule) {
                    (Err(error), _) => Err(error),
                    (_, Err(error)) => Err(error),
                    (Ok(acc_schedule), Ok(new_schedule)) => Ok(Schedule(
                        itertools::merge(acc_schedule.0, new_schedule.0).collect_vec(),
                    )),
                },
            )
    }
pub ( crate ) fn schedule ( start : DateTime < Utc > , tasks_per_segment : impl IntoIterator < Item = ( impl TimeSegment , impl IntoIterator < Item = TaskT > ) > , strategy : SchedulingStrategy , ) -> Result < Schedule < TaskT > , Error < TaskT > > where TaskT : Task , { tasks_per_segment . into_iter ( ) . map ( | ( segment , tasks ) | { Schedule :: schedule_within_segment ( start , tasks , segment , strategy ) } ) . fold ( Ok ( Schedule :: default ( ) ) , | acc_schedule , new_schedule | match ( acc_schedule , new_schedule ) { ( Err ( error ) , _ ) => Err ( error ) , ( _ , Err ( error ) ) => Err ( error ) , ( Ok ( acc_schedule ) , Ok ( new_schedule ) ) => Ok ( Schedule ( itertools :: merge ( acc_schedule . 0 , new_schedule . 0 ) . collect_vec ( ) , ) ) , } , ) }
Schedules tasks according to the given strategy, using the tasks'
deadlines, importance and duration.
Schedules tasks according to the given strategy using the tasks ' deadlines importance and duration .
start
DateTime<Utc>
tasks_per_segment
impl IntoIterator<Item = (impl TimeSegment, impl IntoIterator<Item = TaskT>)>
strategy
SchedulingStrategy
start
DateTime<Utc>
tasks_per_segment
impl IntoIterator<Item = (impl TimeSegment, impl IntoIterator<Item = TaskT>)>
strategy
SchedulingStrategy