[][src]Struct embed_wasm::StaticLookup

pub struct StaticLookup { /* fields omitted */ }

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.