caniuse_serde/Link.rs
1// This file is part of caniuse-serde. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/caniuse-serde/master/COPYRIGHT. No part of predicator, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2// Copyright © 2017 The developers of caniuse-serde. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/caniuse-serde/master/COPYRIGHT.
3
4
5/// A Link is an URL and its title, representing a link to a specification document or subsection
6#[derive(Deserialize, Debug, Clone, Ord, PartialOrd, Eq, PartialEq, Hash)]
7pub struct Link
8{
9 #[serde(with = "url_serde")] url: Url,
10 title: String,
11}
12
13impl Link
14{
15 /// url
16 #[inline(always)]
17 pub fn url(&self) -> &Url
18 {
19 &self.url
20 }
21
22 /// title
23 #[inline(always)]
24 pub fn title(&self) -> &str
25 {
26 &self.title
27 }
28}