pub trait InterfaceHandler: Handler {
// Required method
fn owns(&self, iface: InterfaceNumber) -> bool;
// Provided method
fn owns_endpoint(&self, _ep: EndpointAddress) -> bool { ... }
}Expand description
A Handler that owns one or more USB interfaces.
The device stack routes interface-recipient control requests only to handlers that claim the addressed interface, and endpoint-recipient requests only to handlers that claim the endpoint.
Required Methods§
Sourcefn owns(&self, iface: InterfaceNumber) -> bool
fn owns(&self, iface: InterfaceNumber) -> bool
Return true when this handler owns iface.
Provided Methods§
Sourcefn owns_endpoint(&self, _ep: EndpointAddress) -> bool
fn owns_endpoint(&self, _ep: EndpointAddress) -> bool
Return true when this handler owns ep for endpoint-recipient requests.
Most classes do not handle endpoint-recipient requests and can keep the
default false.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".