Struct fire_http::fs::StaticFiles
source · pub struct StaticFiles { /* private fields */ }Available on crate feature
fs only.Expand description
Static get handler which servers files from a directory.
Example
use fire::fs::StaticFiles;
const FILES: StaticFiles = StaticFiles::new("/files", "./www/");
#[tokio::main]
async fn main() {
let mut server = fire::build("127.0.0.1:0").await.unwrap();
server.add_route(FILES);
}Implementations
sourceimpl StaticFiles
impl StaticFiles
Trait Implementations
sourceimpl Clone for StaticFiles
impl Clone for StaticFiles
sourcefn clone(&self) -> StaticFiles
fn clone(&self) -> StaticFiles
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for StaticFiles
impl Debug for StaticFiles
sourceimpl IntoRoute for StaticFiles
impl IntoRoute for StaticFiles
type IntoRoute = StaticFilesRoute
fn into_route(self) -> StaticFilesRoute
sourceimpl PartialEq<StaticFiles> for StaticFiles
impl PartialEq<StaticFiles> for StaticFiles
sourcefn eq(&self, other: &StaticFiles) -> bool
fn eq(&self, other: &StaticFiles) -> bool
impl Copy for StaticFiles
impl Eq for StaticFiles
impl StructuralEq for StaticFiles
impl StructuralPartialEq for StaticFiles
Auto Trait Implementations
impl RefUnwindSafe for StaticFiles
impl Send for StaticFiles
impl Sync for StaticFiles
impl Unpin for StaticFiles
impl UnwindSafe for StaticFiles
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.