IAB Rust
This library provides strongly-typed structures for OpenRTB, AdCOM, and other specifications published by the Interactive Advertising Bureau (IAB) for the Rust programming language.
The primary goal is to define these types in an idiomatic Rust way, adhering strictly to the official specifications. This allows for easier integration and validation of OpenRTB-based protocols within Rust applications.
Complete
Roadmap
The following specifications are planned for future implementation:
Creating a Bid Request
Below is an example of creating a bid request:
use *;
use serde_json;
let request = BidRequest ;
let output = to_string_pretty.expect;
Parsing a Bid Request
Below is an example of parsing a bid request:
use *;
use ;
let data = r#"
{
"id": "80ce30c53c16e6ede735f123ef6e32361bfc7b22",
"at": 1,
"cur": ["USD"],
"imp": [
{ "id": "1", "bidfloor": 0.03, "banner": {"h": 250, "w": 300, "pos": 0} }
],
"site": {
"id": "102855",
"cat": ["IAB3-1"],
"domain": "www.foobar.com",
"page": "http://www.foobar.com/1234.html",
"publisher": {
"id": "8953",
"name": "foobar.com",
"cat": ["IAB3-1"],
"domain": "foobar.com"
}
},
"user": {"id": "55816b39711f9b5acf3b90e313ed29e51665623f"}
}"#;
// Parse the Bid Request JSON
let br: BidRequest = from_str.unwrap;
// Do things just like with any other Rust data structure
println!;
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.