Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
90 lines (84 loc) · 3.75 KB
/
Copy pathCargo.toml
File metadata and controls
90 lines (84 loc) · 3.75 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
[workspace]
resolver = "3"
# Every crate in this repository lives under `crates/`, one directory per
# package, each directory named for the package it holds. There is no root
# package: the crate a host loads is `crates/template`, the same as any other
# member. Keeping the root virtual is what makes that uniform — a root package
# would make one crate structurally different from the rest for no reason other
# than history, and it is the arrangement this template moved away from.
members = ["crates/*"]
# `vendor/` holds the pinned TinyBus submodule, which is its own workspace with
# its own lockfile. `worktrees/` holds `git worktree` checkouts of this same
# repository; each contains a full copy of this manifest and every crate under
# it, so without this entry cargo walks into them and reports duplicate
# packages.
exclude = ["vendor", "worktrees"]
# Shared package metadata. A member inherits a field with `field.workspace =
# true`, so the version the release workflow bumps is written in exactly one
# place and every crate moves together.
[workspace.package]
version = "0.2.1"
edition = "2024"
rust-version = "1.88"
license = "GPL-3.0-only"
repository = "https://github.com/tinyhumansai/rust-template"
[workspace.dependencies]
# The wire contract. `crates/template` depends on it and re-exports it, so a
# host that only makes calls takes this crate alone.
# No `version` requirement on purpose: the workspace version moves on every
# release, and a pinned requirement here would stop resolving the moment it did.
# Nothing in this workspace is published, so the path is the whole address.
template-bus = { path = "crates/template-bus" }
# TinyBus defines the message types, interface macro, and frozen module ABI
# used by the generated integration. Socket and CLI features are unnecessary
# here.
tinybus = { path = "vendor/tinybus/crates/tinybus", version = "0.1.0", default-features = false, features = [
"macros",
"modules",
] }
# The module-side SDK owns the isolated runtime and exports the ABI entrypoints
# required by TinyBus's dynamic loader.
tinybus-module = { path = "vendor/tinybus/crates/tinybus-module", version = "0.1.0" }
# Derive macros for the crate-wide error type in `crates/template/src/error/`.
# Every dependency entry should carry a comment like this one saying why it is
# here.
thiserror = "2"
# The bus payload types are serialized into TinyBus frames.
serde = { version = "1", features = ["derive"] }
# Positional argument arrays and the module configuration blob.
serde_json = "1"
# Module integration tests exercise the real asynchronous in-memory TinyBus.
tokio = { version = "1", features = ["macros", "rt-multi-thread", "time"] }
# Lints apply to every member that opts in with `[lints] workspace = true`, and
# to every target of that member. CI runs clippy with `-D warnings`, so anything
# set to "warn" here fails the build in CI.
[workspace.lints.rust]
unsafe_code = "forbid"
missing_docs = "warn"
missing_debug_implementations = "warn"
unreachable_pub = "warn"
rust_2018_idioms = { level = "warn", priority = -1 }
[workspace.lints.clippy]
all = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
# Library code must not panic on its own; tests and examples may.
unwrap_used = "warn"
expect_used = "warn"
panic = "warn"
todo = "warn"
unimplemented = "warn"
# Public fallible/panicking APIs must document their failure modes.
missing_errors_doc = "warn"
missing_panics_doc = "warn"
# Documentation hygiene.
doc_markdown = "warn"
# `#[must_use]` on pure public functions.
must_use_candidate = "warn"
[workspace.lints.rustdoc]
broken_intra_doc_links = "warn"
private_intra_doc_links = "warn"
[profile.release]
# Cross-crate optimization and smaller, faster binaries for release builds.
lto = "thin"
codegen-units = 1
strip = "debuginfo"