Struct core::mem::PinMut[][src]

pub struct PinMut<'a, T: ?Sized + 'a> { /* fields omitted */ }
🔬 This is a nightly-only experimental API. (pin #49150)

A pinned reference.

A pinned reference is a lot like a mutable reference, except that it is not safe to move a value out of a pinned reference unless the type of that value implements the Unpin trait.

Methods

impl<'a, T: ?Sized + Unpin> PinMut<'a, T>
[src]

🔬 This is a nightly-only experimental API. (pin #49150)

Construct a new PinMut around a reference to some data of a type that implements Unpin.

impl<'a, T: ?Sized> PinMut<'a, T>
[src]

🔬 This is a nightly-only experimental API. (pin #49150)

Construct a new PinMut around a reference to some data of a type that may or may not implement Unpin.

This constructor is unsafe because we do not know what will happen with that data after the reference ends. If you cannot guarantee that the data will never move again, calling this constructor is invalid.

🔬 This is a nightly-only experimental API. (pin #49150)

Reborrow a PinMut for a shorter lifetime.

For example, PinMut::get_mut(x.reborrow()) (unsafely) returns a short-lived mutable reference reborrowing from x.

🔬 This is a nightly-only experimental API. (pin #49150)

Get a mutable reference to the data inside of this PinMut.

This function is unsafe. You must guarantee that you will never move the data out of the mutable reference you receive when you call this function.

🔬 This is a nightly-only experimental API. (pin #49150)

Construct a new pin by mapping the interior value.

For example, if you wanted to get a PinMut of a field of something, you could use this to get access to that field in one line of code.

This function is unsafe. You must guarantee that the data you return will not move so long as the argument value does not move (for example, because it is one of the fields of that value), and also that you do not move out of the argument you receive to the interior function.

🔬 This is a nightly-only experimental API. (pin #49150)

Assign a new value to the memory behind the pinned reference.

Trait Implementations

impl<'a, T: ?Sized> Deref for PinMut<'a, T>
[src]

The resulting type after dereferencing.

Dereferences the value.

impl<'a, T: ?Sized + Unpin> DerefMut for PinMut<'a, T>
[src]

Mutably dereferences the value.

impl<'a, T: Debug + ?Sized> Debug for PinMut<'a, T>
[src]

Formats the value using the given formatter. Read more

impl<'a, T: Display + ?Sized> Display for PinMut<'a, T>
[src]

Formats the value using the given formatter. Read more

impl<'a, T: ?Sized> Pointer for PinMut<'a, T>
[src]

Formats the value using the given formatter.

impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<PinMut<'a, U>> for PinMut<'a, T>
[src]

impl<'a, T: ?Sized> Unpin for PinMut<'a, T>
[src]

impl<'a, F: ?Sized + Future> Future for PinMut<'a, F>
[src]

🔬 This is a nightly-only experimental API. (futures_api #50547)

futures in libcore are unstable

The result of the Future.

🔬 This is a nightly-only experimental API. (futures_api #50547)

futures in libcore are unstable

Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more

Auto Trait Implementations

impl<'a, T: ?Sized> Send for PinMut<'a, T> where
    T: Send

impl<'a, T: ?Sized> Sync for PinMut<'a, T> where
    T: Sync