pub struct InterfaceDescriptor<'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> InterfaceDescriptor<'a>
impl<'a> InterfaceDescriptor<'a>
Sourcepub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
The bytes of the interface descriptor and all trailing descriptors.
Sourcepub fn descriptors(&self) -> DescriptorIter<'a> ⓘ
pub fn descriptors(&self) -> DescriptorIter<'a> ⓘ
Iterate all trailing endpoint and other descriptors up to the next interface descriptor.
Sourcepub fn endpoints(&self) -> impl Iterator<Item = EndpointDescriptor<'a>>
pub fn endpoints(&self) -> impl Iterator<Item = EndpointDescriptor<'a>>
Get the endpoints of this interface.
Source§impl<'a> InterfaceDescriptor<'a>
impl<'a> InterfaceDescriptor<'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> InterfaceDescriptor<'a>
impl<'a> InterfaceDescriptor<'a>
Sourcepub fn string_index(&self) -> Option<NonZeroU8>
pub fn string_index(&self) -> Option<NonZeroU8>
Index of the string descriptor describing this interface or alternate setting.
Trait Implementations§
Source§impl<'a> Clone for InterfaceDescriptor<'a>
impl<'a> Clone for InterfaceDescriptor<'a>
Source§fn clone(&self) -> InterfaceDescriptor<'a>
fn clone(&self) -> InterfaceDescriptor<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more