Debian Codegraph @

.cargo/vendor/onenote_parser/src/one/property/author.rs

raw
1 use crate::errors::Result;
2 use crate::one::property::{simple, PropertyType};
3 use crate::onestore::object::Object;
4
5 /// The author of an object.
6 ///
7 /// See [\[MS-ONE\] 2.2.67]
8 ///
9 /// [\[MS-ONE\] 2.2.67]: https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-one/db06251b-b672-4c9b-8ba5-d948caaa3edd
10 #[derive(Debug)]
11 pub(crate) struct Author(String);
12
13 impl Author {
14 pub(crate) fn into_value(self) -> String {
15 self.0
16 }
17
18 pub(crate) fn parse(object: &Object) -> Result<Option<Author>> {
19 Ok(simple::parse_string(PropertyType::Author, object)?.map(Author))
20 }
21 }