Implement very raw state transition logic

This commit is contained in:
Paul Hauner
2019-01-23 19:25:05 +11:00
parent b555916808
commit 1256ba0d01
24 changed files with 748 additions and 159 deletions

View File

@@ -3,10 +3,10 @@ use std::time::{Duration, SystemTime};
pub use std::time::SystemTimeError;
#[derive(Debug)]
#[derive(Debug, PartialEq)]
pub enum Error {
SlotDurationIsZero,
SystemTimeError(SystemTimeError),
SystemTimeError(String),
}
/// Determines the present slot based upon the present system time.
@@ -51,7 +51,7 @@ impl SlotClock for SystemTimeSlotClock {
impl From<SystemTimeError> for Error {
fn from(e: SystemTimeError) -> Error {
Error::SystemTimeError(e)
Error::SystemTimeError(format!("{:?}", e))
}
}