#[cfg(doctest)]
#[doc = include_str!("../README.md")]
struct Readme;
pub use crate::build_shared::*;
pub use crate::decoder::{VinDecoder, VinDecoderError};
pub use crate::maps::MapError;
pub use crate::vehicle::{BodyStyle, Generation, VehicleInfo, Warning, extract_body_style};
pub mod build_shared;
pub mod decoder;
pub mod element;
pub mod maps;
pub mod pattern;
pub mod vehicle;
pub mod vin;
#[cfg(feature = "parallel")]
pub const RAYON_CHUNK_SIZE: usize = 48;
pub type VIN = String;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum CorgiError {
VinDecoder(VIN, VinDecoderError),
}
impl CorgiError {
pub fn vin(&self) -> &str {
match self {
Self::VinDecoder(vin, _) => vin,
}
}
}
impl std::fmt::Display for CorgiError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::VinDecoder(_, err) => write!(f, "{err}"),
}
}
}
impl std::error::Error for CorgiError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match self {
Self::VinDecoder(_, err) => Some(err),
}
}
}