rust/library/std
bors b7bcaa5c71 Auto merge of #143741 - connortsui20:oneshot, r=joboet
`oneshot` Channel

Tracking Issue: https://github.com/rust-lang/rust/issues/143674

This PR adds an experimental `oneshot` module.

Before talking about the API itself, I would prefer to get some of these questions below out of the way first. And as discussed in the [ACP](https://github.com/rust-lang/libs-team/issues/610) it would be

# Unresolved Questions

- [x] ~~Why exactly is it okay for `Sender` to be `Sync`? Or basically, how do we boil down the discussion in https://github.com/rust-lang/rust/pull/111087 into a comment for the `unsafe impl<T: Send> Sync for Sender<T> {}`?~~
- [x] ~~Why is `mpsc::Receiver` `!Sync` but `mpmc::Receiver` is `Sync`? Should `oneshot::Receiver` be `Sync` or not?~~
- [ ] Should this PR try to add an `is_ready` method as proposed in the tracking issue? If so, then the surface of this PR would likely need to increase to add a `pub(crate) fn is_disconnected` method to `mpmc` (might even be a good idea to add that to all 3 channel flavors).
- [ ] In a similar vein to the previous question, should the first internal implementation simply be a wrapper around `mpmc`, or should it be a wrapper around the internal crossbeam implementation?
- [ ] Should the `Sender` and `Receiver` operations be methods or associated methods? So `sender.send(msg)` or `Sender::send(sender, msg)`? The method syntax is more consistent with the rest of the ecosystem (namely `tokio`)
2026-01-05 11:35:43 +00:00
..
benches benchmark path.components() iteration 2025-10-25 14:46:58 +02:00
src Auto merge of #143741 - connortsui20:oneshot, r=joboet 2026-01-05 11:35:43 +00:00
tests add oneshot tests 2026-01-05 09:47:20 +11:00
build.rs Update to new API, allowing to remove check_doc_cfg.rs file from librustdoc 2025-12-10 12:28:08 +01:00
Cargo.toml std: switch to moto-rt v0.16.0 2025-12-19 15:48:47 -08:00