2019-02-14 01:09:18 +00:00
|
|
|
mod system_time_slot_clock;
|
|
|
|
mod testing_slot_clock;
|
|
|
|
|
|
|
|
pub use crate::system_time_slot_clock::{Error as SystemTimeSlotClockError, SystemTimeSlotClock};
|
|
|
|
pub use crate::testing_slot_clock::{Error as TestingSlotClockError, TestingSlotClock};
|
2019-03-26 23:36:20 +00:00
|
|
|
use std::time::Duration;
|
2019-02-14 01:09:18 +00:00
|
|
|
pub use types::Slot;
|
|
|
|
|
|
|
|
pub trait SlotClock: Send + Sync {
|
|
|
|
type Error;
|
|
|
|
|
|
|
|
fn present_slot(&self) -> Result<Option<Slot>, Self::Error>;
|
2019-03-26 23:36:20 +00:00
|
|
|
|
|
|
|
fn duration_to_next_slot(&self) -> Result<Option<Duration>, Self::Error>;
|
2019-02-14 01:09:18 +00:00
|
|
|
}
|