StablePointer

Trait StablePointer 

Source
pub unsafe trait StablePointer: Deref + Borrow<<Self as Deref>::Target> { }
Expand description

This trait guarantees that, for a type T: StablePointer, given a value t: &'a T:

&**t shall live for at least 'a

i.e., when *t moves, the underlying <T as Deref>::Target does not move

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 StablePointer for String

Source§

impl<T> StablePointer for Vec<T>

Source§

impl<T: ?Sized> StablePointer for Box<T>

Source§

impl<T: ?Sized> StablePointer for Rc<T>

Source§

impl<T: ?Sized> StablePointer for Arc<T>

Implementors§