Struct fire_http::fs::MemoryFile
source · pub struct MemoryFile { /* private fields */ }Available on crate feature
fs only.Expand description
Static get handler which servers/returns a file.
Example
use fire::fs::MemoryFile;
use fire::memory_file;
const INDEX: MemoryFile = memory_file!(
"/",
"../../examples/www/hello_world.html"
);Implementations
sourceimpl MemoryFile
impl MemoryFile
sourcepub const fn new(
uri: &'static str,
path: &'static str,
bytes: &'static [u8]
) -> Self
pub const fn new(
uri: &'static str,
path: &'static str,
bytes: &'static [u8]
) -> Self
Creates a MemoryFile with Default caching settings
pub const fn no_cache(
uri: &'static str,
path: &'static str,
bytes: &'static [u8]
) -> Self
pub const fn cache_with_age(
uri: &'static str,
path: &'static str,
bytes: &'static [u8],
max_age: Duration
) -> Self
Trait Implementations
sourceimpl Clone for MemoryFile
impl Clone for MemoryFile
sourcefn clone(&self) -> MemoryFile
fn clone(&self) -> MemoryFile
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 MemoryFile
impl Debug for MemoryFile
sourceimpl IntoRoute for MemoryFile
impl IntoRoute for MemoryFile
type IntoRoute = MemoryFileRoute
fn into_route(self) -> MemoryFileRoute
sourceimpl PartialEq<MemoryFile> for MemoryFile
impl PartialEq<MemoryFile> for MemoryFile
sourcefn eq(&self, other: &MemoryFile) -> bool
fn eq(&self, other: &MemoryFile) -> bool
impl Copy for MemoryFile
impl Eq for MemoryFile
impl StructuralEq for MemoryFile
impl StructuralPartialEq for MemoryFile
Auto Trait Implementations
impl RefUnwindSafe for MemoryFile
impl Send for MemoryFile
impl Sync for MemoryFile
impl Unpin for MemoryFile
impl UnwindSafe for MemoryFile
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.