-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
128 lines (107 loc) · 3.73 KB
/
Copy pathCargo.toml
File metadata and controls
128 lines (107 loc) · 3.73 KB
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
[package]
name = "gnss-time"
version = "0.5.3"
description = "Type-safe GNSS time scales: GPS, GLONASS, Galileo, BeiDou, TAI, UTC — no_std by default"
documentation = "https://docs.rs/gnss-time"
homepage = "https://github.com/MiCkEyZzZ/gnss-time"
repository = "https://github.com/MiCkEyZzZ/gnss-time"
keywords = ["glonass", "gnss", "gps", "time", "no-std"]
categories = ["no-std", "science", "date-and-time"]
readme = "README.md"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.75"
# List of files included in the crates.io package (excludes dev files)
include = [
"src/**/*",
"Cargo.toml",
"README.md",
"CHANGELOG.md",
"LICENSE.MIT",
"LICENSE.APACHE",
]
[features]
# Default feature set is empty.
# The crate compiles in no_std environments with no flags enabled.
default = []
# std: adds impl std::error::Error for GnssTimeError.
# Only needed if the consumer uses Box<dyn Error> or anyhow.
# Do NOT enable for embedded builds!
std = []
# defmt: adds impl defmt::Format for all public types.
# Used for structured logging via probe-rs / defmt-rtt.
#
# Usage in Cargo.toml:
# [dependencies]
# gnss-time = { version = "0.5", features = ["defmt"] }
# defmt = "0.3"
#
# defmt versions: https://crates.io/crates/defmt
defmt = ["dep:defmt"]
# serde: Serialize / Deserialize for Time<S>, Duration, DurationParts.
#
# Human-readable (JSON, TOML):
# Time<Gps> → { "scale": "GPS", "nanos": 1356566418000000000 }
# Duration → { "nanos": -7000000000 }
# DurationParts → { "seconds": 5, "nanos": 500000000 }
#
# Compact (postcard, bincode):
# Time<Gps> → raw u64 nanoseconds
# Duration → raw i64 nanoseconds
# DurationParts → 2-element tuple [u64, u32]
serde = ["dep:serde"]
# alloc: enables heap-based error messages in serde deserialization.
alloc = []
[dependencies]
defmt = { version = "0.3", optional = true }
serde = { version = "1", default-features = false, optional = true }
[dev-dependencies]
criterion = { version = "0.8.2", features = ["html_reports"] }
# proptest requires std (thread-local RNG, std::collections).
# Used only in tests/prop_tests.rs, which is guarded by #[cfg(feature = "std")].
# On a host `cargo test` run std is always available, so this always compiles.
# For bare-metal CI (thumbv7em) integration tests are never built.
proptest = { version = "1.8.0", default-features = false, features = ["std"] }
# postcard: compact binary serialization for embedded / no_std.
# - `alloc` feature: enables postcard::to_allocvec (requires std/alloc)
# - `heapless` feature: enables postcard::to_vec into heapless::Vec (no_std)
postcard = { version = "1", features = ["alloc"] }
serde_json = { version = "1" }
# heapless: stack-allocated data structures for no_std environments.
# Used in tests/serde_test.rs to verify no_std compatible serialization.
heapless = "0.8"
[[example]]
name = "civil_time"
path = "examples/civil_time.rs"
[[example]]
name = "basic_usage"
path = "examples/basic_usage.rs"
[[example]]
name = "gps_week_tow"
path = "examples/gps_week_tow.rs"
[[example]]
name = "glonass_day_tod"
path = "examples/glonass_day_tod.rs"
[[example]]
name = "scale_conversion"
path = "examples/scale_conversion.rs"
[[example]]
name = "display_formats"
path = "examples/display_formats.rs"
[[example]]
name = "convert_basic"
path = "examples/convert_basic.rs"
[[example]]
name = "convert_contextual"
path = "examples/convert_contextual.rs"
[[example]]
name = "matrix_inspection"
path = "examples/matrix_inspection.rs"
[[example]]
name = "unix_time"
path = "examples/unix_time.rs"
[package.metadata.docs.rs]
# docs.rs builds with features = ["std", "defmt"] to expose full API
features = ["std", "serde", "defmt"]
# Targets for documentation builds
targets = ["x86_64-unknown-linux-gnu", "thumbv7em-none-eabihf"]