How to create a DST type?
There are exactly two types of unsized objects at present: slices ([T]
), where it adds a length member; and trait objects (Trait
, Trait + Send
, &c.), where it adds a vtable including a destructor which knows how large an object to free.
There is not currently any mechanism for declaring your own variety of unsized objects.