pub struct HubDescriptor {
pub bDescLength: u8,
pub bDescriptorType: u8,
pub bNbrPorts: u8,
pub bPwrOn2PwrGood: u8,
pub bHubContrCurrent: u8,
pub u: HubDescriptorVariant,
/* private fields */
}Fields§
§bDescLength: u8§bDescriptorType: u8§bNbrPorts: u8§bPwrOn2PwrGood: u8§bHubContrCurrent: u8§u: HubDescriptorVariantImplementations§
Source§impl HubDescriptor
impl HubDescriptor
pub fn hub_characteristics(&self) -> u16
Sourcepub fn from_bytes(data: &[u8]) -> Option<&Self>
pub fn from_bytes(data: &[u8]) -> Option<&Self>
从字节数组创建 HubDescriptor 引用
如果数据长度不足或描述符类型不匹配,返回 None
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 moreimpl Copy 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