pub struct MidiSender<'d, A: UsbHostAllocator<'d>> { /* private fields */ }Expand description
USB-MIDI host-to-device packet sender.
Implementations§
Source§impl<'d, A: UsbHostAllocator<'d>> MidiSender<'d, A>
impl<'d, A: UsbHostAllocator<'d>> MidiSender<'d, A>
Sourcepub fn open(
alloc: &A,
interface_number: u8,
endpoint: &MidiEndpointDescriptor,
enum_info: &EnumerationInfo,
) -> Result<Self, MidiError>
pub fn open( alloc: &A, interface_number: u8, endpoint: &MidiEndpointDescriptor, enum_info: &EnumerationInfo, ) -> Result<Self, MidiError>
Allocate the pipe of endpoint, whose cable associations give the ports.
Sourcepub fn new(
pipe: MidiOutputPipe<'d, A>,
interface_number: u8,
endpoint: &MidiEndpointDescriptor,
device_address: u8,
) -> Result<Self, MidiError>
pub fn new( pipe: MidiOutputPipe<'d, A>, interface_number: u8, endpoint: &MidiEndpointDescriptor, device_address: u8, ) -> Result<Self, MidiError>
Wrap an output pipe; the ports come from endpoint’s cable associations.
Sourcepub fn ports(&self) -> &[MidiOutputPort]
pub fn ports(&self) -> &[MidiOutputPort]
Logical ports that can receive MIDI from the host.
Sourcepub async fn write_packet(&mut self, packets: &[u8]) -> Result<(), MidiError>
pub async fn write_packet(&mut self, packets: &[u8]) -> Result<(), MidiError>
Send one or more complete USB-MIDI event packets.
Sourcepub async fn send(
&mut self,
port: MidiOutputPort,
message: &[u8],
) -> Result<(), MidiError>
pub async fn send( &mut self, port: MidiOutputPort, message: &[u8], ) -> Result<(), MidiError>
Encode and send one MIDI message, or a SysEx fragment of up to three bytes, to a logical port.
Sourcepub async fn send_sysex(
&mut self,
port: MidiOutputPort,
message: &[u8],
) -> Result<(), MidiError>
pub async fn send_sysex( &mut self, port: MidiOutputPort, message: &[u8], ) -> Result<(), MidiError>
Send a complete SysEx message (F0 to F7) to a logical port, as three-byte event packets
in transfers of at most the max packet size.
Auto Trait Implementations§
impl<'d, A> Forget for MidiSender<'d, A>
impl<'d, A> Freeze for MidiSender<'d, A>where
MidiOutputPipe<'d, A>: Freeze,
impl<'d, A> Move for MidiSender<'d, A>
impl<'d, A> RefUnwindSafe for MidiSender<'d, A>where
MidiOutputPipe<'d, A>: RefUnwindSafe,
impl<'d, A> Send for MidiSender<'d, A>where
MidiOutputPipe<'d, A>: Send,
impl<'d, A> Sync for MidiSender<'d, A>where
MidiOutputPipe<'d, A>: Sync,
impl<'d, A> Unpin for MidiSender<'d, A>where
MidiOutputPipe<'d, A>: Unpin,
impl<'d, A> UnsafeUnpin for MidiSender<'d, A>where
MidiOutputPipe<'d, A>: UnsafeUnpin,
impl<'d, A> UnwindSafe for MidiSender<'d, A>where
MidiOutputPipe<'d, A>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more