pub struct StaticFilesConfig { /* private fields */ }Expand description
Configuration for StaticFilesRuntime and StaticFilesPlugin.
Implementations§
Source§impl StaticFilesConfig
Inherent constructors and builders for StaticFilesConfig.
impl StaticFilesConfig
Inherent constructors and builders for StaticFilesConfig.
Sourcepub fn new<P>(root_dir: P) -> Self
pub fn new<P>(root_dir: P) -> Self
Creates a StaticFilesConfig serving files from root_dir mounted at "/".
§Arguments
P- Root directory path convertible intoPathBuf.
§Returns
Self- Constructed static files configuration.
Sourcepub fn with_mount_prefix<P>(self, prefix: P) -> Self
pub fn with_mount_prefix<P>(self, prefix: P) -> Self
Sourcepub fn with_spa_fallback<F>(self, fallback: F) -> Self
pub fn with_spa_fallback<F>(self, fallback: F) -> Self
Sourcepub fn with_cache_control<C>(self, cache_control: C) -> Self
pub fn with_cache_control<C>(self, cache_control: C) -> Self
Sourcepub fn with_serve_precompressed(self, enabled: bool) -> Self
pub fn with_serve_precompressed(self, enabled: bool) -> Self
Source§impl StaticFilesConfig
impl StaticFilesConfig
pub fn get_root_dir(&self) -> &PathBuf
pub fn get_mut_root_dir(&mut self) -> &mut PathBuf
pub fn set_root_dir(&mut self, val: PathBuf) -> &mut Self
pub fn get_mount_prefix(&self) -> &String
pub fn get_mut_mount_prefix(&mut self) -> &mut String
pub fn set_mount_prefix(&mut self, val: String) -> &mut Self
pub fn get_index_file(&self) -> &String
pub fn get_mut_index_file(&mut self) -> &mut String
pub fn set_index_file(&mut self, val: String) -> &mut Self
pub fn get_spa_fallback(&self) -> Option<String>
pub fn try_get_spa_fallback(&self) -> Option<String>
pub fn get_mut_spa_fallback(&mut self) -> &mut Option<String>
pub fn set_spa_fallback(&mut self, val: Option<String>) -> &mut Self
pub fn get_cache_control(&self) -> &String
pub fn get_mut_cache_control(&mut self) -> &mut String
pub fn set_cache_control(&mut self, val: String) -> &mut Self
pub fn get_serve_precompressed(&self) -> bool
pub fn get_mut_serve_precompressed(&mut self) -> &mut bool
pub fn set_serve_precompressed(&mut self, val: bool) -> &mut Self
pub fn get_allow_dotfiles(&self) -> bool
pub fn get_mut_allow_dotfiles(&mut self) -> &mut bool
pub fn set_allow_dotfiles(&mut self, val: bool) -> &mut Self
pub fn get_max_cache_bytes(&self) -> usize
pub fn get_mut_max_cache_bytes(&mut self) -> &mut usize
pub fn set_max_cache_bytes(&mut self, val: usize) -> &mut Self
pub fn get_max_file_cache_bytes(&self) -> usize
pub fn get_mut_max_file_cache_bytes(&mut self) -> &mut usize
pub fn set_max_file_cache_bytes(&mut self, val: usize) -> &mut Self
Trait Implementations§
Source§impl Clone for StaticFilesConfig
impl Clone for StaticFilesConfig
Source§impl Debug for StaticFilesConfig
impl Debug for StaticFilesConfig
impl Eq for StaticFilesConfig
Source§impl PartialEq for StaticFilesConfig
impl PartialEq for StaticFilesConfig
impl StructuralPartialEq for StaticFilesConfig
Auto Trait Implementations§
impl Forget for StaticFilesConfig
impl Freeze for StaticFilesConfig
impl Move for StaticFilesConfig
impl RefUnwindSafe for StaticFilesConfig
impl Send for StaticFilesConfigwhere
RawVecInner: Send,
impl Sync for StaticFilesConfigwhere
RawVecInner: Sync,
impl Unpin for StaticFilesConfig
impl UnsafeUnpin for StaticFilesConfig
impl UnwindSafe for StaticFilesConfigwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.