StableDerefKey

Trait StableDerefKey 

Source
pub unsafe trait StableDerefKey:
    Deref
    + Eq
    + Hash { }
Expand description

A value that can be stably dereferenced with Deref trait. A stable dereference means that a reference to the value will be valid even if the reference is moved to a different memory location.

See https://stackoverflow.com/q/77548941/177275 for more details.

§Safety

Implementing this trait is unsafe because the implementation must guarantee that the Deref is stable per above.

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

Implementors§