[][src]Module rfc::core::convert::transmute::stability

Traits for declaring the SemVer stability of a type's layout.

Since the soundness and safety of a transmutation is affected by the layouts of the source and destination types, changes to those types' layouts may cause code which previously compiled to produce errors. In other words, transmutation causes a type's layout to become part of that type's API for the purposes of SemVer stability.

To promise that all transmutations which are currently safe for your type will remain so in the future, simply annotate your type with:

#[derive(PromiseTransmutableFrom, PromiseTransmutableInto)]
#[repr(C)]
pub struct Foo(pub Bar, pub Baz);

For more information on stability, see here.

Macros

PromiseTransmutableExperimental

Derive macro generating impls of both PromiseTransmutableFrom and PromiseTransmutableInto.

PromiseTransmutableFrom

Derive macro generating an impl of the trait PromiseTransmutableFrom.

PromiseTransmutableInto

Derive macro generating an impl of the trait PromiseTransmutableFrom.

Traits

PromiseTransmutableFrom

Promise that a type may be stably transmuted from other types.

PromiseTransmutableInto

Promise that a type may be stably transmuted into other types.