1
1
use crate :: BigNum ;
2
- use serde:: { Deserialize , Serialize } ;
3
2
use std:: collections:: HashMap ;
4
3
5
4
pub use eval:: * ;
6
5
7
6
mod eval;
8
7
9
- #[ derive( Debug , Serialize , Deserialize ) ]
8
+ #[ derive( Debug , Clone ) ]
10
9
#[ cfg_attr( test, derive( Default ) ) ]
11
- #[ serde( rename_all = "camelCase" ) ]
12
10
pub struct Input {
13
11
/// AdView scope, accessible only on the AdView
14
- #[ serde( default ) ]
15
12
pub ad_view : Option < AdView > ,
16
13
/// Global scope, accessible everywhere
17
- #[ serde( flatten) ]
18
14
pub global : Global ,
19
15
/// adSlot scope, accessible on Supermarket and AdView
20
- #[ serde( default ) ]
21
16
pub ad_slot : Option < AdSlot > ,
22
17
}
23
18
@@ -90,17 +85,15 @@ impl Input {
90
85
}
91
86
}
92
87
93
- #[ derive( Debug , Serialize , Deserialize ) ]
88
+ #[ derive( Debug , Clone ) ]
94
89
#[ cfg_attr( test, derive( Default ) ) ]
95
- #[ serde( rename_all = "camelCase" ) ]
96
90
pub struct AdView {
97
91
pub seconds_since_show : u64 ,
98
92
pub has_custom_preferences : bool ,
99
93
}
100
94
101
- #[ derive( Debug , Serialize , Deserialize ) ]
95
+ #[ derive( Debug , Clone ) ]
102
96
#[ cfg_attr( test, derive( Default ) ) ]
103
- #[ serde( rename_all = "camelCase" ) ]
104
97
pub struct Global {
105
98
pub ad_slot_id : String ,
106
99
pub ad_unit_id : String ,
@@ -118,14 +111,12 @@ pub struct Global {
118
111
pub event_max_price : BigNum ,
119
112
pub publisher_earned_from_campaign : BigNum ,
120
113
pub seconds_since_epoch : u64 ,
121
- #[ serde( rename = "userAgentOS" ) ]
122
114
pub user_agent_os : String ,
123
115
pub user_agent_browser_family : String ,
124
116
}
125
117
126
- #[ derive( Debug , Serialize , Deserialize ) ]
118
+ #[ derive( Debug , Clone ) ]
127
119
#[ cfg_attr( test, derive( Default ) ) ]
128
- #[ serde( rename_all = "camelCase" ) ]
129
120
pub struct AdSlot {
130
121
pub categories : Vec < String > ,
131
122
pub hostname : String ,
0 commit comments