pub struct StaticFiles(/* private fields */);
Expand description
Entry point for all of the functionality for rocket-static-files
.
Attach the result of StaticFiles::fairing
to your rocket.
Use StaticFiles
as a request guard!
Implementations§
Source§impl StaticFiles
impl StaticFiles
Sourcepub fn fairing(hashes: &'static Map<&'static str, &'static str>) -> impl Fairing
pub fn fairing(hashes: &'static Map<&'static str, &'static str>) -> impl Fairing
Create a fairing to attach to your rocket instance:
use rocket_static_files::StaticFiles;
include!(concat!(env!("OUT_DIR"), "/static_file_hashes.rs"));
fn main() {
rocket::ignite()
.attach(StaticFiles::fairing(&STATIC_FILE_HASHES))
.launch();
}
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<'a, 'r> FromRequest<'a, 'r> for StaticFiles
impl<'a, 'r> FromRequest<'a, 'r> 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)