Struct stack_epic_api::Router
source · pub struct Router { /* private fields */ }Implementations§
source§impl Router
impl Router
pub fn new() -> Router
pub fn add_middleware(&mut self, mw: HandlerObj)
pub fn add_route(
&mut self,
route: &'static str,
value: HandlerObj
) -> Result<&mut Node, RouterError>
pub fn get(
&self,
path: &str
) -> Result<impl Iterator<Item = HandlerObj>, RouterError>
Trait Implementations§
source§impl NewService for Router
impl NewService for Router
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§
§impl<T> CloneAny for Twhere
T: Any + Clone,
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,
impl<'a, T> DefaultFeatures<'a> for Twhere
T: 'a + Send + Sync + Clone,
§fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a, Global>
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 ()
fn self_address_mut(&mut self) -> *mut ()
Returns the address of
self. Read moresource§impl<N, Ctx> MakeService<Ctx> for Nwhere
N: NewService,
impl<N, Ctx> MakeService<Ctx> for Nwhere
N: NewService,
§type ReqBody = <N as NewService>::ReqBody
type ReqBody = <N as NewService>::ReqBody
The
Payload body of the http::Request.§type ResBody = <N as NewService>::ResBody
type ResBody = <N as NewService>::ResBody
The
Payload body of the http::Response.§type Error = <N as NewService>::Error
type Error = <N as NewService>::Error
The error type that can be returned by
Services.§type Service = <N as NewService>::Service
type Service = <N as NewService>::Service
The resolved
Service from new_service().§type Future = <N as NewService>::Future
type Future = <N as NewService>::Future
The future returned from
new_service of a Service.§type MakeError = <N as NewService>::InitError
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>
fn poll_ready(
&mut self
) -> Result<Async<()>, <N as MakeService<Ctx>>::MakeError>
source§fn make_service(&mut self, _: Ctx) -> <N as MakeService<Ctx>>::Future
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,
impl<'a, T> NonSyncFeatures<'a> for Twhere
T: 'a + Clone,
§fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a, Global>
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 ()
fn self_address_mut(&mut self) -> *mut ()
Returns the address of
self. Read more§impl<T> SafeBorrow<T> for Twhere
T: ?Sized,
impl<T> SafeBorrow<T> for Twhere
T: ?Sized,
§fn borrow_replacement(ptr: &T) -> &T
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