Struct pin_api::Pin [] [src]

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

A pinned reference.

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

Methods

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

[src]

Create a new Pin from a reference to a moveable type.

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

[src]

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

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

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

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

[src]

Get a Pin 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.

Trait Implementations

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

The resulting type after dereferencing.

[src]

Dereferences the value.

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

Auto Trait Implementations

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

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