@@ -42,7 +42,7 @@ Zerocopy provides four derivable traits for zero-cost conversions:
42
42
- ` IntoBytes ` indicates that a type may safely be converted * to* a byte
43
43
sequence
44
44
45
- This traits support sized types, slices, and [ slice DSTs] [ slice-dsts ] .
45
+ These traits support sized types, slices, and [ slice DSTs] [ slice-dsts ] .
46
46
47
47
[ slice-dsts ] : KnownLayout#dynamically-sized-types
48
48
@@ -61,7 +61,7 @@ You should generally derive these marker traits whenever possible.
61
61
62
62
###### Conversion Macros
63
63
64
- Zerocopy provides four macros for safe, zero-cost casting between types:
64
+ Zerocopy provides six macros for safe casting between types:
65
65
66
66
- (` try_ ` [ try_transmute] )` transmute ` (conditionally) converts a value of
67
67
one type to a value of another type of the same size
@@ -72,9 +72,12 @@ Zerocopy provides four macros for safe, zero-cost casting between types:
72
72
mutable or immutable reference of one type to an immutable reference of
73
73
another type of the same size
74
74
75
- These macros perform * compile-time* alignment and size checks, but cannot be
76
- used in generic contexts. For generic conversions, use the methods defined
77
- by the [ conversion traits] ( #conversion-traits ) .
75
+ These macros perform * compile-time* size and alignment checks, meaning that
76
+ unconditional casts have zero cost at runtime. Conditional casts do not need
77
+ to validate size or alignment runtime, but do need to validate contents.
78
+
79
+ These macros cannot be used in generic contexts. For generic conversions,
80
+ use the methods defined by the [ conversion traits] ( #conversion-traits ) .
78
81
79
82
###### Byteorder-Aware Numerics
80
83
0 commit comments