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 copy 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 moreSource§impl Debug for StaticFiles
impl Debug for StaticFiles
Source§impl IntoRoute for StaticFiles
impl IntoRoute for StaticFiles
Source§impl PartialEq for StaticFiles
impl PartialEq for StaticFiles
impl Copy for StaticFiles
impl Eq for StaticFiles
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 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<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.