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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
// SPDX-License-Identifier: GPL-3.0-or-later
//!
//! HTTP Server implementation of xAPI 2.0.0 LRS.
//!
//! In earlier versions, there were 3 main modules in this project that covered:
//!
//! 1. `data` – the data structures involved.
//! 2. `db` – their Data Access Objects for storing in, and fetching them from a database,
//! and finally
//! 3. `lrs` – a Web server to handle the LRS calls proper.
//!
//! The first is now a separate crate w/ its own version, published as `xapi-data`. Separating
//! the rest is still a work-in-progress. For now _LaRS_ (the LRS server proper) is effectively
//! the `server` member of the Workspace (still) published as `xapi-rs`.
//!
//! # Third-party crates
//!
//! This server depends on few best-of-breed libraries to achieve correct compliance w/ other
//! [IETF][1] and [ISO][2] standards referenced in xAPI.
//!
//! Here's a list of the most important ones:
//!
//! 1. Deserialization and Serialization:
//! * [serde][3]: for the basic serialization + deserialization capabilities.
//! * [serde_json][4]: for the JSON format bindings.
//! * [serde_with][5]: for custom helpers.
//!
//! 2. IRL[^1], IRI[^2], URI[^3] and URL[^4]:
//! * [iri-string][6]: for IRIs and URIs incl. support for [serde]
//! * [url][7]: for Uniform Resource Locators.
//!
//! 3. UUID[^5]:
//! * [uuid][9]: for handling generating, parsing and formatting UUIDs.
//!
//! 4. Date, Time and Durations:
//! * [chrono][10]: for timezone-aware date and time handling.
//! * [speedate][11]: for fast and simple duration[^6] parsing.
//!
//! 5. Language Tags and MIME types:
//! * [language-tags][12]: for parsing , formatting and comparing language
//! tags as specified in [BCP 47][13].
//! * [mime][14]: for support of MIME types (a.k.a. Media Types) when
//! dealing w/ [Attachment][xapi_data::Attachment]s.
//!
//! 6. Email Address:
//! * [email_address][15]: for parsing and validating email addresses.
//!
//! 7. Semantic Version:
//! * [semver][16]: for semantic version parsing and generation as per
//! [Semantic Versioning 2.0.0][17].
//!
//! 8. Case Insensitive Strings:
//! * [unicase][18]: for comparing strings when case is not important
//! (using Unicode Case-folding).
//!
//! 9. JWS signatures:
//! * [josekit][19]: for creating + validating JWS signed Statements.
//! * [openssl][21]: for handling X.509 certificates when included in
//! JWS Headers.
//!
//! [1]: https://www.ietf.org/
//! [2]: https://www.iso.org/
//! [3]: https://crates.io/crates/serde
//! [4]: https://crates.io/crates/serde_json
//! [5]: https://crates.io/crates/serde_with
//! [6]: https://crates.io/crates/iri-string
//! [7]: https://crates.io/crates/url
//! [8]: https://url.spec.whatwg.org/
//! [9]: https://crates.io/crates/uuid
//! [10]: https://crates.io/crates/chrono
//! [11]: https://crates.io/crates/speedate
//! [12]: https://crates.io/crates/language-tags
//! [13]: https://datatracker.ietf.org/doc/bcp47/
//! [14]: https://crates.io/crates/mime
//! [15]: https://crates.io/crates/email_address
//! [16]: https://crates.io/crates/semver
//! [17]: https://semver.org/
//! [18]: https://crates.io/crates/unicase
//! [19]: https://crates.io/crates/josekit
//! [20]: https://dotat.at/tmp/ISO_8601-2004_E.pdf
//! [21]: https://crates.io/crates/openssl
//!
//! [^1]: IRL: Internationalized Resource Locator.
//! [^2]: IRI: Internationalized Resource Identifier.
//! [^3]: URI: Uniform Resource Identifier.
//! [^4]: URL: Uniform Resource Locator.
//! [^5]: UUID: Universally Unique Identifier --see
//! <https://en.wikipedia.org/wiki/Universally_unique_identifier>.
//! [^6]: Durations in [ISO 8601:2004(E)][20] sections 4.4.3.2 and 4.4.3.3.
//!
pub use *;
pub use Aggregates;
pub use MyError;
pub use ;
use error;
/// The xAPI version this project supports by default.
pub const V200: &str = "2.0.0";
/// Verbs Extension IRI
pub const EXT_VERBS: &str = "http://crates.io/xapi-rs/ext/verbs";
/// Statistics/Metrics Extension IRI
pub const EXT_STATS: &str = "http://crates.io/xapi-rs/ext/stats";
/// User Management Extension IRI
pub const EXT_USERS: &str = "http://crates.io/xapi-rs/ext/users";
/// Vebrs Extension base URI.
pub const VERBS_EXT_BASE: &str = "extensions/verbs";
/// Statistics Extension base URI.
pub const STATS_EXT_BASE: &str = "extensions/stats";
/// Users Extension base URI.
pub const USERS_EXT_BASE: &str = "extensions/users";
/// Modes of operations of this LRS.
/// Generate a message (in the style of `format!` macro), log it at level
/// _error_ and raise a [runtime error][crate::MyError#variant.Runtime].
/// Log `$err` at level _error_ before returning it.
/// Generate a message (in the style of `format!` macro), log it at level
/// _error_ and raise a [data constraint violation error][crate::MyError#variant.Data].