Add PinMut::set

This commit is contained in:
Taylor Cramer 2018-05-22 16:59:53 -07:00
parent 640f6f0749
commit b7ccb24848

View file

@ -1164,6 +1164,14 @@ impl<'a, T: ?Sized> PinMut<'a, T> {
{
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")]