Skip to main content

StrongWell

Trait StrongWell 

Source
pub unsafe trait StrongWell: Deref<Target: Sized> + Well<Target = <Self as Deref>::Target> { }
Expand description

Smart pointer with direct access to its data.

§Safety

Types that implement this trait assert, in addition to the requirements of Well, that the pointers returned/received by insert and remove are also valid to deref directly whenever a valid reference to the pointer is obtained, and that if they implement DerefMut, the same applies to mutable dereferences.

Additionally, implementations guarantee that their contents are implicitly pinned, and thus Pin::new_unchecked and Pin::into_inner_unchecked have the correct semantics for the generic Pinned implementation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> StrongWell for &T

Source§

impl<T> StrongWell for &mut T

Source§

impl<T> StrongWell for Box<T>

Available on crate feature alloc only.
Source§

impl<T> StrongWell for Rc<T>

Available on crate feature alloc only.
Source§

impl<T> StrongWell for Arc<T>

Available on crate feature alloc only.
Source§

impl<W: StrongWell> StrongWell for Pin<W>

Implementors§