Module macro_util

Module macro_util 

Source
Expand description

Utilities used by macros and by zerocopy-derive.

These are defined here zerocopy rather than in code generated by macros or by zerocopy-derive so that they can be compiled once rather than recompiled for every invocation (e.g., if they were defined in generated code, then deriving IntoBytes and FromBytes on three different types would result in the code in question being emitted and compiled six different times).

Re-exports§

pub use __size_of::size_of;

Modules§

core_reexport

Structs§

AlignOf
A type whose size is equal to align_of::<T>().
Wrap

Traits§

DynamicPaddingFree
Field
Projects the type of the field at Index in Self without regard for field privacy.
PaddingFree
TransmuteMutDst
TransmuteRefDst

Functions§

hash_name
Computes the hash of a string.
must_use
A function which emits a warning if its return value is not used.
try_transmute
Attempts to transmute Src into Dst.
try_transmute_mut
Attempts to transmute &mut Src into &mut Dst.
try_transmute_ref
Attempts to transmute &Src into &Dst.

Type Aliases§

SizeToTag 👻
An alias for the unsigned integer of the given size in bytes.

Unions§

MaxAlignsOf
A type whose size is equal to max(align_of::<T>(), align_of::<U>()).