Skip to main content

oratos_core/
page.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
4pub struct PageRef {
5    pub url_or_path: String,
6    #[serde(skip_serializing_if = "Option::is_none")]
7    pub title: Option<String>,
8}
9
10impl PageRef {
11    pub fn new(url_or_path: impl Into<String>) -> Self {
12        Self {
13            url_or_path: url_or_path.into(),
14            title: None,
15        }
16    }
17}