[−][src]Struct webmachine_rust::WebmachineDispatcher
The main hyper dispatcher
Fields
routes: Mutex<BTreeMap<String, Arc<WebmachineResource>>>
Map of routes to webmachine resources
Implementations
impl WebmachineDispatcher
[src]
pub fn new(
routes: BTreeMap<String, Arc<WebmachineResource>>
) -> WebmachineDispatcher
[src]
routes: BTreeMap<String, Arc<WebmachineResource>>
) -> WebmachineDispatcher
Create a new Webmachine dispatcher given a map of routes to webmachine resources
pub fn dispatch(&self, req: Request<Vec<u8>>) -> Result<Response<Vec<u8>>>
[src]
Main dispatch function for the Webmachine. This will look for a matching resource based on the request path. If one is not found, a 404 Not Found response is returned
pub fn dispatch_to_resource(&self, context: &mut WebmachineContext)
[src]
Dispatches to the matching webmachine resource. If there is no matching resource, returns 404 Not Found response
Auto Trait Implementations
impl RefUnwindSafe for WebmachineDispatcher
impl !Send for WebmachineDispatcher
impl !Sync for WebmachineDispatcher
impl Unpin for WebmachineDispatcher
impl UnwindSafe for WebmachineDispatcher
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, 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>,