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
[]
= "offline-protocol-core"
= true
= true
= true
= true
# AGPL-3.0-only requires the license text to accompany the program, and a
# published crate ships on its own. Rather than `license-file = "../../LICENSE"`
# (which makes cargo warn that `license` and `license-file` are redundant on
# every invocation), each publishable crate carries its own byte-identical
# LICENSE copy; cargo packages every git-tracked file under the crate root, so
# it lands in the .crate archive. scripts/check-license-consistency.sh asserts
# the copies never drift.
= true
= true
= "Core types and data structures for the Offline Protocol SDK"
[]
= true
[]
# `std` is on by default, so every existing consumer compiles unchanged and the
# published API is byte-identical to what it was before this crate gained a
# bare-metal build. Turning it off is what a Cortex-M leaf node does:
# `--no-default-features` leaves the decode, validate and encode paths, and
# removes the constructors that mint state from the platform (`MessageId::new`,
# `Timestamp::now`, `LocalInstant`) plus the poison-recovering lock helpers.
#
# There is deliberately no separate `alloc` feature. Every type here is built
# out of `String` and `Vec`, so `alloc` is mandatory in both configurations and
# a feature that can never be turned off is dead configuration.
#
# `uuid/v4` lives here rather than in the base dependency because v4 pulls
# `getrandom`, which has no backend on a bare-metal target and fails the build.
# The no_std path constructs ids from bytes that arrived on the wire instead.
= ["std"]
= [
"serde/std",
"serde_json/std",
"base64/std",
"unicode-normalization/std",
"thiserror/std",
"uuid/std",
"uuid/v4",
"dep:tracing",
]
[]
# The seven entries below are declared locally rather than inherited from the
# workspace table, and that is load-bearing rather than untidy: a member crate
# CANNOT drop default features from a `{ workspace = true }` dependency. Cargo
# accepts `default-features = false` next to `workspace = true` and silently
# ignores it, so an inherited `serde` would keep dragging `serde/std` in and the
# bare-metal build would fail with errors pointing at the dependency instead of
# at the cause. Declaring them here is the only way the opt-out takes effect.
#
# Version requirements must stay in lockstep with `[workspace.dependencies]` in
# the root manifest. `workspace_dependency_versions_match` in `src/lib.rs`
# fails the build if they drift.
= { = "1.0", = false, = ["derive", "alloc"] }
= { = "1.0", = false, = ["alloc"] }
= { = "0.22", = false, = ["alloc"] }
= { = "0.1", = false }
= { = "2.0", = false }
= { = "1.6", = false, = ["serde"] }
# Optional because `sync.rs` is its only consumer and that module is std-only.
= { = "0.1", = true }
# These two stay inherited: the workspace already declares them
# `default-features = false, features = ["alloc"]` for unrelated reasons
# (postcard to avoid the unmaintained `atomic-polyfill`, bech32 because its
# `std` feature only adds error impls that never cross this API), which happens
# to be exactly the shape a bare-metal build needs.
= { = true }
= { = true }
[]
[]