(&mut self, method: &str, path: &str, response_preview: &str)
| 33 | } |
| 34 | |
| 35 | pub fn record(&mut self, method: &str, path: &str, response_preview: &str) { |
| 36 | self.last_active = Utc::now(); |
| 37 | self.history.push(HistoryEntry { |
| 38 | timestamp: Utc::now(), |
| 39 | method: method.to_string(), |
| 40 | path: path.to_string(), |
| 41 | response_preview: if response_preview.len() > 200 { |
| 42 | format!("{}...", &response_preview[..200]) |
| 43 | } else { |
| 44 | response_preview.to_string() |
| 45 | }, |
| 46 | }); |
| 47 | } |
| 48 | } |