pub trait DescriptorVisitor<'a> {
type Error;
// Provided methods
fn on_configuration(&mut self, _c: &ConfigurationDescriptor) -> bool { ... }
fn on_interface(&mut self, _i: &InterfaceDescriptorChain<'a>) -> bool { ... }
fn on_endpoint(
&mut self,
_iface: &InterfaceDescriptorChain<'a>,
_e: &EndpointDescriptor,
) -> bool { ... }
fn on_other(
&mut self,
_iface: Option<&InterfaceDescriptorChain<'a>>,
_raw: &[u8],
) -> Result<bool, Self::Error> { ... }
}Expand description
Callback-based visitor for a configuration’s descriptor tree.
Implement only the methods you care about.
Required Associated Types§
Provided Methods§
Sourcefn on_configuration(&mut self, _c: &ConfigurationDescriptor) -> bool
fn on_configuration(&mut self, _c: &ConfigurationDescriptor) -> bool
Return false to stop iteration early
Sourcefn on_interface(&mut self, _i: &InterfaceDescriptorChain<'a>) -> bool
fn on_interface(&mut self, _i: &InterfaceDescriptorChain<'a>) -> bool
Return false to stop iteration early
Sourcefn on_endpoint(
&mut self,
_iface: &InterfaceDescriptorChain<'a>,
_e: &EndpointDescriptor,
) -> bool
fn on_endpoint( &mut self, _iface: &InterfaceDescriptorChain<'a>, _e: &EndpointDescriptor, ) -> bool
Return false to stop iteration early
Sourcefn on_other(
&mut self,
_iface: Option<&InterfaceDescriptorChain<'a>>,
_raw: &[u8],
) -> Result<bool, Self::Error>
fn on_other( &mut self, _iface: Option<&InterfaceDescriptorChain<'a>>, _raw: &[u8], ) -> Result<bool, Self::Error>
Catches every sub-descriptor that isn’t an interface or endpoint:
CS_INTERFACE, CS_ENDPOINT, HID, vendor-specific, etc.
Return Ok(false) to stop iteration early without an error, or Err(e) to stop with one.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".