1#[cfg(any(not(debug_assertions), feature = "debug-prod"))]
3#[derive(Debug, Clone)]
4pub struct ViteFile {
6 pub bytes: ::std::borrow::Cow<'static, [u8]>,
7 pub last_modified: Option<&'static str>,
8 pub content_type: &'static str,
9 pub content_length: u64,
10 #[cfg(feature = "content-hash")]
11 pub content_hash: &'static str,
13}
14
15#[cfg(any(not(debug_assertions), feature = "debug-prod"))]
18pub trait GetFromVite: Send + Sync + 'static {
19 fn get(&self, file_path: &str) -> Option<ViteFile>;
20 fn clone_box(&self) -> Box<dyn GetFromVite>;
21}
22
23#[cfg(all(debug_assertions, not(feature = "debug-prod")))]
25#[derive(Debug, Clone)]
26pub struct ViteFile {
28 pub bytes: Vec<u8>,
29 pub last_modified: Option<String>,
30 pub content_type: String,
31 pub content_length: u64,
32 #[cfg(feature = "content-hash")]
33 pub content_hash: String,
35}
36
37#[cfg(all(debug_assertions, not(feature = "debug-prod")))]
40pub trait GetFromVite: Send + Sync + 'static {
41 fn get(&self, file_path: &str) -> Option<ViteFile>;
42 fn clone_box(&self) -> Box<dyn GetFromVite>;
43}