Basis#
The size of the time buckets in which resource load is measured and compared with capacity: one hour or one day. It's the type of LevelingOptions::basis and ProfileQuery::basis, and LoadProfile::basis reports the basis a profile was built with.
Declaration#
With the serde feature, Basis implements Serialize and Deserialize, using the lowercase names "hour" and "day".
Variants#
| Variant | Description |
|---|---|
Hour |
Load is measured per hour bucket. |
Day |
Load is measured per day bucket. |
Minute, week and month buckets aren't supported.
Associated functions#
parse#
Converts a lowercase basis name to a Basis.
Parameters
| Name | Type | Description |
|---|---|---|
s |
&str |
"hour" or "day". Matching is case-sensitive. |
Returns - Some with the matching variant, or None for any other string.
for_unit#
Returns the derived basis for a duration unit.
Parameters
| Name | Type | Description |
|---|---|---|
unit |
TimeUnit |
The project's duration unit. |
Returns - Basis::Day for TimeUnit::Day; Basis::Hour for TimeUnit::Hour and TimeUnit::Minute.
Methods#
as_str#
Returns the lowercase name of the basis: "hour" or "day". Basis::parse accepts this name back.
Example#
use ;
Related#
LevelingOptions- sets the bucket size leveling compares load inProfileQuery- sets the bucket size of a load profileTimeUnit- the duration unit the default basis is derived from- Leveling Resources - how the basis affects which overloads leveling resolves
- Resource Load - reading load profiles per hour or per day