pub fn try_from_box_bytes<T: FromBoxBytes + ?Sized>(
    input: BoxBytes
) -> Result<Box<T>, (PodCastError, BoxBytes)>
Available on crate feature extern_crate_alloc only.
Expand description

Re-interprets BoxBytes as Box<T>.

T must be either Sized + AnyBitPattern, or [U] where U: AnyBitPattern.

Returns Err:

  • If the input isn’t aligned for T.
  • If T: Sized and the input’s length isn’t exactly the size of T.
  • If T = [U] and the input’s length isn’t exactly a multiple of the size of U.