A base class for all rules. More...
Public Member Functions | |
BaseRule (std::string rule) | |
virtual | ~BaseRule () |
virtual void | validate ()=0 |
std::unique_ptr< BaseRule > | upgrade () |
virtual void | handle (request &, response &, const routing_params &)=0 |
virtual void | handle_upgrade (const request &, response &res, SocketAdaptor &&) |
uint32_t | get_methods () |
template<typename F > | |
void | foreach_method (F f) |
const std::string & | rule () |
Public Attributes | |
std::string | custom_templates_base |
Protected Attributes | |
uint32_t | methods_ {1 << static_cast<int>(HTTPMethod::Get)} |
std::string | rule_ |
std::string | name_ |
std::unique_ptr< BaseRule > | rule_to_upgrade_ |
Friends | |
class | Router |
class | Blueprint |
template<typename T > | |
struct | RuleParameterTraits |
A base class for all rules.
Used to provide a common interface for code dealing with different types of rules.
A Rule provides a URL, allowed HTTP methods, and handlers.
|
inline |
|
inlinevirtual |
|
pure virtual |
Implemented in crow::TaggedRule< Args >, crow::DynamicRule, and crow::WebSocketRule.
|
inline |
|
pure virtual |
Implemented in crow::TaggedRule< Args >, crow::DynamicRule, and crow::WebSocketRule.
|
inlinevirtual |
|
inline |
|
inline |
|
inline |
|
friend |
|
friend |
|
friend |
std::string crow::BaseRule::custom_templates_base |
|
protected |
|
protected |
|
protected |
|
protected |