pub unsafe trait Restructure<T: ?Sized> {
    type Restructured;
    unsafe fn restructure(ptr: *mut Self) -> Self::Restructured;
}
Expand description

A type that can be “restructured” as a field of some containing type.

Safety

restructure must return a valid Restructured that upholds the same invariants as a mutably borrowed subfield of some T. These invariants must not be violated if simultaneous mutable borrows exist to other subfields of the same T.

Associated Types

The restructured version of this type.

Required methods

Restructures a pointer to this type into the target type.

Safety

ptr must be a pointer to a subfield of some T.

Implementors