rusty-cat 0.2.2

Async HTTP client for resumable file upload and download.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::time::{SystemTime, UNIX_EPOCH};

use crate::error::{InnerErrorCode, MeowError};

pub(crate) fn now_unix_secs() -> Result<u64, MeowError> {
    SystemTime::now()
        .duration_since(UNIX_EPOCH)
        .map(|d| d.as_secs())
        .map_err(|e| {
            MeowError::from_code(
                InnerErrorCode::InvalidTaskState,
                format!("system time before unix epoch: {e}"),
            )
        })
}