pub fn new_with_last_time(epoch: SystemTime, last_duration_ms: u64, node_id: u8) -> Result<WebeIDFactory, WebeIDError> {
        let mut factory = WebeIDFactory::new(epoch, node_id)?;
        // check that current duration since epoch is greater than last time since epoch
        if SystemTime::now().duration_since(epoch)?.as_millis() <= last_duration_ms as u128 {
            return Err(WebeIDError::BadLastDuration);
        }
        factory.last_duration_ms = last_duration_ms;
        return Ok(factory);
    }
// 'last_time_ms' = last duration in ms since provided epoch
// same as 'new' but can provide last known run time - in case of planned system restarts
'last_time_ms' = last duration in ms since provided epoch
same as 'new' but can provide last known run time - in case of planned system restarts
' last_time_ms ' = last duration in ms since provided epoch same as ' new ' but can provide last known run time - in case of planned system restarts
pub fn new_with_last_time(epoch: SystemTime, last_duration_ms: u64, node_id: u8) -> Result<WebeIDFactory, WebeIDError> {
        let mut factory = WebeIDFactory::new(epoch, node_id)?;
        // check that current duration since epoch is greater than last time since epoch
        if SystemTime::now().duration_since(epoch)?.as_millis() <= last_duration_ms as u128 {
            return Err(WebeIDError::BadLastDuration);
        }
        factory.last_duration_ms = last_duration_ms;
        return Ok(factory);
    }
pub fn new_with_last_time ( epoch : SystemTime , last_duration_ms : u64 , node_id : u8 ) -> Result < WebeIDFactory , WebeIDError > { let mut factory = WebeIDFactory :: new ( epoch , node_id ) ? ; // check that current duration since epoch is greater than last time since epoch if SystemTime :: now ( ) . duration_since ( epoch ) ? . as_millis ( ) <= last_duration_ms as u128 { return Err ( WebeIDError :: BadLastDuration ) ; } factory . last_duration_ms = last_duration_ms ; return Ok ( factory ) ; }
'last_time_ms' = last duration in ms since provided epoch
same as 'new' but can provide last known run time - in case of planned system restarts
' last_time_ms ' = last duration in ms since provided epoch same as ' new ' but can provide last known run time - in case of planned system restarts
epoch
SystemTime
last_duration_ms
u64
node_id
u8