Skip to main content

read_tariff_windows

Function read_tariff_windows 

Source
pub fn read_tariff_windows<S: Read + Write>(
    client: &mut Client<S>,
    node: &str,
    profile: TariffProfile<'_>,
    delivery_day: Range<u32>,
    accept_start: impl FnOnce(UtcTime) -> bool,
    classify: impl FnMut(f64) -> Option<TariffLevel>,
) -> Result<Vec<TariffWindow>>
Expand description

Read the provider’s UTC delivery window on an associated blocking MMS client.

For a synchronized, working clock, use |t| !t.quality.clock_not_synchronized && !t.quality.clock_failure. Returning None from classify rejects the entire import.