Function try_cast_vec
pub fn try_cast_vec<A, B>(
input: Vec<A>,
) -> Result<Vec<B>, (PodCastError, Vec<A>)> ⓘwhere
A: NoUninit,
B: AnyBitPattern,
Available on crate feature
dep_bytemuck
only.Expand description
Attempts to cast the content type of a Vec
.
On failure you get back an error along with the starting Vec
.
§Failure
- The start and end content type of the
Vec
must have the exact same alignment. - The start and end content size in bytes of the
Vec
must be the exact same. - The start and end capacity in bytes of the
Vec
must be the exact same.