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
use mime::Mime;
use unic_langid_impl::LanguageIdentifier;
use biblatex::EntryType;
use std::str::FromStr;
pub struct DCMetaData {
pub title: String,
pub author: String,
pub typ: EntryType,
pub subject: Option<String>,
pub mime: Option<Mime>,
pub language: Option<LanguageIdentifier>,
}
pub const DC_IRI_TITLE: &str = "https://purl.org/dc/terms/title";
pub const DC_IRI_CREATOR: &str = "https://purl.org/dc/terms/creator";
pub const DC_IRI_SUBJECT: &str = "https://purl.org/dc/terms/subject";
pub const DC_IRI_LANGUAGE: &str = "https://purl.org/dc/terms/language";
pub const DC_IRI_TYPE: &str = "https://purl.org/dc/terms/type";
pub const DC_IRI_MEDIATYPE: &str = "https://purl.org/dc/terms/MediaType";
pub const DC_XATTR_TITLE: &str = "user.dcterms:title";
pub const DC_XATTR_CREATOR: &str = "user.dcterms:creator";
pub const DC_XATTR_SUBJECT: &str = "user.dcterms:subject";
pub const DC_XATTR_LANGUAGE: &str = "user.dcterms:language";
pub const DC_XATTR_TYPE: &str = "user.dcterms:type";
pub const DC_XATTR_MEDIATYPE: &str = "user.dcterms:MediaType";
impl DCMetaData {
pub fn new(title: &str, author: &str, entry_type: EntryType) -> DCMetaData {
DCMetaData{
title: String::from(title),
author: String::from(author),
typ: entry_type,
subject: None,
mime: None,
language: None,
}
}
}