You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -12,7 +13,7 @@ It prioritizes being space-optimal and efficient.
12
13
13
14
```toml
14
15
[dependencies]
15
-
utc-dt = "0.2"
16
+
utc-dt = "0.3"
16
17
```
17
18
For extended/niche features and local time-zone support see [`chrono`](https://github.com/chronotope/chrono) or [`time`](https://github.com/time-rs/time).
18
19
@@ -33,7 +34,8 @@ See [docs.rs](https://docs.rs/utc-dt) for the API reference.
33
34
- Provides constants useful for time transformations: [`utc-dt::constants`](https://docs.rs/utc-dt/latest/utc_dt/constants/index.html)
34
35
- Nanosecond resolution.
35
36
- Timestamps supporting standard math operators (`core::ops`)
36
-
-`#![no_std]` support.
37
+
-`#![no_std]` and optional `alloc` support.
38
+
- Optional serialization/deserialization of structures via `serde`
37
39
38
40
## Examples (exhaustive)
39
41
```rust
@@ -99,13 +101,16 @@ See [docs.rs](https://docs.rs/utc-dt) for the API reference.
99
101
// UTC Time of Day subsecond component (in nanoseconds)
100
102
letsubsec_ns=utc_tod.as_subsec_ns();
101
103
// Parse a UTC Time of Day from an ISO 8601 time string `(Thh:mm:ssZ)`
// `UTCTransformations` can be used to create shortcuts to the desired type!
@@ -184,6 +195,13 @@ See [docs.rs](https://docs.rs/utc-dt) for the API reference.
184
195
}
185
196
```
186
197
198
+
## Feature flags
199
+
The [`std`, `alloc`] feature flags are enabled by default.
200
+
-`std`: Enables methods that use the system clock via `std::time::SystemTime`. Enables `alloc`.
201
+
-`alloc`: Enables methods that use allocated strings.
202
+
-`serde`: Derives `serde::Serialize` and `serde::Deserialize` for all internal non-error types.
203
+
-`nightly`: Enables the unstable [`error_in_core`](https://github.com/rust-lang/rust/issues/103765) feature for improved `#[no_std]` error handling.
204
+
187
205
## References
188
206
-[(Howard Hinnant, 2021) `chrono`-Compatible Low-Level Date Algorithms](http://howardhinnant.github.io/date_algorithms.html)
189
207
-[(W3C, 1997) ISO 8601 Standard for Date and Time Formats](https://www.w3.org/TR/NOTE-datetime)
0 commit comments