Struct pin_api::PinBox
[−]
[src]
pub struct PinBox<T: ?Sized> { /* fields omitted */ }
A PinBox is a box that pins the data inside it. It guarantees that that
data will not be moved out of it unless that data implements the
Unpin
trait.
Methods
impl<T> PinBox<T>
[src]
pub fn new(data: T) -> PinBox<T>
[src]
Pin a pointer to the heap.
pub unsafe fn into_inner_unchecked(self) -> T
[src]
Move the inner type out of the PinBox.
This is unsafe because the type may be a type which is not safe to move.
impl<T: ?Sized> PinBox<T>
[src]
pub fn as_pin<'a>(&'a self) -> Pin<'a, T>
[src]
Get a mutable pinned reference to the data in this PinBox.
pub fn as_pin_mut<'a>(&'a mut self) -> PinMut<'a, T>
[src]
Get a mutable pinned reference to the data in this PinBox.
pub unsafe fn into_box_unchecked(self) -> Box<T>
[src]
Move the inner box out of this PinBox.
This is unsafe because it is possible to move the interior type out of this box, and the interior type may be a type that is not safe to move.
impl<T: Unpin> PinBox<T>
[src]
pub fn into_inner(self) -> T
[src]
Move the data from this PinBox onto the stack.
impl<T: Unpin + ?Sized> PinBox<T>
[src]
Trait Implementations
impl<T: Unpin + ?Sized> Deref for PinBox<T>
[src]
type Target = T
The resulting type after dereferencing.
fn deref(&self) -> &T
[src]
Dereferences the value.
impl<T: Unpin + ?Sized> DerefMut for PinBox<T>
[src]
impl<T: ?Sized> From<Box<T>> for PinBox<T>
[src]
impl<T: ?Sized> Unpin for PinBox<T>
[src]
impl<T: ?Sized, U> CoerceUnsized<PinBox<U>> for PinBox<T> where
T: Unsize<U>,
U: ?Sized,
[src]
T: Unsize<U>,
U: ?Sized,