pub struct Route<T> {
pub path: String,
pub request_type: RequestType,
pub handler: Box<fn(_: Request, _: DatabaseConnection, _: T) -> Pin<Box<dyn Future<Output = Result<Response, RouteError>>>>>,
}
Expand description
A wrapper for a route.
This struct is created by the #[route(METHOD path)]
macro,
when a function is decorated with that macro, the function is
rewritten such that it returns the Route.
Manually creating this struct is not recommended.
use the tusk_rs_derive::route
macro instead.
Fields§
§path: String
§request_type: RequestType
§handler: Box<fn(_: Request, _: DatabaseConnection, _: T) -> Pin<Box<dyn Future<Output = Result<Response, RouteError>>>>>
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Route<T>
impl<T> RefUnwindSafe for Route<T>
impl<T> Send for Route<T>
impl<T> Sync for Route<T>
impl<T> Unpin for Route<T>
impl<T> UnwindSafe for Route<T>
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