shardline-server 1.0.0

HTTP server boundary, runtime, and operator workflows for Shardline.
Documentation
1
2
3
4
5
6
7
8
9
10
use std::time::{SystemTime, UNIX_EPOCH};

use crate::ServerError;

pub(crate) fn unix_now_seconds_checked() -> Result<u64, ServerError> {
    SystemTime::now()
        .duration_since(UNIX_EPOCH)
        .map(|duration| duration.as_secs())
        .map_err(|_error| ServerError::Overflow)
}