Tracking Issue for Exclusive · Issue #98407 · rust-lang/rust (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@guswynn

Description

@guswynn

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 BoxFutures)

Public API

// core::sync #[derive(Default)] struct Exclusive<T: ?Sized> { ... }

impl<T: ?Sized> Sync for Exclusive {}

impl Exclusive { pub const fn new(t: T) -> Self; pub const fn into_inner(self) -> T; }

impl<T: ?Sized> Exclusive { 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; pub const fn from_pin_mut(Pin<&mut T>) -> Pin<&mut Exclusive>; }

impl<T: Future> Future for Exclusive { ... }

impl From for Exclusive { ... } impl<T: ?Sized> Debug for Exclusive { ... }

Steps / History

Unresolved Questions