Skip to main content

parse_state

Function parse_state 

Source
pub async fn parse_state(
    unit: &ListedUnit,
    config: &UnitsConfig,
    connection: Option<&Connection>,
) -> Result<(bool, Option<UnitStates>), MonitordUnitsError>
Expand description

Parse state of a unit into a UnitStates entry for the caller to merge.

Returns (did_dbus_fetch, entry): did_dbus_fetch is true when an actual time-in-state D-Bus fetch was performed, so callers can keep state_dbus_fetches honest. Allowlist/blocklist short-circuits return (false, None) — the unit is simply not tracked in unit_states.