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


# Project::load_profile

Reads per-bucket load and capacity of resources on the solved baseline of a [`Project`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/project/project.md>). Read-only. For the load of hypothetical dates, use [`preview`](<https://docs.dhtmlx.com/planning-engine/rust/api/project-preview.md>) with a `profile` query instead.

## Signature

```rust
pub fn load_profile(&self, options: &LoadProfileOptions) -> Result<LoadProfile, Error>
```

Takes `&self`. Synchronous and CPU-only.

## Parameters

| Name | Type | Description |
|---|---|---|
| `options` | `&`[`LoadProfileOptions`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/resources/load-profile-options.md>) | Range, resources, basis, task lists and an optional baseline check. A [`ProfileQuery`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/resources/profile-query.md>) converts into it with `.into()`. |

## Returns

A [`LoadProfile`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/resources/load-profile.md>).

## Errors

| Error | When |
|---|---|
| [`Error::Project(ProjectError::NoBaseline)`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/errors/project-error.md>) | The project is unsolved, including after `apply` |
| `Error::Project(ProjectError::StaleBaseline)` | `options.baseline_id` doesn't name the current baseline |
| [`Error::Input`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/errors/error.md>) | `to <= from`, or more than 100 000 buckets per resource (path `to`); an unknown resource (path `resources`) |

## Example

Print the overloaded days of a resource that works on two tasks at once.

```rust
use plen_core::{
    AssignmentData, DateTime, ProfileQuery, Project, ProjectData, ResourceData, SolveOptions,
    TaskData,
};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let day = |d| DateTime::from_ymd_hm(2026, 1, d, 0, 0).ok_or("invalid date");
    let assign = |task: &str| AssignmentData {
        id: None,
        task: task.into(),
        resource: "dev".into(),
        value: 1.0,
        offset: None,
        duration: None,
    };
    let mut data = ProjectData {
        tasks: vec![
            TaskData { start_date: Some(day(1)?), duration: Some(2.0), ..TaskData::new("a") },
            TaskData { start_date: Some(day(2)?), duration: Some(2.0), ..TaskData::new("b") },
        ],
        resources: vec![ResourceData { id: "dev".into(), capacity: None, calendar_id: None }],
        assignments: vec![assign("a"), assign("b")],
        ..Default::default()
    };
    data.config.use_calendars = false;

    let mut project = Project::default();
    project.solve(Some(data), &SolveOptions::default())?;

    let profile = project.load_profile(&ProfileQuery::new(day(1)?, day(5)?).into())?;
    for resource in &profile.resources {
        for bucket in resource.buckets.iter().filter(|b| b.load > b.capacity) {
            println!("{} at {}: {} of {}", resource.resource, bucket.start, bucket.load, bucket.capacity);
        }
    }
    Ok(())
}
```

## Related

- [`Project`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/project/project.md#load_profile>) - the type and its other methods
- [`LoadProfileOptions`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/resources/load-profile-options.md>) and [`ProfileQuery`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/resources/profile-query.md>) - what the profile covers
- [`LoadProfile`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/resources/load-profile.md>) - the returned profile
- [Resource Load](<https://docs.dhtmlx.com/planning-engine/rust/resources-and-assignment/resource-load.md>) - querying, capacity modes and task lists
