]> git.proxmox.com Git - proxmox-backup.git/blob - src/main.rs
move code into lib.rs
[proxmox-backup.git] / src / main.rs
1 #![feature(plugin)]
2 #![plugin(phf_macros)]
3 extern crate phf;
4
5 extern crate failure;
6
7 extern crate json_schema;
8 use json_schema::*;
9
10
11 static PARAMETERS1: StaticPropertyMap = phf_map! {
12 "force" => Boolean!{
13 description => "Test for boolean options."
14 },
15 "text1" => ApiString!{
16 description => "A simple text string.",
17 min_length => Some(10),
18 max_length => Some(30)
19 },
20 "count" => Integer!{
21 description => "A counter for everything.",
22 minimum => Some(0),
23 maximum => Some(10)
24 },
25 "myarray1" => Array!{
26 description => "Test Array of simple integers.",
27 items => &PVE_VMID
28 },
29 "myarray2" => Jss::Array(JssArray {
30 description: "Test Array of simple integers.",
31 optional: Some(false),
32 items: &Object!{description => "Empty Object."},
33 }),
34 "myobject" => Object!{
35 description => "TEST Object.",
36 properties => &phf_map!{
37 "vmid" => Jss::Reference { reference: &PVE_VMID},
38 "loop" => Integer!{
39 description => "Totally useless thing.",
40 optional => Some(false)
41 }
42 }
43 },
44 "emptyobject" => Object!{description => "Empty Object."},
45 };
46
47
48 fn main() {
49 println!("Fast Static Type Definitions 1");
50
51 for (k, v) in PARAMETERS1.entries() {
52 println!("Parameter: {} Value: {:?}", k, v);
53 }
54
55 }