oneshot
Oneshot spsc channel with (potentially) lock-free non-blocking send, and a receiver supporting both thread blocking receive operations as well as Future based async polling.
0.2.1
27M downloads/mo
#1794 most downloaded on crates.io
faern/oneshot
What this package is like to depend on
Last release 6 months ago
23 Feb 2026
Ships fairly regularly
a new release about every 8 months
Nearly every release is documented
notes for 12 of 12 stable releases
4 versions withdrawn
withdrawn after publishing
7 years old
16 releases · first in 2019
4 releases in the last 12 months
see the full history below
Release timeline
16 releases · May 2019 to Feb 2026Releases
latest 16-
0.2.123 Feb 2026Release notes
Open source →[0.2.1] - 2026-02-23
Added
- Add
is_closedandhas_messagemethods toAsyncReceiver.
- Add
-
0.2.023 Feb 2026Release notes
Open source →[0.2.0] - 2026-02-23
Changed
- Disable both the
stdandasyncfeatures by default. Making them opt-in instead of opt-out.
This makes the library more minimal by default and only contains the functionality that the
user explicitly enables. This is a breaking change. - Upgrade to Rust 2024 edition. This also bumps the MSRV to 1.85.0
- Add a separate type
AsyncReceiverthat implementsFutureinstead of implementing it
directly on theReceivertype. Now theReceiverimplementsIntoFutureinstead.
This is a breaking change. This change removes the possible panics in many recv* methods,
and it simplifies some code a bit.
Fixed
- Make Debug impl on SendError include the channel message type, instead of just saying
"SendError<T>(_)".
Release notes
Open source →Changed
- Disable both the
stdandasyncfeatures by default. Making them opt-in instead of opt-out. This makes the library more minimal by default and only contains the functionality that the user explicitly enables. This is a breaking change. - Upgrade to Rust 2024 edition. This also bumps the MSRV to 1.85.0
- Add a separate type
AsyncReceiverthat implementsFutureinstead of implementing it directly on theReceivertype. Now theReceiverimplementsIntoFutureinstead. This is a breaking change. This change removes the possible panics in many recv* methods, and it simplifies some code a bit.
Fixed
- Make Debug impl on SendError include the channel message type, instead of just saying
"SendError<T>(_)".
- Disable both the
-
0.1.1326 Jan 2026Release notes
Open source →[0.1.13] - 2026-01-26
Fixed
- Fix documentation building on docs.rs by not using removed
doc_auto_cfgfeature.
Release notes
Open source →Fixed
- Fix documentation building on docs.rs by not using removed
doc_auto_cfgfeature.
- Fix documentation building on docs.rs by not using removed
-
0.1.1225 Jan 2026Release notes
Open source →Fixed
- Fix race condition that could lead to use-after-free if the
Receiverwas polled asynchronously, but then dropped before completion. https://github.com/faern/oneshot/pull/74 - Fix race conditions/UB around atomic memory orderings. These were found by running tests under miri. https://github.com/faern/oneshot/pull/72
- Fix race condition that could lead to use-after-free if the
-
0.1.1122 Feb 2025Release notes
Open source →Fixed:
- Handle the
UNPARKINGstate correctly inReceiver::drop(). Fixes a panic that could
occur if aReceiverhad been first polled as a future and then was being dropped
in parallel with theSendersending a message.
Release notes
Open source →Fixed
- Handle the
UNPARKINGstate correctly inReceiver::drop(). Fixes a panic that could occur if aReceiverhad been first polled as a future and then was being dropped in parallel with theSendersending a message.
- Handle the
-
0.1.1004 Feb 2025Release notes
Open source →Added:
- Add
is_closedandhas_messageto theReceiver. Allows polling for the channel
state without modifying the channel or pulling the message from it. - Make the cargo features show up on docs.rs for better discoverability.
Release notes
Open source →Added
- Add
is_closedandhas_messageto theReceiver. Allows polling for the channel state without modifying the channel or pulling the message from it. - Make the cargo features show up on docs.rs for better discoverability.
- Add
-
0.1.902 Feb 2025Release notes
Open source →Added:
- Implement
SyncforSender. There is not a whole lot someone can do with a&Sender,
but this allows storing the sender in places that are overly conservative and require
aSyncbound on the content.
Release notes
Open source →Added
- Implement
SyncforSender. There is not a whole lot someone can do with a&Sender, but this allows storing the sender in places that are overly conservative and require aSyncbound on the content.
- Implement
-
0.1.813 Jun 2024Release notes
Open source →- Change how loom concurrency testing is triggered. To get rid of
loomin the dependency tree
oneshotpulls in, it has in addition to being gated behindcfg(oneshot_loom)also been made
an optional dependency. This makes this library way smaller for downstream consumers.
This has the downside that the crate now exposes aloomfeature.
DOWNSTREAM USERS ARE NOT SUPPOSED TO EVER ENABLE THIS. No stability or semver
guarantees exist around theloomfeature.
This change ultimately makes no difference for any user ofoneshotin regular usage.
Release notes
Open source →Changed
- Change how loom concurrency testing is triggered. To get rid of
loomin the dependency treeoneshotpulls in, it has in addition to being gated behindcfg(oneshot_loom)also been made an optional dependency. This makes this library way smaller for downstream consumers. This has the downside that the crate now exposes aloomfeature. DOWNSTREAM USERS ARE NOT SUPPOSED TO EVER ENABLE THIS. No stability or semver guarantees exist around theloomfeature. This change ultimately makes no difference for any user ofoneshotin regular usage.
- Change how loom concurrency testing is triggered. To get rid of
-
0.1.724 May 2024 -
0.1.614 Sep 2023Release notes
Open source →Added
- Add
into_rawandfrom_rawmethods on bothSenderandReceiver. Allows passingoneshotchannels over FFI without an extra layer of heap allocation.
- Add
-
0.1.501 Sep 2022Release notes
Open source →Fixed
- Handle the UNPARKING state correctly in all recv methods.
try_recvwill now not panic if used on aReceiverthat is being unparked from an async wait. The otherrecvmethods will still panic (as they should), but with a better error message.
- Handle the UNPARKING state correctly in all recv methods.
-
0.1.430 Aug 2022Release notes
Open source →Changed
- Upgrade to Rust edition 2021. Also increases the MSRV to Rust 1.60.
- Add null-pointer optimization to
Sender,ReceiverandSendError. This reduces the call stack size of Sender::send and it makesOption<Sender>andOption<Receiver>pointer sized (#18). - Relax the memory ordering of all atomic operations from
SeqCstto the most appropriate lower ordering (#17 + #20).
Fixed
- Fix undefined behavior due to multiple mutable references to the same channel instance (#18).
- Fix race condition that could happen during unparking of a receiving
Receiver(#17 + #20).
-
0.1.323 Nov 2021 withdrawnRelease notes
Open source →Fixed
- Keep the last
WakerinFuture::poll, not the first one. Stops breaking the contract on how futures should work.
- Keep the last
-
0.1.211 Aug 2020 withdrawnRelease notes
Open source →Fixed
- Fix unreachable code panic that happened if the
Receiverof an empty but open channel was polled and then dropped.
- Fix unreachable code panic that happened if the
-
0.1.109 May 2020 withdrawnRelease notes
Open source →Initial implementation. Supports basically all the (for now) intended functionality. Sender is as lock-free as I think it can get and the receiver can both do thread blocking and be awaited asynchronously. The receiver also has a wait-free
try_recvmethod.The crate has two features. They are activated by default, but the user can opt out of async support as well as usage of libstd (making the crate
no_stdbut still requiring liballoc) -
0.1.030 May 2019 withdrawnRelease notes
Open source →Name reserved on crate.io by someone other than the author of this crate.