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§
Source§impl 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§
Source§impl Clone for MemoryFile
impl Clone for MemoryFile
Source§fn clone(&self) -> MemoryFile
fn clone(&self) -> MemoryFile
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 MemoryFile
impl Debug for MemoryFile
Source§impl IntoRoute for MemoryFile
impl IntoRoute for MemoryFile
Source§impl PartialEq for MemoryFile
impl PartialEq for MemoryFile
impl Copy for MemoryFile
impl Eq for MemoryFile
impl StructuralPartialEq for MemoryFile
Auto Trait Implementations§
impl Freeze for MemoryFile
impl RefUnwindSafe for MemoryFile
impl Send for MemoryFile
impl Sync for MemoryFile
impl Unpin for MemoryFile
impl UnwindSafe for MemoryFile
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.