You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,7 @@
38
38
- Added request caching mechanism using SQLite with configurable TTL and max size.
39
39
- Added configuration options for the cache.
40
40
- Deserialize callbacks with `url::Url`
41
+
- Support for multiple ads request (with count)
41
42
42
43
### Relay
43
44
- **⚠️ Breaking Change:** The error handling for the Relay component has been refactored for stronger forward compatibility and more transparent error reporting in Swift and Kotlin via UniFFI.
Copy file name to clipboardExpand all lines: components/ads-client/docs/usage.md
+66-78Lines changed: 66 additions & 78 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
-
2
1
# Mozilla Ads Client (MAC) — UniFFI API Reference
3
2
4
3
## Overview
4
+
5
5
This document lists the Rust types and functions exposed via UniFFI by the `ads_client` component.
6
6
It only includes items that are part of the UniFFI surface. This document is aimed at users of the ads-client who want to know what is available to them.
7
7
@@ -30,20 +30,22 @@ If a cache configuration is provided, the client will initialize an on-disk HTTP
|`placement_id`|`String`| Unique identifier for the ad placement. Must be unique within one `request_ads` call. |
109
+
|`iab_content`|`Option<IABContent>`| Optional IAB content classification for targeting.|
111
110
112
111
**Validation Rules:**
112
+
113
113
-`placement_id` values must be unique per request.
114
114
115
115
---
116
116
117
+
## `MozAdsPlacementRequestWithCount`
118
+
119
+
Describes a single ad placement and the maximum number of ads to request for that placement. A vector of these is used by the `request_ads_multiset` method on the client.
|`mode`|`CacheMode`| Strategy for combining cache and network. Can be `CacheFirst` or `NetworkFirst`. |
160
+
|`mode`|`CacheMode`| Strategy for combining cache and network. Can be `CacheFirst` or `NetworkFirst`. |
149
161
|`ttl_seconds`|`Option<u64>`| Optional per-request TTL override in seconds. `None` uses the client default. `Some(0)` disables caching for this request. |
|`category_ids`|`Vec<String>`| One or more IAB category identifiers. |
254
242
255
243
---
256
244
257
245
## `IABContentTaxonomy`
258
246
259
-
The [IAB Content Taxonomy](https://www.iab.com/guidelines/content-taxonomy/) version to be used in the request. e.g `IAB-1.0`
247
+
The [IAB Content Taxonomy](https://www.iab.com/guidelines/content-taxonomy/) version to be used in the request. e.g `IAB-1.0`
260
248
261
249
```rust
262
250
pubenumIABContentTaxonomy {
@@ -267,6 +255,7 @@ pub enum IABContentTaxonomy {
267
255
IAB3_0,
268
256
}
269
257
```
258
+
270
259
> Note: The generated native bindings for the values may look different depending on the language (snake-case, camel case, etc.) as a result of UniFFI's formatting.
271
260
272
261
---
@@ -331,7 +320,6 @@ let options = MozAdsRequestOptions(
@@ -342,7 +330,7 @@ At the start of each send, the cache computes a cutoff from chrono::Utc::now() -
342
330
After storing a cacheable miss, the cache enforces max_size by deleting the oldest rows until the total stored size is ≤ the maximum allowed size of the cache. Due to the small size of items in the cache and the relatively short TTL, this behavior should be rare.
343
331
344
332
**Manual clearing (explicit):**
345
-
The cache can be manually cleared by the client using the exposed `client.clear_cache()` method. This clears *all* objects in the cache.
333
+
The cache can be manually cleared by the client using the exposed `client.clear_cache()` method. This clears _all_ objects in the cache.
0 commit comments