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


# LoadProfile

Per-bucket load and capacity of a set of resources over a date range. Returned by [`Project::load_profile`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/project/project.md#load_profile>) for the solved baseline, and in [`ScheduleResult::profile`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/results/schedule-result.md#profile>) by [`Project::preview`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/project/project.md#preview>) when [`PreviewOptions::profile`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/project/preview-options.md>) is set, for the previewed dates.

## Declaration

```rust
#[derive(Clone, Debug, PartialEq)]
pub struct LoadProfile {
    pub basis: Basis,
    pub resources: Vec<ResourceLoad>,
}
```

With the `serde` feature, `LoadProfile` implements `Serialize` and `Deserialize` with camelCase field names.

## Fields

| Field | Type | Description |
|---|---|---|
| `basis` | [`Basis`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/data/basis.md>) | The bucket size used for every bucket in the profile. It's the query's `basis` when one was set, otherwise the basis derived from [`config.duration_unit`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/data/scheduling-config.md#duration_unit>). |
| `resources` | `Vec<`[`ResourceLoad`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/resources/resource-load.md>)`>` | One entry per selected resource, in input order. The query's `resources` list picks them; when it's `None`, every resource of the project is here. |

The query that controls the range, the resources and the task lists is [`ProfileQuery`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/resources/profile-query.md>).

## Example

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

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let start = DateTime::from_ymd_hm(2026, 8, 10, 8, 0).ok_or("invalid date")?;

    let mut task = TaskData::new("design");
    task.start_date = Some(start);
    task.duration = Some(2.0);

    let data = ProjectData {
        tasks: vec![task],
        resources: vec![ResourceData {
            id: "anna".into(),
            capacity: None,
            calendar_id: None,
        }],
        assignments: vec![AssignmentData {
            id: None,
            task: "design".into(),
            resource: "anna".into(),
            value: 1.5,
            offset: None,
            duration: None,
        }],
        ..Default::default()
    };

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

    let from = DateTime::from_ymd_hm(2026, 8, 10, 0, 0).ok_or("invalid date")?;
    let to = DateTime::from_ymd_hm(2026, 8, 15, 0, 0).ok_or("invalid date")?;
    let profile = project.load_profile(&ProfileQuery::new(from, to).into())?;

    println!("basis: {:?}", profile.basis);
    for resource in &profile.resources {
        for bucket in &resource.buckets {
            println!(
                "{} {}: load {} / capacity {}",
                resource.resource, bucket.start, bucket.load, bucket.capacity
            );
        }
    }
    Ok(())
}
```

## Related

- [`ProfileQuery`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/resources/profile-query.md>) - selects the range, resources and basis of the profile
- [`ResourceLoad`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/resources/resource-load.md>) - one entry per resource in the profile
- [`PreviewOptions`](<https://docs.dhtmlx.com/planning-engine/rust/api/core/project/preview-options.md>) - requests a profile of previewed dates
- [Resource Load](<https://docs.dhtmlx.com/planning-engine/rust/resources-and-assignment/resource-load.md>) - queries and reads profiles
- [Serialize results to JSON](<https://docs.dhtmlx.com/planning-engine/rust/how-to/serialize-results-to-json.md>) - shows the profile's JSON form
