Skip to main content

PinCoerceUnsized

Trait PinCoerceUnsized 

Source
pub unsafe trait PinCoerceUnsized: Deref { }
🔬This is a nightly-only experimental API. (pin_coerce_unsized_trait #150112)
Expand description

Trait that indicates that this is a pointer or a wrapper for one, where unsizing can be performed on the pointee when it is pinned.

§Safety

Given a pointer of this type, the concrete type returned by its deref method and (if it implements DerefMut) its deref_mut method must be the same type and must not change without a modification. The following operations are not considered modifications:

  • Moving the pointer.
  • Performing unsizing coercions on the pointer.
  • Performing dynamic dispatch with the pointer.
  • Calling deref or deref_mut on the pointer.

The concrete type of a trait object is the type that the vtable corresponds to. The concrete type of a slice is an array of the same element type and the length specified in the metadata. The concrete type of a sized type is the type itself.

Implementors§

1.33.0 · Source§

impl<'a, T: ?Sized> PinCoerceUnsized for &'a T

1.33.0 · Source§

impl<'a, T: ?Sized> PinCoerceUnsized for &'a mut T

Source§

impl<'b, T: ?Sized> PinCoerceUnsized for Ref<'b, T>

Source§

impl<'b, T: ?Sized> PinCoerceUnsized for RefMut<'b, T>

1.33.0 · Source§

impl<T: PinCoerceUnsized> PinCoerceUnsized for Pin<T>