Add Rust wrapper for score::cpp::stop_token - #461
Open
eclipse-impl wants to merge 1 commit into
Open
Conversation
eclipse-impl
requested review from
4og,
antonkri,
arkjedrz,
fbaeuerle and
pawelrutkaq
as code owners
August 11, 2026 15:23
eclipse-impl
requested a deployment
to
workflow-approval
August 11, 2026 15:23 — with
GitHub Actions
Waiting
eclipse-impl
requested a deployment
to
workflow-approval
August 11, 2026 15:23 — with
GitHub Actions
Waiting
eclipse-impl
requested a deployment
to
workflow-approval
August 11, 2026 15:23 — with
GitHub Actions
Waiting
eclipse-impl
requested a deployment
to
workflow-approval
August 11, 2026 15:23 — with
GitHub Actions
Waiting
eclipse-impl
force-pushed
the
swp-271167
branch
from
August 11, 2026 15:24
42e3720 to
0223eb6
Compare
Contributor
|
The created documentation from the pull request is available at: docu-html |
There was a problem hiding this comment.
Pull request overview
Adds CXX-based Rust bindings for FutureCpp stop tokens and sources.
Changes:
- Exposes stop-state creation, querying, equality, and cancellation.
- Adds C++ bridge adapters and Rust unit tests.
- Integrates the crate with Bazel and Cargo.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
score/language/rust/stop_token/src/lib.rs |
Implements the Rust API and tests. |
score/language/rust/stop_token/cpp/stop_token_adapter.h |
Declares C++ bridge functions. |
score/language/rust/stop_token/cpp/stop_token_adapter.cpp |
Implements FutureCpp forwarding. |
score/language/rust/stop_token/Cargo.toml |
Defines the Rust crate. |
score/language/rust/stop_token/BUILD |
Adds Bazel bridge, library, and test targets. |
Cargo.toml |
Registers the workspace member. |
Cargo.lock |
Locks the new CXX dependency graph. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "score/testing_macros", | ||
| "score/language/rust/libcpp", | ||
| "score/language/rust/libcpp_derive", | ||
| "score/language/rust/stop_token", |
Comment on lines
+92
to
+95
| unsafe impl Send for StopToken {} | ||
| unsafe impl Sync for StopToken {} | ||
| unsafe impl Send for StopSource {} | ||
| unsafe impl Sync for StopSource {} |
| #ifndef SCORE_LANGUAGE_RUST_STOP_TOKEN_CPP_STOP_TOKEN_ADAPTER_H | ||
| #define SCORE_LANGUAGE_RUST_STOP_TOKEN_CPP_STOP_TOKEN_ADAPTER_H | ||
|
|
||
| #include <score/stop_token.hpp> |
| bool StopSourceRequestStop(const score::cpp::stop_source& source) noexcept | ||
| { | ||
| // request_stop() only updates the shared stop state atomically. | ||
| return const_cast<score::cpp::stop_source&>(source).request_stop(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.