pub struct InterfaceDescriptor {
pub interface_number: u8,
pub alternate_setting: u8,
pub num_endpoints: u8,
pub interface_class: u8,
pub interface_subclass: u8,
pub interface_protocol: u8,
pub interface_name: StringIndex,
}Expand description
Standard USB Interface Descriptor.
A configuration provides one or more interfaces. (USB 2.0 §9.6.5)
Fields§
§interface_number: u8Interface index in this configuration (0-based).
alternate_setting: u8Alternate setting ID of this interface.
num_endpoints: u8Number of endpoints used by this interface.
interface_class: u8Class code.
If the class is 0, then the behavior is undefined (value is reserved).
If the class is 0xff, then the interface class is vendor-specific.
interface_subclass: u8Subclass code.
If the class is 0, then the subclass must be 0.
If the subclass is 0xff, then the interface subclass is vendor-specific.
interface_protocol: u8Protocol code.
If the protocol is 0, then there is no class-specific interface protocol.
If the protocol is 0xff, then the interface protocol is vendor-specific.
interface_name: StringIndexInterface string.
Trait Implementations§
Source§impl Clone for InterfaceDescriptor
impl Clone for InterfaceDescriptor
Source§fn clone(&self) -> InterfaceDescriptor
fn clone(&self) -> InterfaceDescriptor
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 Debug for InterfaceDescriptor
impl Debug for InterfaceDescriptor
Source§impl ExtendableDescriptor for InterfaceDescriptor
impl ExtendableDescriptor for InterfaceDescriptor
Source§fn match_bytes(bytes: &[u8]) -> Result<(), DescriptorError>
fn match_bytes(bytes: &[u8]) -> Result<(), DescriptorError>
Matches
bytes with this descriptor. Read moreSource§fn prepare_bytes(bytes: &mut [u8], len: u8) -> Result<(), DescriptorError>where
Self: WritableDescriptor,
fn prepare_bytes(bytes: &mut [u8], len: u8) -> Result<(), DescriptorError>where
Self: WritableDescriptor,
Prepares
bytes to receive descriptor data. Read moreSource§impl Format for InterfaceDescriptorwhere
StringIndex: Format,
impl Format for InterfaceDescriptorwhere
StringIndex: Format,
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 PartialEq for InterfaceDescriptor
impl PartialEq for InterfaceDescriptor
Source§impl USBDescriptor for InterfaceDescriptor
impl USBDescriptor for InterfaceDescriptor
type Error = DescriptorError
fn try_from_bytes(bytes: &[u8]) -> Result<Self, Self::Error>
Source§impl WritableDescriptor for InterfaceDescriptor
impl WritableDescriptor for InterfaceDescriptor
impl Copy for InterfaceDescriptor
impl Eq for InterfaceDescriptor
impl StructuralPartialEq for InterfaceDescriptor
Auto Trait Implementations§
impl Freeze for InterfaceDescriptor
impl RefUnwindSafe for InterfaceDescriptor
impl Send for InterfaceDescriptor
impl Sync for InterfaceDescriptor
impl Unpin for InterfaceDescriptor
impl UnwindSafe for InterfaceDescriptor
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