Struct actix_web::Route [] [src]

pub struct Route<S> { /* fields omitted */ }

Resource route definition

Route uses builder-like pattern for configuration. If handler is not explicitly set, default 404 Not Found handler is used.

Methods

impl<S: 'static> Route<S>
[src]

[src]

Add match predicate to route.

Application::new()
   .resource("/path", |r|
      r.route()
         .filter(pred::Get())
         .filter(pred::Header("content-type", "text/plain"))
         .f(|req| HttpOk)
      )

[src]

Set handler object. Usually call to this method is last call during route configuration, because it does not return reference to self.

[src]

Set handler function. Usually call to this method is last call during route configuration, because it does not return reference to self.

[src]

Set async handler function.

Trait Implementations

impl<S: 'static> Default for Route<S>
[src]

[src]

Returns the "default value" for a type. Read more