dst-init

A library for rust to provide ways to emplace dynamic sized type ```rust

![feature(alloclayoutextra)]

![feature(ptr_metadata)]

use dstinitmacros::dst; use dst_init::{BoxExt, Slice, SliceExt};

[dst]

[derive(Debug)]

struct Test { a: A, b: B, c: C, dst: [(C, D)], }

[dst]

[derive(Debug)]

struct Test1 { a: usize, t: Test, }

let t = TestInit { a: 1usize, b: 1u8, c: 1u8, dst: Slice::iterinit(3, (0..).map(|i| (i as u8, i as usize))), }; let u = Test1Init { a: 1usize, t }; let a = Box::emplace(u); asserteq!(a.a,1usize); asserteq!(a.t.a,1); asserteq!(a.t.b,1); asserteq!(a.t.c,1); asserteq!(a.t.dst,[(0,0),(1,1),(2,2)]);

```