(&self)
| 1017 | } |
| 1018 | |
| 1019 | pub fn started(&self) -> Result<bool> { |
| 1020 | let state_path = self.state_path(); |
| 1021 | if !state_path.exists() { |
| 1022 | return Ok(false); |
| 1023 | } |
| 1024 | let state: State = |
| 1025 | serde_json::from_str(&fs::read_to_string(state_path).context("Failed to read state")?) |
| 1026 | .context("Failed to parse state")?; |
| 1027 | Ok(state.started) |
| 1028 | } |
| 1029 | |
| 1030 | pub fn set_started(&self, started: bool) -> Result<()> { |
| 1031 | let state_path = self.state_path(); |
no test coverage detected