onenote_parser/one/property/author.rs
1use crate::errors::Result;
2use crate::one::property::{simple, PropertyType};
3use 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)]
11pub(crate) struct Author(String);
12
13impl 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}