embassy-usb

Crates

git

Versions

default

Flavors

Skip to main content

MidiSender

Struct MidiSender 

Source
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>

Source

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.

Source

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.

Source

pub fn ports(&self) -> &[MidiOutputPort]

Logical ports that can receive MIDI from the host.

Source

pub fn groups(&self) -> u16

Mask of the cables the host may send to; cable n is group n.

Source

pub async fn write_packet(&mut self, packets: &[u8]) -> Result<(), MidiError>

Send one or more complete USB-MIDI event packets.

Source

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.

Source

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>

§

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>

§

impl<'d, A> UnwindSafe for MidiSender<'d, A>
where MidiOutputPipe<'d, A>: UnwindSafe,

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.