pub struct StaticFiles { /* private fields */ }Expand description
Implementations§
Source§impl StaticFiles
impl StaticFiles
Sourcepub fn new(directory: impl Into<PathBuf>) -> Self
pub fn new(directory: impl Into<PathBuf>) -> Self
Create a new static file server for the given directory.
Sourcepub fn with_config(config: StaticFilesConfig) -> Self
pub fn with_config(config: StaticFilesConfig) -> Self
Create a static file server with full configuration.
Sourcepub fn index_file(self, file: impl Into<String>) -> Self
pub fn index_file(self, file: impl Into<String>) -> Self
Set the index file to look for in directories.
Sourcepub fn enable_directory_listing(self) -> Self
pub fn enable_directory_listing(self) -> Self
Enable directory listing.
Sourcepub fn follow_symlinks(self) -> Self
pub fn follow_symlinks(self) -> Self
Enable following symlinks.
Trait Implementations§
Source§impl Clone for StaticFiles
impl Clone for StaticFiles
Source§fn clone(&self) -> StaticFiles
fn clone(&self) -> StaticFiles
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StaticFiles
impl RefUnwindSafe for StaticFiles
impl Send for StaticFiles
impl Sync for StaticFiles
impl Unpin for StaticFiles
impl UnwindSafe for StaticFiles
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).