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 
&Tas&[u8]. - bytes_
of_ π βmut  - Re-interprets 
&mut Tas&mut [u8]. - cast π β
 - Cast 
AintoB - cast_
mut π β - Cast 
&mut Ainto&mut B. - cast_
ref π β - Cast 
&Ainto&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 
ptris aligned to analignmemory boundary. - pod_
read_ π βunaligned  - Reads the slice into a 
Tvalue. - something_
went_ πwrong  - Immediately panics.
 - try_
cast π β - Try to cast 
AintoB. - try_
cast_ π βmut  - Try to convert a 
&mut Ainto&mut B. - try_
cast_ π βref  - Try to convert a 
&Ainto&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.