pub fn validate_and_prepare_timer(
name: &str,
interval_ns: u64,
start_time_ns: Option<UnixNanos>,
stop_time_ns: Option<UnixNanos>,
allow_past: Option<bool>,
fire_immediately: Option<bool>,
ts_now: UnixNanos,
) -> Result<(Ustr, UnixNanos, Option<UnixNanos>, bool, bool)>Expand description
Validates and normalizes parameters for an interval timer.
A missing or zero start_time_ns resolves to ts_now. allow_past defaults to true, and
fire_immediately defaults to false. Returns the interned name, normalized start and stop
times, and resolved flag values.
ยงErrors
Returns an error if:
nameis invalid.interval_nsis zero.start_time_ns + interval_nsis out of range forUnixNanoswhen not firing immediately.- The first event is in the past when past times are disallowed.
- The stop time is not after the normalized start time.
- The stop time is not after
ts_nowwhen past times are disallowed.