blob: e6226e1b5411b7c97d1b27cb1bce8db6305971cb [file] [log] [blame]
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
use super::*;
use std::time::Duration;
impl gpr_timespec {
pub fn inf_future() -> gpr_timespec {
unsafe { gpr_inf_future(gpr_clock_type::GPR_CLOCK_REALTIME) }
}
}
impl From<Duration> for gpr_timespec {
fn from(dur: Duration) -> gpr_timespec {
gpr_timespec {
tv_sec: dur.as_secs() as i64,
tv_nsec: dur.subsec_nanos() as i32,
clock_type: gpr_clock_type::GPR_TIMESPAN,
}
}
}