[Canonical page](<https://docs.dhtmlx.com/planning-engine/rust/api/core/project/analyze-options/>)
[Full documentation index](<https://docs.dhtmlx.com/planning-engine/llms.txt>)


# AnalyzeOptions

Options for [`Project::analyze`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/project/project.md#analyze>). They select the analytics that the returned [`ScheduleResult`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/results/schedule-result.md>) carries. `AnalyzeOptions::default()` requests no analytics.

## Declaration

```rust
#[derive(Clone, Debug, Default)]
pub struct AnalyzeOptions {
    pub analytics: AnalyticsOptions,
}
```

The field is public. Build the value with a struct literal or `AnalyzeOptions::default()`.

## Fields

| Field | Type | Default | Description |
|---|---|---|---|
| `analytics` | [`AnalyticsOptions`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/project/analytics-options.md>) | no analytics | Requests critical path and slack. Fills [`ScheduleResult::analytics`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/results/schedule-result.md#analytics>). |

### analytics

```rust
pub analytics: AnalyticsOptions
```

Turns on [`AnalyticsOptions::slack`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/project/analytics-options.md>) and [`AnalyticsOptions::critical_path`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/project/analytics-options.md>). Check [`Analytics::status`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/results/analytics-status.md>) before reading the data.

## Example

```rust
use plen_core::{AnalyticsOptions, AnalyzeOptions, Project, ProjectData, SolveOptions};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut project = Project::default();
    project.solve(Some(ProjectData::default()), &SolveOptions::default())?;

    let options = AnalyzeOptions {
        analytics: AnalyticsOptions {
            critical_path: true,
            ..Default::default()
        },
    };

    let result = project.analyze(None, &options)?;
    if let Some(analytics) = &result.analytics {
        if let Some(critical) = &analytics.critical_path {
            println!("{} critical tasks", critical.tasks.len());
        }
    }
    Ok(())
}
```

## Related

- [`Project::analyze`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/project/project.md#analyze>) - the call that takes these options
- [`Analytics`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/results/analytics.md>) - the analytics returned in the result
- [`SolveOptions`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/project/solve-options.md>) - requests the same analytics while scheduling
- [Critical path and slack](<https://docs.dhtmlx.com/planning-engine/rust/scheduling/critical-path-and-slack.md#analyzing-without-scheduling>) - analyzing supplied or current dates
