[−][src]Struct portmidi::InputPort
Represents the input port of a PortMidi device.
Implementations
impl<'a> InputPort<'a>
[src]
pub fn new(
context: &'a PortMidi,
device: DeviceInfo,
buffer_size: usize
) -> Result<InputPort<'_>>
[src]
context: &'a PortMidi,
device: DeviceInfo,
buffer_size: usize
) -> Result<InputPort<'_>>
Construct a new InputPort
for the given device and buffer size.
If the device
is not an input device an Error::NotAnInputDevice
is returned.
pub fn read_n(&self, cnt: usize) -> Result<Option<Vec<MidiEvent>>>
[src]
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.
pub fn read(&mut self) -> Result<Option<MidiEvent>>
[src]
Reads a single MidiEvent
if one is avaible.
A Result
of None
means no event was available.
pub fn poll(&self) -> Result<bool>
[src]
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.
pub fn device(&self) -> DeviceInfo
[src]
Returns the DeviceInfo
of the Midi device that owns this port.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for InputPort<'a>
impl<'a> !Sync for InputPort<'a>
impl<'a> Unpin for InputPort<'a>
impl<'a> UnwindSafe for InputPort<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,