Skip to main content

VehicleStore

Trait VehicleStore 

Source
pub trait VehicleStore: Send + Sync {
    // Required methods
    fn save_vehicle<'life0, 'life1, 'async_trait>(
        &'life0 self,
        profile: &'life1 VehicleProfile,
    ) -> Pin<Box<dyn Future<Output = Result<(), Obd2Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_vehicle<'life0, 'life1, 'async_trait>(
        &'life0 self,
        vin: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<VehicleProfile>, Obd2Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn save_thresholds<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        vin: &'life1 str,
        thresholds: &'life2 ThresholdSet,
    ) -> Pin<Box<dyn Future<Output = Result<(), Obd2Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_thresholds<'life0, 'life1, 'async_trait>(
        &'life0 self,
        vin: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<ThresholdSet>, Obd2Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Persist and retrieve vehicle profiles and threshold overrides.

A vehicle profile includes the VIN, decoded vehicle info, matched spec, and supported PID set. Threshold overrides allow per-VIN customization of alert limits beyond what the spec defines.

Required Methods§

Source

fn save_vehicle<'life0, 'life1, 'async_trait>( &'life0 self, profile: &'life1 VehicleProfile, ) -> Pin<Box<dyn Future<Output = Result<(), Obd2Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save or update a vehicle profile.

If a profile with the same VIN already exists, it is updated.

Source

fn get_vehicle<'life0, 'life1, 'async_trait>( &'life0 self, vin: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<VehicleProfile>, Obd2Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve a vehicle profile by VIN.

Returns None if the VIN is not found in storage.

Source

fn save_thresholds<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, vin: &'life1 str, thresholds: &'life2 ThresholdSet, ) -> Pin<Box<dyn Future<Output = Result<(), Obd2Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Save per-VIN threshold overrides.

These take priority over spec-defined thresholds (BR-5.1).

Source

fn get_thresholds<'life0, 'life1, 'async_trait>( &'life0 self, vin: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<ThresholdSet>, Obd2Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve per-VIN threshold overrides.

Returns None if no overrides exist for this VIN.

Implementors§