[−][src]Struct embed_wasm::StaticLookup
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
impl StaticLookup
[src]
pub fn get(&self, path: &str) -> Option<Response<Body>>
[src]
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 RefUnwindSafe for StaticLookup
impl Send for StaticLookup
impl Sync for StaticLookup
impl Unpin for StaticLookup
impl UnwindSafe for StaticLookup
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,