Comment Comment by choudanu4 Does the PhantomData type in Rust do what you want? Or are you talking about something slightly different?https://doc.rust-lang.org/nomicon/phantom-data.htmlhttps://doc.rust-lang.org/std/marker/struct.PhantomData.htmlSo struct Sender<S> { /// Actual implementation of network I/O. inner: SenderImpl; /// 0-sized field, doesn't exist at runtime. state: S; } I believe could become struct Sender<S> { /// Actual implementation of network I/O. inner: SenderImpl; /// 0-sized field, doesn't exist at runtime. _marker: PhantomData<S>; } I've never used this PhantomData personally, so this might be wrong. Cheers! parent choudanu4 7 years ago
https://doc.rust-lang.org/nomicon/phantom-data.html
https://doc.rust-lang.org/std/marker/struct.PhantomData.html
So
I believe could become I've never used this PhantomData personally, so this might be wrong. Cheers!