pub struct RootedRouter<'a> { /* private fields */ }Expand description
Specialised router to mount endpoints under a fixed root.
The root’s prefix is automatically prepended to the URI handlers are
registered with as well as the the Iron ::router::Router id.
Implementations§
Source§impl<'a> RootedRouter<'a>
impl<'a> RootedRouter<'a>
Sourcepub fn delete<S: AsRef<str>, H: Handler, I: AsRef<str>>(
&mut self,
glob: S,
handler: H,
route_id: I,
) -> &mut RootedRouter<'a>
pub fn delete<S: AsRef<str>, H: Handler, I: AsRef<str>>( &mut self, glob: S, handler: H, route_id: I, ) -> &mut RootedRouter<'a>
Like route, but specialized to the DELETE method.
Sourcepub fn get<S: AsRef<str>, H: Handler, I: AsRef<str>>(
&mut self,
glob: S,
handler: H,
route_id: I,
) -> &mut RootedRouter<'a>
pub fn get<S: AsRef<str>, H: Handler, I: AsRef<str>>( &mut self, glob: S, handler: H, route_id: I, ) -> &mut RootedRouter<'a>
Like route, but specialized to the GET method.
Sourcepub fn post<S: AsRef<str>, H: Handler, I: AsRef<str>>(
&mut self,
glob: S,
handler: H,
route_id: I,
) -> &mut RootedRouter<'a>
pub fn post<S: AsRef<str>, H: Handler, I: AsRef<str>>( &mut self, glob: S, handler: H, route_id: I, ) -> &mut RootedRouter<'a>
Like route, but specialized to the POST method.
Sourcepub fn put<S: AsRef<str>, H: Handler, I: AsRef<str>>(
&mut self,
glob: S,
handler: H,
route_id: I,
) -> &mut RootedRouter<'a>
pub fn put<S: AsRef<str>, H: Handler, I: AsRef<str>>( &mut self, glob: S, handler: H, route_id: I, ) -> &mut RootedRouter<'a>
Like route, but specialized to the PUT method.
Sourcepub fn route<S: AsRef<str>, H: Handler, I: AsRef<str>>(
&mut self,
method: Method,
glob: S,
handler: H,
route_id: I,
) -> &mut RootedRouter<'a>
pub fn route<S: AsRef<str>, H: Handler, I: AsRef<str>>( &mut self, method: Method, glob: S, handler: H, route_id: I, ) -> &mut RootedRouter<'a>
Wrapper for Router::route with additional features.
Auto Trait Implementations§
impl<'a> Freeze for RootedRouter<'a>
impl<'a> !RefUnwindSafe for RootedRouter<'a>
impl<'a> Send for RootedRouter<'a>
impl<'a> Sync for RootedRouter<'a>
impl<'a> Unpin for RootedRouter<'a>
impl<'a> UnsafeUnpin for RootedRouter<'a>
impl<'a> !UnwindSafe for RootedRouter<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more