pub enum Usage {
Known(KnownUsage),
Unknown(u16),
}Expand description
A Usage ID, that does not encode its parent page.
Variants§
Known(KnownUsage)
A Usage value that remembers its parent page.
Unknown(u16)
A standalone Usage value that cannot be decoded without page context.
Implementations§
Source§impl Usage
impl Usage
Sourcepub fn new(page: UsagePage, id: u16) -> Self
pub fn new(page: UsagePage, id: u16) -> Self
Create a new Usage value, using context from a specific Usage Page.
If the Usage Page is known, this will attempt to return a KnownUsage
variant corresponding to that page.
Sourcepub fn without_page(id: u16) -> Self
pub fn without_page(id: u16) -> Self
Construct a usage without UsagePage context.
Sourcepub fn to_integer(&self) -> u16
pub fn to_integer(&self) -> u16
Return the u16 value of the usage id.
Trait Implementations§
impl Copy for Usage
impl StructuralPartialEq for Usage
Auto Trait Implementations§
impl Freeze for Usage
impl RefUnwindSafe for Usage
impl Send for Usage
impl Sync for Usage
impl Unpin for Usage
impl UnsafeUnpin for Usage
impl UnwindSafe for Usage
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