[][src]Function typic::transmute::safe_transmute

pub fn safe_transmute<T, U, O>(from: T) -> U where
    U: FromType<T, Variant, <O as UnsafeTransmuteOptions>::Alignment, <O as UnsafeTransmuteOptions>::Transparency, <O as UnsafeTransmuteOptions>::Stability, <O as UnsafeTransmuteOptions>::Validity>,
    O: TransmuteOptions

A safe and sound value-to-value conversion.

Consumes a value of type T and produces a value of type U by reinterpreting that value's bits.

This will only convert T into U when:

  1. T is soundly transmutable into U, and
  2. T is safely transmutable into U.

See also TransmuteInto and TransmuteFrom.