1 // Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
2 
3 use super::*;
4 
5 use std::time::Duration;
6 
7 impl gpr_timespec {
inf_future() -> gpr_timespec8     pub fn inf_future() -> gpr_timespec {
9         unsafe { gpr_inf_future(gpr_clock_type::GPR_CLOCK_REALTIME) }
10     }
11 }
12 
13 impl From<Duration> for gpr_timespec {
from(dur: Duration) -> gpr_timespec14     fn from(dur: Duration) -> gpr_timespec {
15         gpr_timespec {
16             tv_sec: dur.as_secs() as i64,
17             tv_nsec: dur.subsec_nanos() as i32,
18             clock_type: gpr_clock_type::GPR_TIMESPAN,
19         }
20     }
21 }
22