2 个不稳定版本

0.2.0 2021 年 10 月 18 日
0.1.0 2018 年 6 月 15 日

排名:71 / 缓存

Download history 9229/week @ 2024-03-14 9637/week @ 2024-03-21 10869/week @ 2024-03-28 12587/week @ 2024-04-04 10724/week @ 2024-04-11 11492/week @ 2024-04-18 13569/week @ 2024-04-25 14727/week @ 2024-05-02 13387/week @ 2024-05-09 15075/week @ 2024-05-16 13979/week @ 2024-05-23 15336/week @ 2024-05-30 13389/week @ 2024-06-06 12868/week @ 2024-06-13 12218/week @ 2024-06-20 9826/week @ 2024-06-27

每月下载量:51,367
39 包使用(14 个直接使用)

授权:MIT

大小:10KB
代码行数:155

rust-cache-control

Rust 包用于解析 HTTP Cache-Control 头部。

use cache_control::{Cachability, CacheControl};
use std::time::Duration;

let cache_control = CacheControl::from_header("Cache-Control: public, max-age=60").unwrap();
assert_eq!(cache_control.cachability, Some(Cachability::Public));
assert_eq!(cache_control.max_age, Some(Duration::from_secs(60)));

lib.rs:

Rust 包用于解析 HTTP Cache-Control 头部。

示例

use cache_control::{Cachability, CacheControl};
use std::time::Duration;

let cache_control = CacheControl::from_header("Cache-Control: public, max-age=60").unwrap();
assert_eq!(cache_control.cachability, Some(Cachability::Public));
assert_eq!(cache_control.max_age, Some(Duration::from_secs(60)));

无运行时依赖