pub struct UsbIdDb { /* private fields */ }Expand description
A USB-ID lookup table: VID → vendor name and (VID, PID) → product name.
Implementations§
Source§impl UsbIdDb
impl UsbIdDb
Sourcepub fn parse(text: &str) -> Self
pub fn parse(text: &str) -> Self
Parse the linux-usb.org usb.ids text format (operator-supplied at runtime).
Lenient and panic-free: comment (#) and blank lines are skipped, a vendor
is VVVV␠␠Name at column 0, a product is ␉PPPP␠␠Name (one tab), interface
lines (two tabs) and non-vendor sections (C, AT, HID, VT, …) are
skipped, and a product only attaches to the vendor currently in scope.
Sourcepub fn common() -> Self
pub fn common() -> Self
The built-in, hand-authored table of common forensic-relevant USB vendors.
Individual VID → name facts (not the copyrightable usb.ids compilation);
zero-config coverage of the storage/controller vendors seen most in casework.
For full coverage, load usb.ids at runtime via parse.
Sourcepub fn vendor_name(&self, vid: u16) -> Option<&str>
pub fn vendor_name(&self, vid: u16) -> Option<&str>
Resolve a vendor id to its name, if known.
Sourcepub fn product_name(&self, vid: u16, pid: u16) -> Option<&str>
pub fn product_name(&self, vid: u16, pid: u16) -> Option<&str>
Resolve a (vendor, product) pair to the product name, if known.
Sourcepub fn vendor_count(&self) -> usize
pub fn vendor_count(&self) -> usize
Number of vendors in the table.