# Struct std::boxed::PinBox[−][src]

    pub struct PinBox<T> where
        T: ?Sized,  { /* fields omitted */ }

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

A pinned, heap allocated reference.

## Methods

###

`impl<T> PinBox<T>`

[src]

####

`pub fn new(data: T) -> PinBox<T>`

[src]

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

Allocate memory on the heap, move the data into it and pin it.

###

`impl<T> PinBox<T> where T: ?Sized,`

[src]

####

`pub fn as_pin_mut(&'a mut self) -> PinMut<'a, T>`

[src]

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

Get a pinned reference to the data in this PinBox.

####
ⓘ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(this: &'a mut PinBox<T>) -> &'a mut T`

[src]

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

Get a mutable reference to the data inside this PinBox.

This function is unsafe. Users must guarantee that the data is never moved out of this reference.

####
ⓘImportant traits for Box<I>

### Important traits for Box<I>

`impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<R: Read + ?Sized> Read for Box<R>impl<W: Write + ?Sized> Write for Box<W>`

`pub unsafe fn unpin(this: PinBox<T>) -> Box<T>`

[src]

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

Convert this PinBox into an unpinned Box.

This function is unsafe. Users must guarantee that the data is never moved out of the box.

## Trait Implementations

###

`impl<T> Debug for PinBox<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<T> From<Box<T>> for PinBox<T> where T: ?Sized,`

[src]

####

`fn from(boxed: Box<T>) -> PinBox<T>`

[src]

Performs the conversion.

###

`impl<T> From<PinBox<T>> for Box<T> where T: Unpin + ?Sized,`

[src]

####
ⓘImportant traits for Box<I>

### Important traits for Box<I>

`impl<I> Iterator for Box<I> where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<R: Read + ?Sized> Read for Box<R>impl<W: Write + ?Sized> Write for Box<W>`

`fn from(pinned: PinBox<T>) -> Box<T>`

[src]

Performs the conversion.

###

`impl<T, U> CoerceUnsized<PinBox<U>> for PinBox<T> where T: Unsize<U> + ?Sized, U: ?Sized,`

[src]

###

`impl<T> Pointer for PinBox<T> where T: ?Sized,`

[src]

####

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

[src]

Formats the value using the given formatter.

###

`impl<T> Deref for PinBox<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<T> Display for PinBox<T> where T: Display + ?Sized,`

[src]

####

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

[src]

Formats the value using the given formatter. Read more

###

`impl<T> DerefMut for PinBox<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<T> Unpin for PinBox<T> where T: ?Sized,`

[src]

## Auto Trait Implementations

###

`impl<T: ?Sized> Send for PinBox<T> where T: Send,`

###

`impl<T: ?Sized> Sync for PinBox<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`)