Skip to content

Conversation

@m4tx
Copy link
Member

@m4tx m4tx commented Feb 3, 2026

Not requiring this probably isn't very useful (as there are most likely not many use cases where Project needs to contain any data; yet alone data that cannot be Send). With Project: Send, the bootstrapper is Send as well which is useful when you want to run the server in tokio::spawn (for instance, as part of an already running async program) instead of tokio::block_on.

Not requiring this probably isn't very useful (as there are
most likely not many use cases where `Project` needs to contain any
data; yet alone data that cannot be `Send`). With `Project: Send`,
the bootstrapper is `Send` as well which is useful when you want to run
the server in tokio::spawn (for instance, as part of an already running
async program) instead of tokio::block_on.
@github-actions github-actions bot added the C-lib Crate: cot (main library crate) label Feb 3, 2026
@m4tx
Copy link
Member Author

m4tx commented Feb 3, 2026

See m4tx/tundra#173 on why this is useful.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes Project require Send so that Bootstrapper (and related async boot/run flows) can be Send, enabling use cases like running the server inside tokio::spawn rather than requiring tokio::block_on.

Changes:

  • Add Send as a supertrait bound on Project.
  • Remove now-unnecessary clippy::future_not_send suppressions in Bootstrapper boot/run paths and in tests/utilities.
  • Keep/adjust remaining clippy attributes where unused_async is still intentionally expected.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
cot/src/project.rs Makes Project: Send and removes future_not_send expectations from bootstrap/run APIs impacted by Project’s sendability.
cot/src/test.rs Removes future_not_send expectation from Client::new now that Project is Send.
cot/src/middleware/live_reload.rs Removes future_not_send expectation from a helper test that uses Bootstrapper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

/// }
/// ```
pub trait Project {
pub trait Project: Send {
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Project is a public trait and adding : Send is a breaking API change for downstream implementors that were using Rc/RefCell or other !Send state. This repo’s CHANGELOG follows SemVer/Keep-a-Changelog and typically labels breaking changes; please add an entry under [Unreleased] marking this as breaking (and ensure the release/versioning process accounts for it).

Suggested change
pub trait Project: Send {
pub trait Project {

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

🐰 Bencher Report

Branchproject-send
Testbedgithub-ubuntu-latest
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
microseconds (µs)
(Result Δ%)
Upper Boundary
microseconds (µs)
(Limit %)
empty_router/empty_router📈 view plot
🚷 view threshold
5,877.20 µs
(-0.75%)Baseline: 5,921.71 µs
7,095.66 µs
(82.83%)
json_api/json_api📈 view plot
🚷 view threshold
1,042.90 µs
(+2.69%)Baseline: 1,015.61 µs
1,162.50 µs
(89.71%)
nested_routers/nested_routers📈 view plot
🚷 view threshold
963.83 µs
(+2.98%)Baseline: 935.93 µs
1,065.13 µs
(90.49%)
single_root_route/single_root_route📈 view plot
🚷 view threshold
930.34 µs
(+3.70%)Baseline: 897.12 µs
1,023.63 µs
(90.89%)
single_root_route_burst/single_root_route_burst📈 view plot
🚷 view threshold
18,767.00 µs
(+6.71%)Baseline: 17,586.89 µs
20,878.01 µs
(89.89%)
🐰 View full continuous benchmarking report in Bencher

@m4tx m4tx changed the title refactor: make Project require Send refactor!: make Project require Send Feb 3, 2026
@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cot/src/project.rs 50.00% 1 Missing ⚠️
Flag Coverage Δ
rust 89.69% <66.66%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cot/src/middleware/live_reload.rs 84.90% <ø> (ø)
cot/src/test.rs 85.90% <100.00%> (ø)
cot/src/project.rs 88.10% <50.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-lib Crate: cot (main library crate)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants