#![warn(clippy::pedantic)]
use std::rc::Rc;
use vite_static_shared::DynManifest;
use actix_web::http::header::{CacheControl, CacheDirective};
#[allow(unused_imports)]
use vite_static_shared::Manifest;
mod service;
pub use service::*;
#[derive(Clone)]
pub struct ActixFiles {
manifest: Rc<DynManifest<'static>>,
cache_control: CacheControl,
}
impl ActixFiles {
#[must_use]
pub fn new(manifest: DynManifest<'static>) -> Self {
Self {
manifest: Rc::new(manifest),
cache_control: CacheControl(vec![CacheDirective::MaxAge(604_800)]),
}
}
#[must_use]
pub fn cache_control(mut self, value: CacheControl) -> Self {
self.cache_control = value;
self
}
}