pub struct MidiClassState<'d> { /* private fields */ }Expand description
Internal state for a MidiClass.
Holds names/string-indices for interface, jacks, and Group Terminal Blocks, and serves GTB descriptors over the control endpoint.
Implementations§
Source§impl<'d> MidiClassState<'d>
impl<'d> MidiClassState<'d>
Sourcepub fn active_alternate_setting(&self) -> u8
pub fn active_alternate_setting(&self) -> u8
Returns the currently active alternate setting (0 for MIDI 1.0, 1 for MIDI 2.0).
Sourcepub fn is_midi2_active(&self) -> bool
pub fn is_midi2_active(&self) -> bool
Returns whether MIDI 2.0 (Alternate Setting 1) is currently active.
Trait Implementations§
Source§impl Default for MidiClassState<'_>
impl Default for MidiClassState<'_>
Source§impl Handler for MidiClassState<'_>
impl Handler for MidiClassState<'_>
Source§fn get_string(&mut self, index: StringIndex, _lang_id: u16) -> Option<&str>
fn get_string(&mut self, index: StringIndex, _lang_id: u16) -> Option<&str>
Called when a GET_DESCRIPTOR STRING control request is received.
Source§fn set_alternate_setting(
&mut self,
iface: InterfaceNumber,
alternate_setting: u8,
)
fn set_alternate_setting( &mut self, iface: InterfaceNumber, alternate_setting: u8, )
Called when a “set alternate setting” control request is done on the interface.
Source§fn control_in<'a>(
&'a mut self,
req: Request,
_buf: &'a mut [u8],
) -> Option<InResponse<'a>>
fn control_in<'a>( &'a mut self, req: Request, _buf: &'a mut [u8], ) -> Option<InResponse<'a>>
Called when a control request is received with direction DeviceToHost. Read more
Source§fn enabled(&mut self, _enabled: bool)
fn enabled(&mut self, _enabled: bool)
Called when the USB device has been enabled or disabled.
Source§fn addressed(&mut self, _addr: u8)
fn addressed(&mut self, _addr: u8)
Called when the host has set the address of the device to
addr.Source§fn configured(&mut self, _configured: bool)
fn configured(&mut self, _configured: bool)
Called when the host has enabled or disabled the configuration of the device.
Source§fn suspended(&mut self, _suspended: bool)
fn suspended(&mut self, _suspended: bool)
Called when the bus has entered or exited the suspend state.
Source§fn remote_wakeup_enabled(&mut self, _enabled: bool)
fn remote_wakeup_enabled(&mut self, _enabled: bool)
Called when remote wakeup feature is enabled or disabled.
Source§fn set_sel(&mut self, _u1_sel: u8, _u1_pel: u8, _u2_sel: u16, _u2_pel: u16)
fn set_sel(&mut self, _u1_sel: u8, _u1_pel: u8, _u2_sel: u16, _u2_pel: u16)
Called when the host sets the U1 and U2 system exit latencies, in microseconds (USB 3.x).
Source§fn set_isoch_delay(&mut self, _delay_ns: u16)
fn set_isoch_delay(&mut self, _delay_ns: u16)
Called when the host sets the isochronous delay, in nanoseconds (USB 3.x).
Source§fn u1_enabled(&mut self, _enabled: bool) -> bool
fn u1_enabled(&mut self, _enabled: bool) -> bool
Called when the host enables or disables device-initiated U1 entry (USB 3.x). Read more
Source§fn u2_enabled(&mut self, _enabled: bool) -> bool
fn u2_enabled(&mut self, _enabled: bool) -> bool
Called when the host enables or disables device-initiated U2 entry (USB 3.x). Read more
Source§fn ltm_enabled(&mut self, _enabled: bool) -> bool
fn ltm_enabled(&mut self, _enabled: bool) -> bool
Called when the host enables or disables Latency Tolerance Messaging (USB 3.x). Read more
Source§fn control_out(&mut self, req: Request, data: &[u8]) -> Option<OutResponse>
fn control_out(&mut self, req: Request, data: &[u8]) -> Option<OutResponse>
Called when a control request is received with direction HostToDevice. Read more
Auto Trait Implementations§
impl<'d> !Freeze for MidiClassState<'d>
impl<'d> Forget for MidiClassState<'d>
impl<'d> Move for MidiClassState<'d>
impl<'d> RefUnwindSafe for MidiClassState<'d>
impl<'d> Send for MidiClassState<'d>
impl<'d> Sync for MidiClassState<'d>
impl<'d> Unpin for MidiClassState<'d>
impl<'d> UnsafeUnpin for MidiClassState<'d>
impl<'d> UnwindSafe for MidiClassState<'d>
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