Project::solve#
Schedules a Project and accepts the scheduled dates as its baseline. Call it with Some(data) to load a project and with None to reschedule after apply. Every other read-only call (preview, evaluate, suggest_assignments and the rest) needs a solved project.
For a one-shot run without keeping state, use schedule.
Signature#
Takes &mut self. Synchronous and CPU-only.
Parameters#
| Name | Type | Description |
|---|---|---|
data |
Option<ProjectData> |
Replacement data, or None to schedule the current state |
options |
&SolveOptions |
Subtree, analytics and reporting switches |
Behavior#
Some(data)validates the replacement data, installs it, schedules it and accepts the result. The previous data is discarded. Howdatais validated or repaired depends onProjectOptions::validation.Noneschedules the current state when it has unsolved edits. When the project is already solved with equaloptions, it returns the cached result without scheduling again. The cache key is the wholeSolveOptionsvalue.
Tasks touched by successful apply calls since the last solve appear in updates as direct updates, even when the planner leaves them where the edit put them. A cyclic project returns unchanged dates and keeps those tasks pending.
The result's baseline_id names the accepted baseline. It changes only when the data or the dates change, so solving an unchanged state keeps it.
Returns#
The ScheduleResult behind an Arc, shared with the project's cache.
Errors#
| Error | When |
|---|---|
Error::Input |
Some(data) fails validation. The previous state and cached result are kept. |
Error::Project(ProjectError::NeedsResync) |
None after an apply rejected an operation and no solve(Some(data)) followed |
Example#
Load a project, commit an edit and reschedule it.
use ;
Related#
Project- the type and its other methodsSolveOptions- what to schedule and reportScheduleResult- the returned result- Scheduling a Project - loading and solving a project
- Data Updates - rescheduling after
apply