CodeIndexNumber

Enum CodeIndexNumber 

Source
#[repr(u8)]
pub enum CodeIndexNumber {
Show 16 variants MiscFunction = 0, CableEvents = 1, SystemCommon2Bytes = 2, SystemCommon3Bytes = 3, SysexStartsOrContinues = 4, SystemCommon1Byte = 5, SysexEnds2Bytes = 6, SysexEnds3Bytes = 7, NoteOff = 8, NoteOn = 9, PolyKeyPress = 10, ControlChange = 11, ProgramChange = 12, ChannelPressure = 13, PitchBendChange = 14, SingleByte = 15,
}
Expand description

The Code Index Number(CIN) indicates the classification of the bytes in the MIDI_x fields. Code Index Number classifications.

Variants§

§

MiscFunction = 0

Miscellaneous function codes. Reserved for future extensions.

§

CableEvents = 1

Cable events. Reserved for future expansion.

§

SystemCommon2Bytes = 2

Two-byte System Common messages like MTC, SongSelect, etc.

§

SystemCommon3Bytes = 3

Three-byte System Common messages like SPP, etc.

§

SysexStartsOrContinues = 4

SysEx starts or continues.

§

SystemCommon1Byte = 5

Single-byte System Common Message or SysEx ends with following single byte.

§

SysexEnds2Bytes = 6

SysEx ends with following two bytes.

§

SysexEnds3Bytes = 7

SysEx ends with following three bytes.

§

NoteOff = 8

Note-off.

§

NoteOn = 9

Note-on.

§

PolyKeyPress = 10

Poly-KeyPress.

§

ControlChange = 11

Control Change.

§

ProgramChange = 12

Program Change.

§

ChannelPressure = 13

Channel Pressure.

§

PitchBendChange = 14

PitchBend Change.

§

SingleByte = 15

Single Byte.

Implementations§

Source§

impl CodeIndexNumber

Source

pub fn try_from_payload(payload: &[u8]) -> Result<Self, UsbMidiEventPacketError>

Creates a new number from a MIDI event payload.

The detection is based on the content and ignores the slice length.

Source

pub fn payload_size(&self) -> usize

Returns the size of the MIDI_x event payload in bytes.

Trait Implementations§

Source§

impl Clone for CodeIndexNumber

Source§

fn clone(&self) -> CodeIndexNumber

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CodeIndexNumber

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for CodeIndexNumber

Source§

fn eq(&self, other: &CodeIndexNumber) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<u8> for CodeIndexNumber

Source§

type Error = UsbMidiEventPacketError

The type returned in the event of a conversion error.
Source§

fn try_from(value: u8) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for CodeIndexNumber

Source§

impl Eq for CodeIndexNumber

Source§

impl StructuralPartialEq for CodeIndexNumber

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.