#[non_exhaustive]pub struct SpaConfig {
pub base_path: String,
pub index_files: Vec<String>,
pub security_headers: Vec<(String, String)>,
pub error_pages: HashMap<u16, String>,
pub override_dir: Option<PathBuf>,
}Expand description
SPA 配置
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.base_path: String§index_files: Vec<String>§security_headers: Vec<(String, String)>§error_pages: HashMap<u16, String>§override_dir: Option<PathBuf>Implementations§
Source§impl SpaConfig
impl SpaConfig
pub fn with_base_path(self, base_path: &str) -> Self
pub fn with_index_files(self, files: &[&str]) -> Self
pub fn add_index_file(self, file: &str) -> Self
pub fn with_error_page(self, status_code: u16, file_path: &str) -> Self
pub fn with_security_header(self, key: &str, value: &str) -> Self
pub fn with_override_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn with_default_security_headers(self) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SpaConfig
impl RefUnwindSafe for SpaConfig
impl Send for SpaConfig
impl Sync for SpaConfig
impl Unpin for SpaConfig
impl UnsafeUnpin for SpaConfig
impl UnwindSafe for SpaConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more