class_docstr: Rule-based router implementation.
class_docstr_tok: ["Rule-based","router","implementation","."]
docstr: Constructs a router from an ordered list of rules::
  
      RuleRouter([
          Rule(PathMatches("/handler"), Target),
          # ... more rules
      ])
  
  You can also omit explicit `Rule` constructor and use tuples of arguments::
  
      RuleRouter([
          (PathMatches("/handler"), Target),
      ])
  
  `PathMatches` is a default matcher, so the example above can be simplified::
  
      RuleRouter([
          ("/handler", Target),
      ])
  
  In the examples above, ``Target`` can be a nested `Router` instance, an instance of
  `~.httputil.HTTPServerConnectionDelegate` or an old-style callable, accepting a request argument.
  
  :arg rules: a list of `Rule` instances or tuples of `Rule`
      constructor arguments.
docstr_tok: ["Constructs","a","router","from","an","ordered","list","of","rules",":",":","RuleRouter","(","[","Rule","(","PathMatches","(","``","\/handler","''",")",",","Target",")",",","#","...","more","rules","]",")","You","can","also","omit","explicit","`","Rule","`","constructor","and","use","tuples","of","arguments",":",":","RuleRouter","(","[","(","PathMatches","(","``","\/handler","''",")",",","Target",")",",","]",")","`","PathMatches","`","is","a","default","matcher",",","so","the","example","above","can","be","simplified",":",":","RuleRouter","(","[","(","``","\/handler","''",",","Target",")",",","]",")","In","the","examples","above",",","``","Target","``","can","be","a","nested","`","Router","`","instance",",","an","instance","of","`","~.httputil.HTTPServerConnectionDelegate","`","or","an","old-style","callable",",","accepting","a","request","argument",".",":","arg","rules",":","a","list","of","`","Rule","`","instances","or","tuples","of","`","Rule","`","constructor","arguments","."]
code: def __init__(self, rules=None):
      """Constructs a router from an ordered list of rules::
  
          RuleRouter([
              Rule(PathMatches("/handler"), Target),
              # ... more rules
          ])
  
      You can also omit explicit `Rule` constructor and use tuples of arguments::
  
          RuleRouter([
              (PathMatches("/handler"), Target),
          ])
  
      `PathMatches` is a default matcher, so the example above can be simplified::
  
          RuleRouter([
              ("/handler", Target),
          ])
  
      In the examples above, ``Target`` can be a nested `Router` instance, an instance of
      `~.httputil.HTTPServerConnectionDelegate` or an old-style callable, accepting a request argument.
  
      :arg rules: a list of `Rule` instances or tuples of `Rule`
          constructor arguments.
      """
      self.rules = []  # type: typing.List[Rule]
      if rules:
          self.add_rules(rules)
  
imports: from __future__ import absolute_import, division, print_function
  import re
  from functools import partial
  from tornado import httputil
  from tornado.httpserver import _CallableAdapter
  from tornado.escape import url_escape, url_unescape, utf8
  from tornado.log import app_log
  from tornado.util import basestring_type, import_object, re_unescape, unicode_type
label_desc: Use image node_id 1 to create a new RuleRouter object from inherited base classes: Router with example: obj = RuleRouter(rules)