ProfileQuery#
Says what a LoadProfile covers: a date range, the resources to include, the bucket size and which buckets list their tasks. Build one with ProfileQuery::new and set the optional fields afterwards. Pass it to Project::load_profile through .into(), or to Project::preview as PreviewOptions::profile.
Declaration#
ProfileQuery has no Default implementation, because from and to are required.
Constructors#
new#
Creates a query for the range [from, to) with every other field at its default.
Parameters
| Name | Type | Description |
|---|---|---|
from |
DateTime |
Start of the range, inclusive |
to |
DateTime |
End of the range, exclusive |
Returns a ProfileQuery with resources: None, basis: None and tasks: ProfileTasks::None.
Fields#
| Field | Type | Default | Description |
|---|---|---|---|
from |
DateTime |
required | The profile holds every bucket whose start lies in [from, to). |
to |
DateTime |
required | Must be later than from. The range can hold at most 100 000 buckets per resource. |
resources |
Option<Vec<Id>> |
None |
Resources to include. The profile lists them in the order given here. None includes every resource. Each id must name an existing resource. |
basis |
Option<Basis> |
None |
Bucket size: one hour or one day. None uses the basis derived from config.duration_unit (Basis::for_unit). The profile reports the basis it used in LoadProfile::basis. |
tasks |
ProfileTasks |
ProfileTasks::None |
Which buckets list their booked tasks in LoadBucket::tasks. With ProfileTasks::None that field stays None in every bucket. |
An invalid query makes the call that takes it fail with Error::Input. See Project::load_profile for the error paths.
Example#
use ;
Related#
LoadProfileOptions- wraps the query forProject::load_profilePreviewOptions- carries the query forProject::previewLoadProfile- the profile the query produces- Resource Load - builds and narrows queries
- Previewing Changes - passes a query to a preview