1use crate::url::Url;
2
3#[derive(Debug, Clone, Default, PartialEq, Eq)]
4pub struct Links {
5 pub homepage: Option<Url>,
6 pub image: Option<Url>,
7 pub image_href: Option<Url>,
8 pub custom: Vec<CustomLink>,
9}
10
11#[derive(Debug, Clone, PartialEq, Eq)]
12pub struct CustomLink {
13 pub url: Url,
14 pub title: Option<String>,
15 pub description: Option<String>,
16}
17
18impl CustomLink {
19 pub const fn from_url(url: Url) -> Self {
20 Self {
21 url,
22 title: None,
23 description: None,
24 }
25 }
26}
27
28impl From<Url> for CustomLink {
29 fn from(url: Url) -> Self {
30 Self::from_url(url)
31 }
32}