Skip to main content

data_for_seo/entity/backlinks/
page_intersection.rs

1use crate::entity::{
2    BacklinksApiElementBacklinksPageIntersection, BacklinksApiIntersectionSummary,
3};
4use serde::{Deserialize, Serialize};
5use serde_json::Value;
6use std::collections::HashMap;
7
8/// Result of the Page Intersection endpoint: pages linking to several targets at once.
9/// See <https://docs.dataforseo.com/v3/backlinks/page_intersection/live/>.
10#[derive(Debug, Default, Serialize, Deserialize, Clone)]
11pub struct BacklinksApiPageIntersection {
12    /// Targets to analyze (domains, subdomains, or webpages).
13    pub targets: Option<Value>,
14    /// Total number of relevant elements in the database.
15    pub total_count: Option<i64>,
16    /// Number of elements in the `items` array.
17    pub items_count: Option<i64>,
18    /// Elements returned for this result.
19    pub items: Option<Vec<BacklinksApiPageIntersectionItem>>,
20}
21
22/// A single page intersection item: per-target backlink records plus an intersection summary.
23#[derive(Debug, Default, Serialize, Deserialize, Clone)]
24pub struct BacklinksApiPageIntersectionItem {
25    /// Backlink records per target id that link to all analyzed pages.
26    pub page_intersection:
27        Option<HashMap<String, Vec<BacklinksApiElementBacklinksPageIntersection>>>,
28    /// Intersection summary for this item.
29    pub summary: Option<BacklinksApiIntersectionSummary>,
30}