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
67
//! A Rust library for parsing `arXiv` categories, identifiers and references.
//!
//! ## Identifiers
//! ```rust
//! use arxiv::{ArticleId, ArticleVersion};
//!
//! let id = ArticleId::try_from("arXiv:9912.12345v2").unwrap();
//! assert_eq!(id.month(), 12);
//! assert_eq!(id.year(), 2099);
//! assert_eq!(id.number(), "12345");
//! assert_eq!(id.version(), ArticleVersion::Num(2));
//! ```
//!
//! ## Categories
//! ```rust
//! use arxiv::{Archive, CategoryId, Group};
//!
//! let category = CategoryId::try_from("astro-ph.HE").unwrap();
//! assert_eq!(category.group(), Group::Physics);
//! assert_eq!(category.archive(), Archive::AstroPh);
//! assert_eq!(category.subject(), "HE");
//! ```
//!
//! ## Stamps
//! ```rust
//! use arxiv::{Archive, CategoryId, Stamp};
//!
//! let stamp = Stamp::try_from("arXiv:0706.0001v1 [q-bio.CB] 1 Jun 2007").unwrap();
//! assert_eq!(stamp.category, CategoryId::try_new(Archive::QBio, "CB").unwrap());
//! assert_eq!(stamp.submitted.year(), 2007);
//! ```
//!
//! ## Feature flags
//! The crate has the following feature flags:
//! - `url` (default): Enables converting types into URLs where possible,
//! such as converting an article identifier into a URL that leads to its abstract page.
pub use crate*;
pub use crate*;
pub use crate*;
pub use crate*;
pub use crate*;
pub use crate*;
/// Represents the versioned grammar that defines an arXiv identifier