Module internal

Source
Expand description

Internal implementation of casting functions not bound by marker traits and therefore marked as unsafe. This is used so that we don’t need to duplicate the business logic contained in these functions between the versions exported in the crate root, checked, and relaxed modules.

FunctionsΒ§

bytes_of πŸ”’ ⚠
Re-interprets &T as &[u8].
bytes_of_mut πŸ”’ ⚠
Re-interprets &mut T as &mut [u8].
cast πŸ”’ ⚠
Cast A into B
cast_mut πŸ”’ ⚠
Cast &mut A into &mut B.
cast_ref πŸ”’ ⚠
Cast &A into &B.
cast_slice πŸ”’ ⚠
Cast &[A] into &[B].
cast_slice_mut πŸ”’ ⚠
Cast &mut [A] into &mut [B].
from_bytes πŸ”’ ⚠
Re-interprets &[u8] as &T.
from_bytes_mut πŸ”’ ⚠
Re-interprets &mut [u8] as &mut T.
is_aligned_to πŸ”’
Checks if ptr is aligned to an align memory boundary.
pod_read_unaligned πŸ”’ ⚠
Reads the slice into a T value.
something_went_wrong πŸ”’
Immediately panics.
try_cast πŸ”’ ⚠
Try to cast A into B.
try_cast_mut πŸ”’ ⚠
Try to convert a &mut A into &mut B.
try_cast_ref πŸ”’ ⚠
Try to convert a &A into &B.
try_cast_slice πŸ”’ ⚠
Try to convert &[A] into &[B] (possibly with a change in length).
try_cast_slice_mut πŸ”’ ⚠
Try to convert &mut [A] into &mut [B] (possibly with a change in length).
try_from_bytes πŸ”’ ⚠
Re-interprets &[u8] as &T.
try_from_bytes_mut πŸ”’ ⚠
Re-interprets &mut [u8] as &mut T.
try_pod_read_unaligned πŸ”’ ⚠
Reads from the bytes as if they were a T.