Skip to main content

Crate vin_decode

Crate vin_decode 

Source
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::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§

BodyClass
Coarse body-style enumeration the decoder normalizes vPIC strings into.
Error
Errors produced during VIN parsing and decoding.
FuelType
Fuel-type enumeration the decoder normalizes vPIC strings into.

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.

Type Aliases§

Result
Specialized Result alias used throughout the crate.