pub unsafe trait Restructure<T: ?Sized> {
    type Restructured;

    unsafe fn restructure(ptr: *mut T) -> 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.

Required 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 properly aligned pointer to a subfield of some T.

Implementations on Foreign Types

Implementors