pub struct Database {
pub vendors: HashMap<u16, Vendor>,
pub classes: HashMap<u8, Class>,
}
Fields§
§vendors: HashMap<u16, Vendor>
§classes: HashMap<u8, Class>
Implementations§
Source§impl Database
impl Database
Sourcepub fn read() -> Result<Self, Error>
pub fn read() -> Result<Self, Error>
Attempt to read the database from a list of known file paths
§Errors
Returns an error when either no file could be found or the parsing fails.
Sourcepub fn read_from_file<P: AsRef<Path>>(path: P) -> Result<Self, Error>
pub fn read_from_file<P: AsRef<Path>>(path: P) -> Result<Self, Error>
Read the database from a given path
§Errors
Returns an error when the file can’t be read or when parsing fails
pub fn get_device_info( &self, vendor_id: u16, model_id: u16, subsys_vendor_id: u16, subsys_model_id: u16, ) -> DeviceInfo<'_>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Database
impl RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnwindSafe for Database
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