Skip to main content

tokio/runtime/metrics/
schedule_latency_mock.rs

1//! A mock implementation of the types in `schedule_latency`. These types
2//! are zero-sized so that the size of types using them are not increased
3//! unless schedule latency tracking is explicitly enabled.
4
5use std::time::Instant;
6
7#[derive(Copy, Clone)]
8pub(crate) struct ScheduleLatencyInstant();
9
10impl ScheduleLatencyInstant {
11    pub(crate) fn new(_runtime_start: Option<Instant>) -> Self {
12        Self()
13    }
14
15    pub(crate) fn prepare(self, _runtime_start: Option<Instant>) -> Option<ScheduleLatencyContext> {
16        None
17    }
18}
19
20pub(crate) struct ScheduleLatencyContext {
21    _private: (),
22}