Struct stack_epic_api::Router

source ·
pub struct Router { /* private fields */ }

Implementations§

source§

impl Router

source

pub fn new() -> Router

source

pub fn add_middleware(&mut self, mw: HandlerObj)

source

pub fn add_route(
    &mut self,
    route: &'static str,
    value: HandlerObj
) -> Result<&mut Node, RouterError>

source

pub fn get(
    &self,
    path: &str
) -> Result<impl Iterator<Item = HandlerObj>, RouterError>

Trait Implementations§

source§

impl Clone for Router

source§

fn clone(&self) -> Router

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl NewService for Router

§

type ReqBody = Body

The Payload body of the http::Request.
§

type ResBody = Body

The Payload body of the http::Response.
§

type Error = Error

The error type that can be returned by Services.
§

type InitError = Error

The error type that can be returned when creating a new Service.
§

type Service = Router

The resolved Service from new_service().
§

type Future = Box<dyn Future<Item = <Router as NewService>::Service, Error = <Router as NewService>::InitError> + Send + 'static, Global>

The future returned from new_service of a Service.
source§

fn new_service(&self) -> Self::Future

Create a new Service.
source§

impl Service for Router

§

type ReqBody = Body

The Payload body of the http::Request.
§

type ResBody = Body

The Payload body of the http::Response.
§

type Error = Error

The error type that can occur within this Service. Read more
§

type Future = Box<dyn Future<Item = Response<Body>, Error = Error> + Send + 'static, Global>

The Future returned by this Service.
source§

fn call(&mut self, req: Request<Self::ReqBody>) -> Self::Future

Calls this Service with a request, returning a Future of the response.
source§

fn poll_ready(&mut self) -> Result<Async<()>, Self::Error>

Returns Ready when the service is able to process requests. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Router

§

impl Send for Router

§

impl Sync for Router

§

impl Unpin for Router

§

impl !UnwindSafe for Router

Blanket Implementations§

source§

impl<T> Any for Twhere
    T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneAny for Twhere
    T: Any + Clone,

§

fn clone_any(&self) -> Box<dyn CloneAny + 'static, Global>

§

fn clone_any_send(&self) -> Box<dyn CloneAny + Send + 'static, Global>where
    T: Send,

§

fn clone_any_sync(&self) -> Box<dyn CloneAny + Sync + 'static, Global>where
    T: Sync,

§

fn clone_any_send_sync(
    &self
) -> Box<dyn CloneAny + Send + Sync + 'static, Global>where
    T: Send + Sync,

§

impl<'a, T> DefaultFeatures<'a> for Twhere
    T: 'a + Send + Sync + Clone,

§

fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a, Global>

Clone this value, and then immediately put it into a Box behind a trait object of this trait.
§

fn self_address_mut(&mut self) -> *mut ()

Returns the address of self. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
    U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<N, Ctx> MakeService<Ctx> for Nwhere
    N: NewService,

§

type ReqBody = <N as NewService>::ReqBody

The Payload body of the http::Request.
§

type ResBody = <N as NewService>::ResBody

The Payload body of the http::Response.
§

type Error = <N as NewService>::Error

The error type that can be returned by Services.
§

type Service = <N as NewService>::Service

The resolved Service from new_service().
§

type Future = <N as NewService>::Future

The future returned from new_service of a Service.
§

type MakeError = <N as NewService>::InitError

The error type that can be returned when creating a new Service.
source§

fn poll_ready(
    &mut self
) -> Result<Async<()>, <N as MakeService<Ctx>>::MakeError>

Returns Ready when the constructor is ready to create a new Service. Read more
source§

fn make_service(&mut self, _: Ctx) -> <N as MakeService<Ctx>>::Future

Create a new Service.
§

impl<'a, T> NonSyncFeatures<'a> for Twhere
    T: 'a + Clone,

§

fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a, Global>

Clone this value, and then immediately put it into a Box behind a trait object of this trait.
§

fn self_address_mut(&mut self) -> *mut ()

Returns the address of self. Read more
§

impl<T> SafeBorrow<T> for Twhere
    T: ?Sized,

§

fn borrow_replacement(ptr: &T) -> &T

Given ptr, which was obtained from a prior call to Self::borrow(), return a value with the same nominal lifetime which is guaranteed to survive mutations to Self. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere
    T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
    U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Erased for T

§

impl<T> UnsafeAny for Twhere
    T: Any,