Trait Cleanup

Source
pub unsafe trait Cleanup<V>: IsLayout {
    type Storage;
}
Expand description

Trait implemented on layouts that can be cleaned up be a vtable.

The trait bound L: Cleanup<V> signifies that the vtable V can cleanup a value with layout L.

This trait is implemented for all V: VTable and Layout.

The associated type Self::Storage will be cleaned up automatically when dropped. This type is based on the vtable and the layout.

For dynamic bounds on the vtable that indicate the value is Copy then the associated type will perform no cleanup operation. For all other cases the type will run the drop impl from the vtable.

This trait is sealed and cannot be implemented by external types.

§Safety

Self::Storage must only be InnerNoDrop or InnerDrop.

Required Associated Types§

Source

type Storage

Storage for DungeonCore.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<V: VTable, L> Cleanup<V> for L
where L: CleanupHelper<V, V::Bounds> + IsLayout,

Source§

type Storage = <L as CleanupHelper<V, <V as VTable>::Bounds>>::Inner