pub struct Pause {
pub id: i32,
pub start: NaiveDateTime,
pub end: Option<NaiveDateTime>,
pub duration: Option<Duration>,
pub protected: bool,
}Expand description
A single break period; end and duration stay None while it is ongoing.
Fields§
§id: i32Database primary key.
start: NaiveDateTimeWhen the inactivity threshold was crossed (local time).
end: Option<NaiveDateTime>When activity resumed; None while the pause is still running.
duration: Option<Duration>end - start, stored by the database layer; None while ongoing.
protected: boolWhether this pause was entered manually and must be preserved as-is.
Protected pauses are recorded by the user through kasl pauses add
rather than detected by the activity monitor. They are exempt from the
minimum-duration threshold and are never merged with adjacent pauses,
so a deliberately short entry (a ten-minute walk the monitor missed)
survives filtering intact.
Implementations§
Source§impl Pause
impl Pause
Sourcepub fn detected(
id: i32,
start: NaiveDateTime,
end: Option<NaiveDateTime>,
duration: Option<Duration>,
) -> Self
pub fn detected( id: i32, start: NaiveDateTime, end: Option<NaiveDateTime>, duration: Option<Duration>, ) -> Self
Builds a monitor-detected pause (not protected).
Used when reconstructing pauses from sources that carry no protection flag, such as in-memory analysis of activity data.