1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//! ## Module Organization
//!
//! - [`adcom`] - AdCOM 1.0 enumerations (device types, auction types, protocols, etc.)
//! - [`openrtb`] - OpenRTB 2.5, 2.6, 3.0, and Native Ads 1.2 specifications
//! - [`openrtb::v25`] - OpenRTB 2.5 specification
//! - [`openrtb::v26`] - OpenRTB 2.6 with CTV and DOOH support
//! - [`openrtb::v30`] - OpenRTB 3.0 with layered architecture
//! - [`openrtb::common`] - Common objects shared between versions
//! - [`openrtb_native`] - OpenRTB Native Ads 1.2 specification
//! - [`artb`] - Agentic RTB Framework 1.0 specification
//! - [`artb::v10`] - ARTB 1.0 with OpenRTB Patch Protocol
//! - [`ads_txt`] - Ads.txt 1.1 parser and generator
//! - [`app_ads_txt`] - App-ads.txt 1.0 parser and generator
//! - [`sellers_json`] - Sellers.json 1.0 parser and generator
//!
//! ## Extension Trait
//!
//! The [`Extension`] trait provides a flexible mechanism for adding custom fields to IAB
//! specification objects throughout the crate. This is essential for:
//! - **Vendor-specific data**: Add custom fields for your platform
//! - **Internal tracking**: Include business-specific identifiers
//! - **Experimental features**: Test new capabilities without spec changes
//! - **Custom workflows**: Extend objects with application-specific data
//!
//! ### Types Supporting Extensions
//!
//! Many types across the crate support generic extensions via the `Ext` type parameter:
//!
//! - **AdCOM types**: [`adcom::media::Ad`], [`adcom::placement::Placement`], [`adcom::context::Site`],
//! [`adcom::context::App`], [`adcom::context::User`], [`adcom::context::Device`], and many more
//! - **OpenRTB 2.5/2.6**: [`openrtb::v25::BidRequest`], [`openrtb::v25::BidResponse`],
//! [`openrtb::v25::Imp`], [`openrtb::v25::Banner`], [`openrtb::v25::Video`], and many more
//! - **OpenRTB 3.0**: [`openrtb::v30::Request`], [`openrtb::v30::Response`], [`openrtb::v30::Item`],
//! [`openrtb::v30::Bid`], and many more
//!
//! ### Quick Examples
//!
//! **Using default `Vec<u8>` extensions (opaque bytes):**
//!
//! ```
//! #[cfg(feature = "adcom")]
//! {
//! use iab_specs::adcom::media::Ad;
//! # use std::error::Error;
//! # fn main() -> Result<(), Box<dyn Error>> {
//!
//! // DefaultExt is Vec<u8>
//! let ad = Ad::builder()
//! .id(Some("ad123".to_string()))
//! .ext(Some(Box::new(vec![0x08, 0x96, 0x01])))
//! .build()?;
//! # Ok(())
//! # }
//! }
//! ```
//!
//! **Using explicit JSON extensions:**
//!
//! ```
//! #[cfg(feature = "adcom")]
//! {
//! use iab_specs::adcom::media::AdBuilder;
//! # use std::error::Error;
//! # fn main() -> Result<(), Box<dyn Error>> {
//!
//! let ad = AdBuilder::<serde_json::Value>::default()
//! .id(Some("ad123".to_string()))
//! .ext(Some(Box::new(serde_json::json!({
//! "vendor_id": "acme-123",
//! "campaign_type": "seasonal"
//! }))))
//! .build()?;
//! # Ok(())
//! # }
//! }
//! ```
//!
//! **Using custom typed extensions:**
//!
//! ```
//! #[cfg(feature = "adcom")]
//! {
//! use iab_specs::adcom::media::{Ad, AdBuilder};
//! use serde::{Deserialize, Serialize};
//! use derive_builder::Builder;
//! # use std::error::Error;
//! # fn main() -> Result<(), Box<dyn Error>> {
//!
//! #[derive(Builder, Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
//! struct MyAdExt {
//! vendor_id: String,
//! priority: u8,
//! }
//!
//! impl MyAdExt {
//! pub fn builder() -> MyAdExtBuilder {
//! MyAdExtBuilder::create_empty()
//! }
//! }
//!
//! let ext = MyAdExt::builder()
//! .vendor_id("acme-123".to_string())
//! .priority(5)
//! .build()?;
//!
//! // Use AdBuilder with type parameter for custom extensions
//! let ad = AdBuilder::default()
//! .id(Some("ad123".to_string()))
//! .ext(Some(Box::new(ext)))
//! .build()?;
//! # Ok(())
//! # }
//! }
//! ```
//!
//! For complete documentation and more examples, see the [`Extension`] trait documentation.
// Always re-export core
pub use *;
pub use iab_specs_adcom as adcom;
pub use iab_specs_ads_txt as ads_txt;
pub use iab_specs_agentic_audience as agentic_audience;
pub use iab_specs_agentic_direct as agentic_direct;
pub use iab_specs_app_ads_txt as app_ads_txt;
pub use iab_specs_artb as artb;
pub use iab_specs_buyer_agent as buyer_agent;
pub use iab_specs_openrtb as openrtb;
pub use iab_specs_openrtb_native as openrtb_native;
pub use iab_specs_registry_agent as registry_agent;
pub use iab_specs_seller_agent as seller_agent;
pub use iab_specs_sellers_json as sellers_json;