pub trait Packets {
// Required method
fn packets<'a>(&'a self) -> PacketsIterator<'a> ⓘ;
}Available on crate features
channel-voice1 or channel-voice2 or ci or flex-data or sysex7 or sysex8 or system-common or ump-stream or utility only.Expand description
Read the individual packets of a message represented with UMP packets.
§Basic Usage
use midi2::prelude::*;
let mut message = flex_data::ProjectName::<Vec<u32>>::new();
message.set_text("Shadows of the Forgotten Cathedral");
let mut packets = message.packets();
assert_eq!(&*packets.next().unwrap(), &[0xD0500101, 0x53686164, 0x6F777320, 0x6F662074][..]);
assert_eq!(&*packets.next().unwrap(), &[0xD0900101, 0x68652046, 0x6F72676F, 0x7474656E][..]);
assert_eq!(&*packets.next().unwrap(), &[0xD0D00101, 0x20436174, 0x68656472, 0x616C0000][..]);
assert_eq!(packets.next(), None);Packets may be shorter than 128 bytes for certain messages which are represented by shorter packets.
use midi2::prelude::*;
let mut message = sysex7::Sysex7::<Vec<u32>>::new();
message.set_payload((0..20).map(u7::new));
let mut packets = message.packets();
assert_eq!(&*packets.next().unwrap(), &[0x30160001, 0x2030405][..]);
assert_eq!(&*packets.next().unwrap(), &[0x30260607, 0x8090A0B][..]);
assert_eq!(&*packets.next().unwrap(), &[0x30260C0D, 0xE0F1011][..]);
assert_eq!(&*packets.next().unwrap(), &[0x30321213, 0x0][..]);
assert_eq!(packets.next(), None);Required Methods§
fn packets<'a>(&'a self) -> PacketsIterator<'a> ⓘ
Implementors§
impl<B: Ump> Packets for ChannelVoice1<B>
Available on crate feature
channel-voice1 only.impl<B: Ump> Packets for ChannelVoice2<B>
Available on crate feature
channel-voice2 only.impl<B: Ump> Packets for UmpMessage<B>
impl<B: Ump> Packets for FlexData<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for SystemCommon<B>
Available on crate feature
system-common only.impl<B: Ump> Packets for UmpStream<B>
Available on crate feature
ump-stream only.impl<B: Ump> Packets for Utility<B>
Available on crate feature
utility only.impl<B: Ump> Packets for midi2::channel_voice1::ChannelPressure<B>
Available on crate feature
channel-voice1 only.impl<B: Ump> Packets for midi2::channel_voice1::ControlChange<B>
Available on crate feature
channel-voice1 only.impl<B: Ump> Packets for midi2::channel_voice1::KeyPressure<B>
Available on crate feature
channel-voice1 only.impl<B: Ump> Packets for midi2::channel_voice1::NoteOff<B>
Available on crate feature
channel-voice1 only.impl<B: Ump> Packets for midi2::channel_voice1::NoteOn<B>
Available on crate feature
channel-voice1 only.impl<B: Ump> Packets for PitchBend<B>
Available on crate feature
channel-voice1 only.impl<B: Ump> Packets for midi2::channel_voice1::ProgramChange<B>
Available on crate feature
channel-voice1 only.impl<B: Ump> Packets for AssignableController<B>
Available on crate feature
channel-voice2 only.impl<B: Ump> Packets for AssignablePerNoteController<B>
Available on crate feature
channel-voice2 only.impl<B: Ump> Packets for ChannelPitchBend<B>
Available on crate feature
channel-voice2 only.impl<B: Ump> Packets for midi2::channel_voice2::ChannelPressure<B>
Available on crate feature
channel-voice2 only.impl<B: Ump> Packets for midi2::channel_voice2::ControlChange<B>
Available on crate feature
channel-voice2 only.impl<B: Ump> Packets for midi2::channel_voice2::KeyPressure<B>
Available on crate feature
channel-voice2 only.impl<B: Ump> Packets for midi2::channel_voice2::NoteOff<B>
Available on crate feature
channel-voice2 only.impl<B: Ump> Packets for midi2::channel_voice2::NoteOn<B>
Available on crate feature
channel-voice2 only.impl<B: Ump> Packets for PerNoteManagement<B>
Available on crate feature
channel-voice2 only.impl<B: Ump> Packets for PerNotePitchBend<B>
Available on crate feature
channel-voice2 only.impl<B: Ump> Packets for midi2::channel_voice2::ProgramChange<B>
Available on crate feature
channel-voice2 only.impl<B: Ump> Packets for RegisteredController<B>
Available on crate feature
channel-voice2 only.impl<B: Ump> Packets for RegisteredPerNoteController<B>
Available on crate feature
channel-voice2 only.impl<B: Ump> Packets for RelativeAssignableController<B>
Available on crate feature
channel-voice2 only.impl<B: Ump> Packets for RelativeRegisteredController<B>
Available on crate feature
channel-voice2 only.impl<B: Ump> Packets for AccompanyingPerformerName<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for ArrangerName<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for ComposerName<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for CompositionName<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for CopyrightNotice<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for LyricistName<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for Lyrics<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for LyricsLanguage<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for MidiClipName<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for PrimaryPerformerName<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for ProjectName<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for PublisherName<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for RecordingDate<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for RecordingLocation<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for Ruby<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for RubyLanguage<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for SetChordName<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for SetKeySignature<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for SetMetronome<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for SetTempo<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for SetTimeSignature<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for UnknownMetadataText<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for UnknownPerformanceText<B>
Available on crate feature
flex-data only.impl<B: Ump> Packets for Sysex7<B>
Available on crate feature
sysex7 only.impl<B: Ump> Packets for Sysex8<B>
Available on crate feature
sysex8 only.impl<B: Ump> Packets for ActiveSensing<B>
Available on crate feature
system-common only.impl<B: Ump> Packets for Continue<B>
Available on crate feature
system-common only.impl<B: Ump> Packets for Reset<B>
Available on crate feature
system-common only.impl<B: Ump> Packets for SongPositionPointer<B>
Available on crate feature
system-common only.impl<B: Ump> Packets for SongSelect<B>
Available on crate feature
system-common only.impl<B: Ump> Packets for Start<B>
Available on crate feature
system-common only.impl<B: Ump> Packets for Stop<B>
Available on crate feature
system-common only.impl<B: Ump> Packets for TimeCode<B>
Available on crate feature
system-common only.impl<B: Ump> Packets for TimingClock<B>
Available on crate feature
system-common only.impl<B: Ump> Packets for TuneRequest<B>
Available on crate feature
system-common only.impl<B: Ump> Packets for DeviceIdentity<B>
Available on crate feature
ump-stream only.impl<B: Ump> Packets for EndOfClip<B>
Available on crate feature
ump-stream only.impl<B: Ump> Packets for EndpointDiscovery<B>
Available on crate feature
ump-stream only.impl<B: Ump> Packets for EndpointInfo<B>
Available on crate feature
ump-stream only.impl<B: Ump> Packets for EndpointName<B>
Available on crate feature
ump-stream only.impl<B: Ump> Packets for FunctionBlockDiscovery<B>
Available on crate feature
ump-stream only.impl<B: Ump> Packets for FunctionBlockInfo<B>
Available on crate feature
ump-stream only.impl<B: Ump> Packets for FunctionBlockName<B>
Available on crate feature
ump-stream only.impl<B: Ump> Packets for ProductInstanceId<B>
Available on crate feature
ump-stream only.impl<B: Ump> Packets for StartOfClip<B>
Available on crate feature
ump-stream only.impl<B: Ump> Packets for StreamConfigurationNotification<B>
Available on crate feature
ump-stream only.impl<B: Ump> Packets for StreamConfigurationRequest<B>
Available on crate feature
ump-stream only.impl<B: Ump> Packets for Clock<B>
Available on crate feature
utility only.impl<B: Ump> Packets for DeltaClockstamp<B>
Available on crate feature
utility only.impl<B: Ump> Packets for DeltaClockstampTpq<B>
Available on crate feature
utility only.impl<B: Ump> Packets for NoOp<B>
Available on crate feature
utility only.impl<B: Ump> Packets for Timestamp<B>
Available on crate feature
utility only.