Measures the time of the callback, in case it returns `Ok`.
(f: F)
| 582 | |
| 583 | /// Measures the time of the callback, in case it returns `Ok`. |
| 584 | fn measure_ok<T, E, F>(f: F) -> result::Result<(T, Duration), E> |
| 585 | where |
| 586 | F: FnOnce() -> result::Result<T, E>, |
| 587 | { |
| 588 | let begin = Instant::now(); |
| 589 | let value = f()?; |
| 590 | let duration = begin.elapsed(); |
| 591 | Ok((value, duration)) |
| 592 | } |
| 593 | |
| 594 | #[derive(Clone, Deserialize, Serialize)] |
| 595 | struct VmMigrationConfig { |
no outgoing calls
no test coverage detected