Struct pin_api::PinMut [] [src]

pub struct PinMut<'a, T: ?Sized + 'a> { /* fields omitted */ }

A pinned mutable reference.

The value referenced by this is guaranteed never to move again, unless it implements Unpin.

Methods

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

[src]

Create a new PinMut from a mutable reference to a moveable type.

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

[src]

Construct a new PinMut without checking that the data is actually pinned.

You must guarantee that the data meets the requirements for constructing a PinMut.

An example use case is constructing a PinMut of a field of this type:

This example is not tested
let inner = unsafe { PinMut::new_unchecked(&mut this.inner) };

[src]

Get a PinMut with a shorter lifetime

[src]

Get a reference to the data inside this type.

This is unsafe, because you must guarantee that you do not move the data out of the reference that this function returns.

[src]

Get a mutable reference to the data inside this type.

This is unsafe, because you must guarantee that you do not move the data out of the mutable reference that this function returns.

Trait Implementations

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

The resulting type after dereferencing.

[src]

Dereferences the value.

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

[src]

Mutably dereferences the value.

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

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