Expand description
Auto-updating VIN decoder backed by the NHTSA vPIC database.
This crate ships pre-built FST/rkyv lookup maps that get refreshed monthly from the official NHTSA vPIC dump via CI. End users get fresh decoder data without ever touching the network at runtime.
§Example
use vin_decode::Decoder;
let dec = Decoder::new()?;
let v = dec.decode("1HGCM82633A004352")?;
assert_eq!(v.make.as_deref(), Some("Honda"));Re-exports§
pub use data::BodyRow;pub use data::EngineRow;pub use data::EuModelRow;
Modules§
- data
- Internal rkyv archive types for the lookup tables.
Structs§
- Catalog
- Read-only catalog of every make and model present in the lookup data.
- Decoder
- VIN decoder backed by mmap’d FST/rkyv lookup maps.
- Vehicle
- Fully decoded vehicle attributes derived from a single VIN.
- Vin
- A validated 17-character VIN.
Enums§
- Body
Type - Vehicle bodywork type, per the EU type-approval standard — the two-letter codes from Commission Regulation (EU) 678/2011 (consolidated into the framework Reg (EU) 2018/858), the same codes printed on the Certificate of Conformity and recorded by EU national vehicle registers.
- Drive
Type - Drive layout, normalised from the free-text
drivestrings in the engine catalog ("Front Wheel Drive","All Wheel Drive", …). - Error
- Errors produced during VIN parsing and decoding.
- Fuel
Type - Fuel-type enumeration the decoder normalizes vPIC strings into.
- Transmission
- Transmission type, normalised from the free-text
gearboxstrings in the engine catalog ("6-Speed Manual","7-Speed Dual Clutch","CVT", …). Gear count is separate — seecrate::EngineRow::gearbox_speeds.
Functions§
- country_
from_ code - Map a 2-char country code (VIN positions 1-2) to a country name.
- region_
from_ code - Map a VIN’s first character (region code) to its ISO 3779 region name.