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!
I was thinking this would be pretty cool to use for debugging device drivers on embedded devices especially w.r.t latency.