pub unsafe trait Destructure: Sized {
    type Underlying: ?Sized;
    type Destructuring: Destructuring;

    fn underlying(&mut self) -> *mut Self::Underlying;
}
Expand description

A type that can be destructured into its constituent parts.

Safety

  • Destructuring must reflect the type of restructuring allowed for the type:
    • Ref if the type may be restructured by creating disjoint borrows of the fields of Underlying.
    • Value if the type may be restructured by moving the fields out of the destructured Underlying.
  • underlying must return a pointer that is non-null, properly aligned, and valid for reads.

Required Associated Types

The underlying type that is destructured.

The type of destructuring to perform.

Required Methods

Returns a mutable pointer to the underlying type.

Implementations on Foreign Types

Implementors