use-route 0.0.1

Small route and path utilities for RustUse
Documentation
  • Coverage
  • 76.92%
    10 out of 13 items documented1 out of 10 items with examples
  • Size
  • Source code size: 8.01 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 396.13 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Documentation
  • RustUse/use-web
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-route

Small route and path utilities for RustUse.

Experimental

use-route is experimental while the use-web workspace remains below 0.3.0. Expect small API adjustments during the first release wave.

Example

use use_route::{extract_route_params, matches_route_pattern, normalize_route};

assert_eq!(normalize_route("//users//42/"), "/users/42");
assert!(matches_route_pattern("/users/:id", "/users/42"));
assert_eq!(extract_route_params("/users/:id", "/users/42")[0].value, "42");

Scope

  • Route normalization and joining.
  • Simple segment splitting and depth counting.
  • Lightweight :param pattern matching.

Non-goals

  • Full routers.
  • Middleware.
  • Regex route engines.
  • Server implementations.

License

Licensed under either of the following, at your option:

  • Apache License, Version 2.0
  • MIT license