pub type ConfigurationDescriptorChain<'a> = DescriptorChain<'a, ConfigurationDescriptor>;Expand description
The chain of descriptors of a ConfigurationDescriptor.
When you request the configuration descriptor of a usb device you get a chain of descriptors (USB 2.0 §9.6.3). The chain includes interface descriptors, endpoint descriptors, and possibly other descriptors.
The total length of the chain is in ConfigurationDescriptor::total_len.
Aliased Type§
pub struct ConfigurationDescriptorChain<'a> {
pub descriptor: ConfigurationDescriptor,
pub buffer: &'a [u8],
}Fields§
§descriptor: ConfigurationDescriptorThe current descriptor.
buffer: &'a [u8]The raw bytes following the descriptor.
Implementations§
Source§impl<'a> ConfigurationDescriptorChain<'a>
impl<'a> ConfigurationDescriptorChain<'a>
Sourcepub fn try_from_slice(buf: &'a [u8]) -> Result<Self, HostError>
pub fn try_from_slice(buf: &'a [u8]) -> Result<Self, HostError>
Parse a full Configuration Descriptor blob, giving access to sub-descriptors via iterators.
Sourcepub fn iter_descriptors(&self) -> RawDescriptorIterator<'a> ⓘ
pub fn iter_descriptors(&self) -> RawDescriptorIterator<'a> ⓘ
Iterate over all raw descriptors in this Configuration.
Sourcepub fn iter_interface(&self) -> InterfaceIterator<'_> ⓘ
pub fn iter_interface(&self) -> InterfaceIterator<'_> ⓘ
Iterate over all interface descriptors of this Configuration.
Sourcepub fn find_interface<C: ClassMatch>(
&'a self,
) -> Option<InterfaceDescriptorChain<'a>>
pub fn find_interface<C: ClassMatch>( &'a self, ) -> Option<InterfaceDescriptorChain<'a>>
Find the first interface matching C.
Sourcepub fn find_interfaces<C: ClassMatch>(
&'a self,
) -> impl Iterator<Item = InterfaceDescriptorChain<'a>> + 'a
pub fn find_interfaces<C: ClassMatch>( &'a self, ) -> impl Iterator<Item = InterfaceDescriptorChain<'a>> + 'a
Iterate over every interface matching C.
Sourcepub fn find_iad_group(
&'a self,
interface: u8,
) -> Option<InterfaceAssociationDescriptor>
pub fn find_iad_group( &'a self, interface: u8, ) -> Option<InterfaceAssociationDescriptor>
Find the Interface Association Descriptor whose interface group contains
interface.
Returns None when the configuration has no matching IAD, or when the
interface is not part of an association.
Sourcepub fn visit_descriptors<V: DescriptorVisitor<'a>>(
&self,
visitor: &mut V,
) -> Result<(), VisitError<V::Error>>
pub fn visit_descriptors<V: DescriptorVisitor<'a>>( &self, visitor: &mut V, ) -> Result<(), VisitError<V::Error>>
Iterate over all descriptors of this Configuration, passing to Visitor callbacks.
Returns Ok(()) on completion (including early stop), or Err(e) on error.