I have a use case where I'd like to reuse a buffer type for multiple different DMA operations that require different word sizes and alignments. Basically what I'd like to use as the buffer type is
union Buffer {
u8: [u8; 1024],
i16: [i16; 512],
}
Now I'd like to implement WriteTarget twice for this type, with a u8 and i16 word. Unfortunately that doesn't work, since the word type is an associated type of the WriteTarget trait. Maybe it would be better if it was a type parameter instead?
I have a use case where I'd like to reuse a buffer type for multiple different DMA operations that require different word sizes and alignments. Basically what I'd like to use as the buffer type is
Now I'd like to implement
WriteTargettwice for this type, with au8andi16word. Unfortunately that doesn't work, since the word type is an associated type of theWriteTargettrait. Maybe it would be better if it was a type parameter instead?