~lthms/typed-urls

ref: c6c6be84b757fb0da15cb08478b418cc44680d40 typed-urls/tests/simple.rs -rw-r--r-- 484 bytes
c6c6be84Thomas Letan Clean-up the code 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#[macro_use]
extern crate routes_derive;

#[derive(Routes)]
pub enum Url {
    #[routefmt = "/worlds"]
    Worlds,
    #[routefmt = "/worlds/{}"]
    World { world_key : String },
    #[routefmt = "/worlds/{}/character/{}"]
    Character {
        world_key : String,
        character_key : String,
    },
    #[routefmt = "/worlds/{}/map/{}/tile/{}/{}/{}"]
    Tile {
        world_key : String,
        map_key : String,
        x : i32,
        y : i32,
        z : i32,
    },
}