Skip to content

Add Rust wrapper for score::cpp::stop_token - #461

Open
eclipse-impl wants to merge 1 commit into
eclipse-score:mainfrom
eclipse-impl:swp-271167
Open

Add Rust wrapper for score::cpp::stop_token#461
eclipse-impl wants to merge 1 commit into
eclipse-score:mainfrom
eclipse-impl:swp-271167

Conversation

@eclipse-impl

Copy link
Copy Markdown
Contributor

No description provided.

@eclipse-impl
eclipse-impl deployed to workflow-approval August 11, 2026 15:24 — with GitHub Actions Active
@eclipse-impl
eclipse-impl deployed to workflow-approval August 11, 2026 15:24 — with GitHub Actions Active
@eclipse-impl
eclipse-impl deployed to workflow-approval August 11, 2026 15:24 — with GitHub Actions Active
@eclipse-impl
eclipse-impl deployed to workflow-approval August 11, 2026 15:24 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

The created documentation from the pull request is available at: docu-html

@4og
4og requested a balanced review from Copilot August 13, 2026 12:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread Cargo.toml
"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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bazel Bazel and Starlark build files c++ C++ code rust Rust code

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants