trillium_caching_headers/
lib.rs1#![forbid(unsafe_code)]
10#![deny(
11 missing_copy_implementations,
12 rustdoc::missing_crate_level_docs,
13 missing_debug_implementations,
14 missing_docs,
15 nonstandard_style,
16 unused_qualifications
17)]
18
19#[cfg(test)]
20#[doc = include_str!("../README.md")]
21mod readme {}
22
23mod etag;
24pub use crate::etag::Etag;
25pub use ::etag::EntityTag;
26
27mod modified;
28pub use modified::Modified;
29
30mod caching_conn_ext;
31pub use caching_conn_ext::CachingHeadersExt;
32
33mod cache_control;
34pub use cache_control::{CacheControlDirective, CacheControlHeader, cache_control};
35
36#[derive(Debug, Clone, Copy, Default)]
39pub struct CachingHeaders {
40 inner: (Modified, Etag),
41}
42trillium::delegate_handler!(CachingHeaders => inner);
43
44impl CachingHeaders {
45 pub fn new() -> Self {
47 Self::default()
48 }
49}
50
51pub fn caching_headers() -> CachingHeaders {
53 CachingHeaders::new()
54}