Module abi_stable::utils
source · [−]Expand description
Utility functions.
Structs
Information about a panic, used in ffi_panic_message
.
Functions
This function allows calculating the distance (in T
s) from from
to to
.
Prints an error message for attempting to panic across the ffi boundary and aborts the process.
Leaks value
into the heap, and returns a reference to it.
Casts a &'a mut ManuallyDrop<T>
to *mut T
Casts a &'a mut ManuallyDrop<T>
to RMut<'a, T>
Converts a &T
to a NonNull<T>
.
Takes the contents out of a ManuallyDrop<T>
.
Transmute a mutable reference to another mutable reference, changing the referent’s type.
Transmute a reference to another reference, changing the referent’s type.
Unions
Helper type for transmuting between Copy
types
without adding any overhead in debug builds.