# Struct std::mem::PinMut[−][src]

    pub struct PinMut<'a, T> where
        T: 'a + ?Sized,  { /* 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> PinMut<'a, T> where T: Unpin + ?Sized,`

[src]

####

`pub fn new(reference: &'a mut T) -> 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`.

####
ⓘImportant traits for &'a mut I

### Important traits for &'a mut I

`impl<'a, I> Iterator for &'a mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'a, R: Read + ?Sized> Read for &'a mut Rimpl<'a, W: Write + ?Sized> Write for &'a mut W`

`pub fn get_mut(this: PinMut<'a, T>) -> &'a mut T`

[src]

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

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

###

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

[src]

####

`pub unsafe fn new_unchecked(reference: &'a mut T) -> 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.

####

`pub fn reborrow(&'b mut self) -> PinMut<'b, T>`

[src]

🔬 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`.

####
ⓘImportant traits for &'a mut I

### Important traits for &'a mut I

`impl<'a, I> Iterator for &'a mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'a, R: Read + ?Sized> Read for &'a mut Rimpl<'a, W: Write + ?Sized> Write for &'a mut W`

`pub unsafe fn get_mut_unchecked(this: PinMut<'a, T>) -> &'a mut T`

[src]

🔬 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.

####

`pub unsafe fn map_unchecked<U, F>(this: PinMut<'a, T>, f: F) -> PinMut<'a, U> where F: FnOnce(&mut T) -> &mut U,`

[src]

🔬 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.

####

`pub fn set(this: PinMut<'a, T>, value: T)`

[src]

🔬 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> Pointer for PinMut<'a, T> where T: ?Sized,`

[src]

####

`fn fmt(&self, f: &mut Formatter) -> Result<(), Error>`

[src]

Formats the value using the given formatter.

###

`impl<'a, T> Debug for PinMut<'a, T> where T: Debug + ?Sized,`

[src]

####

`fn fmt(&self, f: &mut Formatter) -> Result<(), Error>`

[src]

Formats the value using the given formatter. Read more

###

`impl<'a, T, U> CoerceUnsized<PinMut<'a, U>> for PinMut<'a, T> where T: Unsize<U> + ?Sized, U: ?Sized,`

[src]

###

`impl<'a, T, F> UnsafeFutureObj<'a, T> for PinMut<'a, F> where F: Future<Output = T> + 'a,`

[src]

####

`fn into_raw(self) -> *mut ()`

[src]

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

futures in libcore are unstable

Convert an owned instance into a (conceptually owned) void pointer.

####

`unsafe fn poll(ptr: *mut (), cx: &mut Context) -> Poll<T>`

[src]

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

futures in libcore are unstable

Poll the future represented by the given void pointer. Read more

####

`unsafe fn drop(_ptr: *mut ())`

[src]

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

futures in libcore are unstable

Drops the future represented by the given void pointer. Read more

###

`impl<'a, F> Future for PinMut<'a, F> where F: Future + ?Sized,`

[src]

#### `type Output = <F as Future>::Output`

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

futures in libcore are unstable

The result of the `Future`.

####

`fn poll( self: PinMut<PinMut<'a, F>>, cx: &mut Context ) -> Poll<<PinMut<'a, F> as Future>::Output>`

[src]

🔬 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

###

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

[src]

###

`impl<'a, T> DerefMut for PinMut<'a, T> where T: Unpin + ?Sized,`

[src]

####
ⓘImportant traits for &'a mut I

### Important traits for &'a mut I

`impl<'a, I> Iterator for &'a mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'a, R: Read + ?Sized> Read for &'a mut Rimpl<'a, W: Write + ?Sized> Write for &'a mut W`

`fn deref_mut(&mut self) -> &mut T`

[src]

Mutably dereferences the value.

###

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

[src]

#### `type Target = T`

The resulting type after dereferencing.

####
ⓘImportant traits for &'a mut I

### Important traits for &'a mut I

`impl<'a, I> Iterator for &'a mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'a, R: Read + ?Sized> Read for &'a mut Rimpl<'a, W: Write + ?Sized> Write for &'a mut W`

`fn deref(&self) -> &T`

[src]

Dereferences the value.

###

`impl<'a, T> Display for PinMut<'a, T> where T: Display + ?Sized,`

[src]

####

`fn fmt(&self, f: &mut Formatter) -> Result<(), Error>`

[src]

Formats the value using the given formatter. 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,`

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g. `str,u8` or `String,struct:Vec,test`)