Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize runtime::id::Id #7125

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

chinedufn
Copy link

@chinedufn chinedufn commented Jan 25, 2025

This commit stabilizes the runtime::id::Id.

runtime::id::Id uniquely identifies a runtime relative to the parent process' other currently running runtimes.

std::from::From implementations

This commit removes the runtime Id's From implementations.

Removing unnecessary public APIs makes stabilizing the Id less risky. Instead, a crate private Id::new method has been introduced.

This means that as of this commit, users can no longer safely construct an Id.
Instead, they must get a runtime Id from a method such as Handle::current().id().

It is assumed that there is no reason for a user to construct an Id themselves. If a use case is found then we can easily add public constructor functions later.

This commit stabilizes the `runtime::id::Id`.

`runtime::id::Id` uniquely identifies a runtime relative to the parent
process' other currently running runtimes.

It was introduced in July 2023 and has only received one modification
since, where `impl From<NonZeroU32> for Id` was added in December 2023
in 3a4aef1 .

## `std::from::From` implementations

This commit removes the runtime `Id`'s `From` implementations.

Removing unnecessary publc APIs makes stabilizing the `Id` less risky.
Instead, a crate private `Id::new` method has been introduced.

This means that as of this commit, users can no longer safely construct
 an `Id`.
Instead, they must get a runtime `Id` from a method such as
`Handle::current().id()`.

The `Id`'s documentation explains that it is intended to be an opaque
handle. Therefore, we should not expose a way to construct one.
@chinedufn
Copy link
Author

Closes #5545

@github-actions github-actions bot added R-loom-current-thread Run loom current-thread tests on this PR R-loom-multi-thread Run loom multi-thread tests on this PR labels Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R-loom-current-thread Run loom current-thread tests on this PR R-loom-multi-thread Run loom multi-thread tests on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant