pub struct StaticFiles { /* private fields */ }Expand description
Configuration for static file serving
Implementations§
Source§impl StaticFiles
impl StaticFiles
Sourcepub fn new(root: impl Into<String>, url_prefix: Option<String>) -> Self
pub fn new(root: impl Into<String>, url_prefix: Option<String>) -> Self
Create a new StaticFiles handler
§Arguments
root- The directory on the filesystem to serve files from (e.g., “public”)url_prefix- Optional URL prefix to strip from the request path (e.g., “/public”)
Sourcepub async fn serve(&self, req: OxiditeRequest) -> Result<OxiditeResponse>
pub async fn serve(&self, req: OxiditeRequest) -> Result<OxiditeResponse>
Serve a static file based on the request
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