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§
Source§impl StaticFiles
impl StaticFiles
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for StaticFiles
Source§impl Debug for StaticFiles
impl Debug for StaticFiles
impl Eq for StaticFiles
Source§impl IntoRoute for StaticFiles
impl IntoRoute for StaticFiles
Source§impl PartialEq for StaticFiles
impl PartialEq for StaticFiles
Source§fn eq(&self, other: &StaticFiles) -> bool
fn eq(&self, other: &StaticFiles) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for StaticFiles
Auto Trait Implementations§
impl Freeze for StaticFiles
impl RefUnwindSafe for StaticFiles
impl Send for StaticFiles
impl Sync for StaticFiles
impl Unpin for StaticFiles
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.