pub struct InputPort<'a> { /* private fields */ }
Expand description

Represents the input port of a PortMidi device.

Implementations

Construct a new InputPort for the given device and buffer size.

If the device is not an input device an Error::NotAnInputDevice is returned.

Returns a Vec<MidiEvent> with at most cnt elements. If there was no Midi event available, None is returned. If PortMidi fails to read from the device an Error::PortMidi(_) is returned.

Reads a single MidiEvent if one is avaible.

A Result of None means no event was available.

Polls for available Midi events. Returns true if there are events available, otherwise false is returned. If the polling fails an Error::PortMidi(_) is returned.

Returns the DeviceInfo of the Midi device that owns this port.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.