try_transmute

Function try_transmute 

Source
pub fn try_transmute<Src, Dst>(src: Src) -> Result<Dst, ValidityError<Src, Dst>>
where Src: IntoBytes, Dst: TryFromBytes,
Expand description

Attempts to transmute Src into Dst.

A helper for try_transmute!.

ยงPanics

try_transmute may either produce a post-monomorphization error or a panic if Dst is bigger than Src. Otherwise, try_transmute panics under the same circumstances as is_bit_valid.