Skip to main content

SafelyExchangeable

Trait SafelyExchangeable 

Source
pub unsafe trait SafelyExchangeable<T> { }
Expand description

Implementors decree that Self can be safely transmuted to T, including covariantly under a pointer.

§Safety

It is not sufficient that ´SelfandT` have the same representation. That is, validity requirements are not enough. The safety requirements must also be the same.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§