Module toad::server::path

source ·
Expand description

Path manipulation

  • segment
    • next() - consume the next segment of the route & combine it with data in the Ap
    • check
      • next_is() - assert that the next route segment matches a predicate
      • next_equals() - assert that the next route segment equals a string
    • param
      • u32() - consume the next route segment and parse as u32, rejecting the request if parsing fails.
  • rest() - extract the full route, skipping consumed segments & combine it with data in the Ap
  • check
    • rest_is() - assert that the rest of the route matches a predicate
    • rest_equals() - assert that the rest of the route matches a string
    • ends_with() - assert that the rest of the route ends with a string

Modules

  • Helper functions for adding filters against whole paths
  • Manipulate & match against path segments

Functions

  • Get the rest of the request path, skipping any consumed segments.