pub struct StaticLookup { /* private fields */ }
Expand description
Wraps a hashmap of static content generated at compile time and provides convenience functions for resolving static content as ‘hyper::Response’ when given a path.
Implementations§
Source§impl StaticLookup
impl StaticLookup
Sourcepub fn get(&self, path: &str) -> Option<Response<Body>>
pub fn get(&self, path: &str) -> Option<Response<Body>>
Given a path (‘/’, ‘/css/tree.css’, etc) attempt to construct a ‘hyper::Response’ using the static hashmap generated at compile time. Infers MIME type from path.
path expected as let x: http::uri::PathAndQuery = ..; x.as_str()
, omiting type to simplify interface
Auto Trait Implementations§
impl Freeze for StaticLookup
impl RefUnwindSafe for StaticLookup
impl Send for StaticLookup
impl Sync for StaticLookup
impl Unpin for StaticLookup
impl UnwindSafe for StaticLookup
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