Trait munge::Restructure
source · [−]pub unsafe trait Restructure<T: ?Sized>: Destructure {
type Restructured;
unsafe fn restructure(&self, 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 invariants for
its Destructuring
:
Required Associated Types
sourcetype Restructured
type Restructured
The restructured version of this type.
Required Methods
sourceunsafe fn restructure(&self, ptr: *mut T) -> Self::Restructured
unsafe fn restructure(&self, ptr: *mut T) -> Self::Restructured
Restructures a pointer to this type into the target type.
Safety
ptr
must be a properly aligned pointer to a subfield of the pointer
underlying
self
.