pub struct RouteBuilder<S = ()>{ /* private fields */ }
Expand description
Builder for creating routes with middleware groups and additional metadata
Implementations§
Source§impl<S> RouteBuilder<S>
impl<S> RouteBuilder<S>
pub fn new(router: Router<S>, path: String) -> Self
Sourcepub fn get<F, Fut, R>(self, handler: F) -> Router<S>where
F: Fn(ElifRequest) -> Fut + Send + Clone + 'static,
Fut: Future<Output = HttpResult<R>> + Send + 'static,
R: IntoElifResponse + Send + 'static,
pub fn get<F, Fut, R>(self, handler: F) -> Router<S>where
F: Fn(ElifRequest) -> Fut + Send + Clone + 'static,
Fut: Future<Output = HttpResult<R>> + Send + 'static,
R: IntoElifResponse + Send + 'static,
Add a GET route with elif handler
Sourcepub fn post<F, Fut, R>(self, handler: F) -> Router<S>where
F: Fn(ElifRequest) -> Fut + Send + Clone + 'static,
Fut: Future<Output = HttpResult<R>> + Send + 'static,
R: IntoElifResponse + Send + 'static,
pub fn post<F, Fut, R>(self, handler: F) -> Router<S>where
F: Fn(ElifRequest) -> Fut + Send + Clone + 'static,
Fut: Future<Output = HttpResult<R>> + Send + 'static,
R: IntoElifResponse + Send + 'static,
Add a POST route with elif handler
Sourcepub fn put<F, Fut, R>(self, handler: F) -> Router<S>where
F: Fn(ElifRequest) -> Fut + Send + Clone + 'static,
Fut: Future<Output = HttpResult<R>> + Send + 'static,
R: IntoElifResponse + Send + 'static,
pub fn put<F, Fut, R>(self, handler: F) -> Router<S>where
F: Fn(ElifRequest) -> Fut + Send + Clone + 'static,
Fut: Future<Output = HttpResult<R>> + Send + 'static,
R: IntoElifResponse + Send + 'static,
Add a PUT route with elif handler
Sourcepub fn delete<F, Fut, R>(self, handler: F) -> Router<S>where
F: Fn(ElifRequest) -> Fut + Send + Clone + 'static,
Fut: Future<Output = HttpResult<R>> + Send + 'static,
R: IntoElifResponse + Send + 'static,
pub fn delete<F, Fut, R>(self, handler: F) -> Router<S>where
F: Fn(ElifRequest) -> Fut + Send + Clone + 'static,
Fut: Future<Output = HttpResult<R>> + Send + 'static,
R: IntoElifResponse + Send + 'static,
Add a DELETE route with elif handler
Sourcepub fn patch<F, Fut, R>(self, handler: F) -> Router<S>where
F: Fn(ElifRequest) -> Fut + Send + Clone + 'static,
Fut: Future<Output = HttpResult<R>> + Send + 'static,
R: IntoElifResponse + Send + 'static,
pub fn patch<F, Fut, R>(self, handler: F) -> Router<S>where
F: Fn(ElifRequest) -> Fut + Send + Clone + 'static,
Fut: Future<Output = HttpResult<R>> + Send + 'static,
R: IntoElifResponse + Send + 'static,
Add a PATCH route with elif handler
Auto Trait Implementations§
impl<S> Freeze for RouteBuilder<S>
impl<S = ()> !RefUnwindSafe for RouteBuilder<S>
impl<S> Send for RouteBuilder<S>
impl<S> Sync for RouteBuilder<S>
impl<S> Unpin for RouteBuilder<S>
impl<S = ()> !UnwindSafe for RouteBuilder<S>
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