~lthms/typed-urls

ref: 576febfee5bb0f8b24635e3f510a68e401832ec6 typed-urls/tests/simple.rs -rw-r--r-- 490 bytes
576febfeThomas Letan Rename into typed-urls 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 typed_urls_derive;

#[derive(TypedUrl)]
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,
    },
}