1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright (c) 2015-2016 Chris Palmer <pennstate5013@gmail.com>
// Use of this source code is governed by the LGPLv3 license that can be
// found in the LICENSE file.
//! The fields under guid can be retrieved by using the methods under `Guid`.
use channels::Guid;
impl Guid {
/// Get the permalink that exists under `Guid`.
///
/// # Examples
///
/// ```
/// use feed::channels::GuidBuilder;
///
/// let guid = GuidBuilder::new()
/// .permalink(None)
/// .finalize();
/// assert!(guid.permalink());
/// ```
///
/// ```
/// use feed::channels::GuidBuilder;
///
/// let permalink = true;
/// let guid = GuidBuilder::new()
/// .permalink(Some(permalink))
/// .finalize();
/// assert_eq!(permalink, guid.permalink());
/// ```
///
/// ```
/// use feed::channels::GuidBuilder;
///
/// let permalink = false;
/// let guid = GuidBuilder::new()
/// .permalink(Some(permalink))
/// .finalize();
/// assert_eq!(permalink, guid.permalink());
/// ```
pub fn permalink(&self) -> bool {
self.permalink
}
/// Get the guid that exists under `Guid`.
///
/// # Examples
///
/// ```
/// use feed::channels::GuidBuilder;
///
/// let guid = "9DE46946-2F90-4D5D-9047-7E9165C16E7C";
/// let guid_obj = GuidBuilder::new()
/// .value(guid)
/// .finalize();
/// assert_eq!(guid.to_owned(), guid_obj.value());
/// ```
pub fn value(&self) -> String {
self.value.clone()
}
}