potree-auth 0.1.0

Authentication and project management for `potree` point clouds.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::time::Duration;
use std::time::SystemTime;
use std::time::UNIX_EPOCH;

use httpdate::HttpDate;

/// Get a [`HttpDate`] from unix time in seconds.
pub fn http_date_from_unix_time(secs: u64) -> HttpDate {
    HttpDate::from(system_time_from_unix_time(secs))
}

/// Get [`SystemTime`] from unix time in seconds.
fn system_time_from_unix_time(secs: u64) -> SystemTime {
    UNIX_EPOCH + Duration::from_secs(secs)
}