- Notifications
You must be signed in to change notification settings - Fork 13.9k
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(exclusive_wrapper)]
This is a tracking issue for the Exclusive
wrapper struct.
This structure can be used to upgrade non-Sync
objects into Sync
ones, by only offering mutable access to the underlying object. This can be useful with Send
-but-not-Sync
futures (like BoxFuture
s)
Public API
// core::sync #[derive(Default)] struct Exclusive<T: ?Sized> { ... } impl<T: ?Sized> Sync for Exclusive {} // via auto traits: // impl<T> Send for Exclusive<T> // where // T: Send + ?Sized, impl<T> Exclusive<T> { pub const fn new(t: T) -> Self; pub const fn into_inner(self) -> T; } impl<T: ?Sized> Exclusive<T> { pub const fn get_mut(&mut self) -> &mut T; pub const fn get_pin_mut(Pin<&mut self>) -> Pin<&mut T>; pub const fn from_mut(&mut T) -> &mut Exclusive<T>; pub const fn from_pin_mut(Pin<&mut T>) -> Pin<&mut Exclusive<T>>; } impl<T: Future> Future for Exclusive { ... } impl<T> From<T> for Exclusive<T> { ... } impl<T: ?Sized> Debug for Exclusive { ... }
Steps / History
- Implementation: [core] add
Exclusive
to sync #97629 - Determine other nice-to-have trait impls
- Final comment period (FCP)
- Stabilization PR
Unresolved Questions
- None yet.
EFanZh, a1phyr, DzenanJupic, Xuanwo, schneiderfelipe and 11 morezohnannorldanko, Scripter17, joseluis, zohnannor and AhoyISki
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.