pub struct RouterBuilder { /* private fields */ }
Expand description
Builder for a Router
Implementations§
Source§impl RouterBuilder
impl RouterBuilder
Sourcepub fn wrapped_data<T: Send + Sync + 'static>(self, data: Data<T>) -> Self
pub fn wrapped_data<T: Send + Sync + 'static>(self, data: Data<T>) -> Self
Add application data
to router from an existing Data<T>
object
Sourcepub fn add_not_found<H>(self, handler: H) -> Self
pub fn add_not_found<H>(self, handler: H) -> Self
Set the 404: Not Found
handler
Sourcepub fn add<H>(self, method: Method, regex: &str, handler: H) -> Self
pub fn add<H>(self, method: Method, regex: &str, handler: H) -> Self
Add handler for method and regex. Highest priority wins. Priority is 0 by default.
Sourcepub fn add_with_priority<H>(
self,
method: Method,
regex: &str,
priority: i8,
handler: H,
) -> Self
pub fn add_with_priority<H>( self, method: Method, regex: &str, priority: i8, handler: H, ) -> Self
Add handler for method, regex, and priority. Highest priority wins.
Auto Trait Implementations§
impl Freeze for RouterBuilder
impl !RefUnwindSafe for RouterBuilder
impl Send for RouterBuilder
impl Sync for RouterBuilder
impl Unpin for RouterBuilder
impl !UnwindSafe for RouterBuilder
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