Struct nusb::descriptors::InterfaceAltSetting
source · pub struct InterfaceAltSetting<'a>(/* private fields */);
Expand description
Information about a USB interface alternate setting, with access to associated endpoints and other descriptors.
An interface descriptor represents a single alternate setting of
an interface. Multiple interface descriptors with the same interface_number
but different alternate_setting
values represent different alternate settings.
Implementations§
source§impl<'a> InterfaceAltSetting<'a>
impl<'a> InterfaceAltSetting<'a>
sourcepub fn descriptors(&self) -> Descriptors<'_> ⓘ
pub fn descriptors(&self) -> Descriptors<'_> ⓘ
Get the interface descriptor followed by all trailing endpoint and other descriptors up to the next interface descriptor.
source§impl<'a> InterfaceAltSetting<'a>
impl<'a> InterfaceAltSetting<'a>
sourcepub fn interface_number(&self) -> u8
pub fn interface_number(&self) -> u8
bInterfaceNumber
descriptor field: Identifier for the interface.
Pass this to Device::claim_interface
to work with the interface.
sourcepub fn alternate_setting(&self) -> u8
pub fn alternate_setting(&self) -> u8
bAlternateSetting
descriptor field: Identifier for this alternate setting.
Pass this to Interface::set_alt_setting
to use this alternate setting.
sourcepub fn num_endpoints(&self) -> u8
pub fn num_endpoints(&self) -> u8
bNumEndpoints
descriptor field: Number of endpoints in this alternate setting.
source§impl<'a> InterfaceAltSetting<'a>
impl<'a> InterfaceAltSetting<'a>
sourcepub fn string_index(&self) -> Option<u8>
pub fn string_index(&self) -> Option<u8>
Index of the string descriptor describing this interface or alternate setting.
Trait Implementations§
source§impl<'a> Clone for InterfaceAltSetting<'a>
impl<'a> Clone for InterfaceAltSetting<'a>
source§fn clone(&self) -> InterfaceAltSetting<'a>
fn clone(&self) -> InterfaceAltSetting<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more