use super::ScoreValue;
use std::borrow::Cow;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[serde(rename_all = "kebab-case")]
pub struct PageInfo<'a> {
pub page: Cow<'a, str>,
pub category: Option<Cow<'a, str>>,
pub site: Cow<'a, str>,
pub title: Cow<'a, str>,
pub alt_title: Option<Cow<'a, str>>,
pub score: ScoreValue,
pub tags: Vec<Cow<'a, str>>,
pub language: Cow<'a, str>,
}
impl PageInfo<'_> {
#[cfg(test)]
pub fn dummy() -> Self {
PageInfo {
page: cow!("some-page"),
category: None,
site: cow!("sandbox"),
title: cow!("A page for the age"),
alt_title: None,
score: ScoreValue::Float(69.0),
tags: vec![cow!("tale"), cow!("_cc")],
language: cow!("default"),
}
}
}