Add PinMut::set
This commit is contained in:
parent
640f6f0749
commit
b7ccb24848
1 changed files with 8 additions and 0 deletions
|
|
@ -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")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue