use super::std_timer_waiter::StdTimerWaiter;
use std::sync::Arc;
use std::time::Instant;
pub(super) struct StdTimerRegistration {
deadline: Instant,
waiter: Arc<StdTimerWaiter>,
}
impl StdTimerRegistration {
#[must_use]
#[inline(always)]
pub(super) const fn new(
deadline: Instant,
waiter: Arc<StdTimerWaiter>,
) -> Self {
Self { deadline, waiter }
}
#[must_use]
#[inline(always)]
pub(super) const fn deadline(&self) -> Instant {
self.deadline
}
#[must_use]
#[inline(always)]
pub(super) fn into_waiter(self) -> Arc<StdTimerWaiter> {
self.waiter
}
}