Closed BenLeadbetter closed 6 months ago
Is would be good to implement a Packets trait for midi2 message wrappers.
Packets
Something like the following:
pub struct PacketsIterator<'a>; impl<'a> core::iter::Iterator for PacketsIterator<'a> { type Item = &'a [u32]; ... } pub trait Packets<B: Ump>: Data<B> { fn packets(&self) -> PacketsIterator; }
The trait could potentially even be implemented via a blanket impl for all messages which also implement Data.
Data
impl<B: Ump, M: Data<B>> Packets<B> for M { fn packets(&self) -> PacketsIterator { ... } }
Is would be good to implement a
Packets
trait for midi2 message wrappers.Something like the following:
The trait could potentially even be implemented via a blanket impl for all messages which also implement
Data
.