pub struct Route { /* private fields */ }
Expand description
A route that has been configured but has not yet been registered with a Blueprint
.
§Guide
Check out the “Routing” section of Pavex’s guide for a thorough introduction to routing in Pavex applications.
§Use cases
Route
is primarily used by
kits
to allow users to customize (or disable!)
the bundled routes before registering them with a Blueprint
.
Implementations§
source§impl Route
impl Route
sourcepub fn new(
method_guard: MethodGuard,
path: &str,
callable: RawIdentifiers,
) -> Self
pub fn new( method_guard: MethodGuard, path: &str, callable: RawIdentifiers, ) -> Self
Create a new (unregistered) route.
Check out the documentation of Blueprint::route
for more details
on routes.
sourcepub fn error_handler(self, error_handler: RawIdentifiers) -> Self
pub fn error_handler(self, error_handler: RawIdentifiers) -> Self
Register an error handler for this route.
Check out the documentation of RegisteredRoute::error_handler
for more details.
sourcepub fn register(self, bp: &mut Blueprint) -> RegisteredRoute<'_>
pub fn register(self, bp: &mut Blueprint) -> RegisteredRoute<'_>
Register this route with a Blueprint
.
Check out the documentation of Blueprint::route
for more details.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Route
impl RefUnwindSafe for Route
impl Send for Route
impl Sync for Route
impl Unpin for Route
impl UnwindSafe for Route
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)