mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 02:00:00 +03:00
Add PinMut::set
This commit is contained in:
@@ -1164,6 +1164,14 @@ pub unsafe fn map<U, F>(this: PinMut<'a, T>, f: F) -> PinMut<'a, U> where
|
||||
{
|
||||
PinMut { inner: f(this.inner) }
|
||||
}
|
||||
|
||||
/// Assign a new value to the memory behind the pinned reference.
|
||||
#[unstable(feature = "pin", issue = "49150")]
|
||||
pub fn set(this: PinMut<'a, T>, value: T)
|
||||
where T: Sized,
|
||||
{
|
||||
*this.inner = value;
|
||||
}
|
||||
}
|
||||
|
||||
#[unstable(feature = "pin", issue = "49150")]
|
||||
|
||||
Reference in New Issue
Block a user