pub struct HubDescriptor {
pub port_num: u8,
pub characteristics: u16,
pub power_on_delay: u8,
pub max_current: u8,
pub device_removable: [u8; 32],
pub port_power_ctrl_mask: [u8; 32],
}Expand description
USB Hub class descriptor (USB 2.0 §11.23.2.1)
Fields§
§port_num: u8Number of ports.
characteristics: u16Characteristics bitmap.
power_on_delay: u8Power-on delay in units of 2ms.
max_current: u8Maximum current requirements of the hub.
device_removable: [u8; 32]Device removable bitmap (variable size).
Meaning of bit values:
- 0 if the device is removable
- 1 if the device is not removable
Bit 0 is reserved.
port_power_ctrl_mask: [u8; 32]Port power control mask bitmap (variable size).
All bits should be 1 for compatibility with USB 1.0 code.
Implementations§
Source§impl HubDescriptor
impl HubDescriptor
Sourcepub fn variable_bitmap_size(&self) -> usize
pub fn variable_bitmap_size(&self) -> usize
Current size of (device_removable)Self::device_removable and (port_power_ctrl_mask)Self::port_power_ctrl_mask.
Trait Implementations§
Source§impl Clone for HubDescriptor
impl Clone for HubDescriptor
Source§fn clone(&self) -> HubDescriptor
fn clone(&self) -> HubDescriptor
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 HubDescriptor
impl Debug for HubDescriptor
Source§impl Format for HubDescriptor
impl Format for HubDescriptor
Source§impl PartialEq for HubDescriptor
impl PartialEq for HubDescriptor
Source§impl USBDescriptor for HubDescriptor
impl USBDescriptor for HubDescriptor
type Error = DescriptorError
fn try_from_bytes(bytes: &[u8]) -> Result<Self, Self::Error>
Source§impl VariableSizeDescriptor for HubDescriptor
impl VariableSizeDescriptor for HubDescriptor
Source§fn match_bytes_len(bytes: &[u8]) -> bool
fn match_bytes_len(bytes: &[u8]) -> bool
Matches length with the number of ports.
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 WritableDescriptor for HubDescriptor
impl WritableDescriptor for HubDescriptor
impl Copy for HubDescriptor
impl Eq for HubDescriptor
impl StructuralPartialEq for HubDescriptor
Auto Trait Implementations§
impl Freeze for HubDescriptor
impl RefUnwindSafe for HubDescriptor
impl Send for HubDescriptor
impl Sync for HubDescriptor
impl Unpin for HubDescriptor
impl UnwindSafe for HubDescriptor
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