DSTify

Rust crate for safe construction of custom dynamically-sized types (DSTs). Heavily inspired by slice-dst.
use Dstify;
use ;
note: dyn Trait DSTs are not yet supported.
Motivation
In some, arguably niche, use-cases it's more convenient to use a slice instead of a reference. Using a slice removes the need for a lifetime annotation and saves one pointer indirection. Creating a reference (wide/fat pointer) to a built-in type like str or [u8] is easy, but it becomes extremely hard and error-prone once we'd like to store additional fields.
From dynamically sized types in rust nomicon:
Currently the only properly supported way to create a custom DST is by making your type generic and performing an unsizing coercion
Another possiblity is to manually allocate the memory with proper size and alignment and emplace the field values at correct offsets.
That's what is happening behind the curtains of dstify.