Skip to main content

data_for_seo/entity/backlinks/
domain_intersection.rs

1use crate::entity::BacklinksApiElementBacklinksDomainIntersection;
2use serde::{Deserialize, Serialize};
3use serde_json::Value;
4use std::collections::HashMap;
5
6/// Result of the Domain Intersection endpoint: domains linking to several targets at once.
7/// See <https://docs.dataforseo.com/v3/backlinks/domain_intersection/live/>.
8#[derive(Debug, Default, Serialize, Deserialize, Clone)]
9pub struct BacklinksApiDomainIntersection {
10    /// Targets to analyze (domains, subdomains, or webpages).
11    pub targets: Option<Value>,
12    /// Total number of relevant elements in the database.
13    pub total_count: Option<i64>,
14    /// Number of elements in the `items` array.
15    pub items_count: Option<i64>,
16    /// Elements returned for this result.
17    pub items: Option<Vec<BacklinksApiDomainIntersectionItem>>,
18}
19
20/// A single domain intersection item: per-target metrics plus an intersection summary.
21#[derive(Debug, Default, Serialize, Deserialize, Clone)]
22pub struct BacklinksApiDomainIntersectionItem {
23    /// Per-target metrics keyed by target id.
24    pub domain_intersection:
25        Option<HashMap<String, BacklinksApiElementBacklinksDomainIntersection>>,
26    /// Intersection summary for this item.
27    pub summary: Option<BacklinksApiIntersectionSummary>,
28}
29
30/// Intersection summary shared by Domain Intersection and Page Intersection results.
31#[derive(Debug, Default, Serialize, Deserialize, Clone)]
32pub struct BacklinksApiIntersectionSummary {
33    /// Number of targets that intersect for this item.
34    pub intersections_count: Option<i64>,
35}