pub struct DescriptorChain<'a, T> {
pub descriptor: T,
pub buffer: &'a [u8],
}Expand description
A chain of descriptors.
Holds the current descriptor and a reference to the bytes after the descriptor. Deferences to the descriptor.
Fields§
§descriptor: TThe current descriptor.
buffer: &'a [u8]The raw bytes following the descriptor.
Implementations§
Source§impl<'a> DescriptorChain<'a, ConfigurationDescriptor>
impl<'a> DescriptorChain<'a, ConfigurationDescriptor>
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 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.
Source§impl<'a> DescriptorChain<'a, InterfaceDescriptor>
impl<'a> DescriptorChain<'a, InterfaceDescriptor>
Sourcepub fn iter_descriptors(&self) -> RawDescriptorIterator<'_> ⓘ
pub fn iter_descriptors(&self) -> RawDescriptorIterator<'_> ⓘ
Iterate over raw descriptors inside this interface.
Sourcepub fn iter_endpoints(&'a self) -> EndpointIterator<'a> ⓘ
pub fn iter_endpoints(&'a self) -> EndpointIterator<'a> ⓘ
Iterate over endpoint descriptors inside this interface.
Trait Implementations§
Source§impl<'a, T: Clone> Clone for DescriptorChain<'a, T>
impl<'a, T: Clone> Clone for DescriptorChain<'a, T>
Source§fn clone(&self) -> DescriptorChain<'a, T>
fn clone(&self) -> DescriptorChain<'a, T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a, T: Debug> Debug for DescriptorChain<'a, T>
impl<'a, T: Debug> Debug for DescriptorChain<'a, T>
Source§impl<'a, T> Deref for DescriptorChain<'a, T>
impl<'a, T> Deref for DescriptorChain<'a, T>
Source§impl<'a, T> DerefMut for DescriptorChain<'a, T>
impl<'a, T> DerefMut for DescriptorChain<'a, T>
Source§impl<T> Format for DescriptorChain<'_, T>where
T: Format,
Available on crate feature defmt only.
impl<T> Format for DescriptorChain<'_, T>where
T: Format,
Available on crate feature
defmt only.Source§impl<'a> From<&DescriptorChain<'a, InterfaceDescriptor>> for InterfaceDescriptor
impl<'a> From<&DescriptorChain<'a, InterfaceDescriptor>> for InterfaceDescriptor
Source§fn from(chain: &InterfaceDescriptorChain<'a>) -> Self
fn from(chain: &InterfaceDescriptorChain<'a>) -> Self
Converts to this type from the input type.
Source§impl<'a, T: PartialEq> PartialEq for DescriptorChain<'a, T>
impl<'a, T: PartialEq> PartialEq for DescriptorChain<'a, T>
impl<T> Copy for DescriptorChain<'_, T>where
T: Copy,
impl<'a, T: Eq> Eq for DescriptorChain<'a, T>
impl<'a, T> StructuralPartialEq for DescriptorChain<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for DescriptorChain<'a, T>where
T: Freeze,
impl<'a, T> RefUnwindSafe for DescriptorChain<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for DescriptorChain<'a, T>where
T: Send,
impl<'a, T> Sync for DescriptorChain<'a, T>where
T: Sync,
impl<'a, T> Unpin for DescriptorChain<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for DescriptorChain<'a, T>where
T: UnwindSafe,
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